Skip to content

Connectum API Reference / @connectum/auth / ProtoAuthzInterceptorOptions

Interface: ProtoAuthzInterceptorOptions

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

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:417

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:403

Default policy when no proto option and no rule match.

Default

ts
"deny"

rules?

optional rules?: AuthzRule[]

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

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