Skip to content

Connectum API Reference / @connectum/auth / ProtoAuthzInterceptorOptions

Interface: ProtoAuthzInterceptorOptions ​

Defined in: packages/auth/src/types.ts:569

Proto-based authorization interceptor options.

Uses proto custom options (connectum.auth.v1) for declarative authorization rules defined in .proto files. Falls back to programmatic rules and callbacks.

Properties ​

authorize? ​

optional authorize?: (context, req) => boolean | Promise<boolean>

Defined in: packages/auth/src/types.ts:588

Programmatic authorization callback. Called when neither proto options nor programmatic rules match.

Parameters ​

context ​

AuthContext

Authenticated user context

req ​

Request info (service and method names)

method ​

string

service ​

string

Returns ​

boolean | Promise<boolean>

true if authorized, false otherwise


defaultPolicy? ​

optional defaultPolicy?: AuthzEffect

Defined in: packages/auth/src/types.ts:574

Default policy when no proto option and no rule match.

Default ​

ts
"deny"

rules? ​

optional rules?: AuthzRule[]

Defined in: packages/auth/src/types.ts:579

Additional programmatic rules, evaluated after proto options. Rules are evaluated in order; first matching rule wins.