Skip to main content

Interface: AuthorizationConfig

Defined in: nestlens.config.ts:68

Authorization configuration for NestLens dashboard access

Properties​

allowedEnvironments?​

optional allowedEnvironments: string[] | null

Defined in: nestlens.config.ts:74

Allowed environments where NestLens is accessible. Set to null to allow all environments. Default: ['development', 'local', 'test']


allowedIps?​

optional allowedIps: string[]

Defined in: nestlens.config.ts:85

IP addresses allowed to access NestLens (supports wildcards like '192.168.1.*')


canAccess()?​

optional canAccess: (req) => boolean | AuthUser | Promise<boolean | AuthUser>

Defined in: nestlens.config.ts:91

Custom authorization function. Return true/false for simple auth, or AuthUser object for user context.

Parameters​

req​

Request

Returns​

boolean | AuthUser | Promise<boolean | AuthUser>


environmentVariable?​

optional environmentVariable: string

Defined in: nestlens.config.ts:80

Environment variable to check for current environment. Default: 'NODE_ENV'


requiredRoles?​

optional requiredRoles: string[]

Defined in: nestlens.config.ts:96

Required roles for access (checked against AuthUser.roles if canAccess returns AuthUser)