Interface: AuthGateConfig
Options for the authGate plugin (all resolvable from env - see below).
Extends
Section titled “Extends”BasePluginConfig.AuthStorageConfig
Indexable
Section titled “Indexable”[
key:string]:unknown
Properties
Section titled “Properties”allow?
Section titled “allow?”
optionalallow?:string|string[]
Allow-list patterns (domain / glob / /regex/). Empty = allow nobody. Env TUNNEL_AUTH_ALLOW.
authorizeIdentity?
Section titled “authorizeIdentity?”
optionalauthorizeIdentity?:AuthorizeIdentity
Identity authorization independent of authentication. Defaults to the configured allow-list and is re-evaluated for every accepted session.
brandName?
Section titled “brandName?”
optionalbrandName?:string
Display name used in the code email copy. Env TUNNEL_AUTH_BRAND_NAME.
Defaults to the brand context’s name - the app’s own branding/brand.yaml
when it has one, else the dbx-tools default. Set this only to override the
brand for this gate.
codeTtlSeconds?
Section titled “codeTtlSeconds?”
optionalcodeTtlSeconds?:number
One-time-code lifetime (seconds). Env TUNNEL_AUTH_CODE_TTL. Default 600 (10m).
forwardHeaders?
Section titled “forwardHeaders?”
optionalforwardHeaders?:string|string[]
Extra x- request headers tunnel traffic may forward (literal / glob /
/regex/), unioned with the built-in allow-list. Env TUNNEL_FORWARD_HEADERS.
gatePaths?
Section titled “gatePaths?”
optionalgatePaths?:string|string[]
Path prefixes to gate beyond the built-in /api/ (literal prefixes, comma-
or space-separated as a string). For an app whose privileged surface is not
under /api/ — e.g. a WebSocket at /ws — list those prefixes so they
require a session too. Env TUNNEL_GATE_PATHS.
optionalhost?:string
Inherited from
Section titled “Inherited from”BasePluginConfig.host
insecure?
Section titled “insecure?”
optionalinsecure?:boolean
Run OPEN with no gate (env TUNNEL_INSECURE=true). The login routes and gate
middleware are not mounted, and the SMTP fail-fast is skipped. Use only when
the tunnel is deliberately public.
logoutRedirectPath?
Section titled “logoutRedirectPath?”
optionallogoutRedirectPath?:string
Same-origin path returned after a successful logout. Env
TUNNEL_AUTH_LOGOUT_REDIRECT. Defaults to /, where the AuthGate presents
login again.
maxAttempts?
Section titled “maxAttempts?”
optionalmaxAttempts?:number
Max verify attempts per issued code. Default 5.
message?
Section titled “message?”
optionalmessage?:string
Line shown immediately above the code in the email. Env TUNNEL_AUTH_MESSAGE.
Keep the code on its OWN line directly after this text - that adjacency is what the platform code-detection heuristics key on.
optionalname?:string
Inherited from
Section titled “Inherited from”BasePluginConfig.name
publicDomain?
Section titled “publicDomain?”
optionalpublicDomain?:string
The public <subdomain>.<server> that identifies portr traffic by its Host
header. Only requests whose Host matches this are gated; everything else
(the platform front door, other local callers) passes through. Env
TUNNEL_PUBLIC_DOMAIN. When absent, the gate is inert (nothing is tunnel
traffic).
publicDomains?
Section titled “publicDomains?”
optionalpublicDomains?:string|string[]
Additional public tunnel domains accepted by the gate.
sendCode?
Section titled “sendCode?”
optionalsendCode?: (code,opts) =>Promise<void>
Deliver a code to an address. Defaults to sending through the host app’s
shared @dbx-tools/email transport (see ./send-code); override to wire a
different delivery path.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<void>
sessionCutoff?
Section titled “sessionCutoff?”
optionalsessionCutoff?:string|number|Date
Force-clear cutoff: every session issued BEFORE it stops verifying, so moving it forward signs everyone out. Env TUNNEL_AUTH_SESSION_CUTOFF.
Anything object.toDate accepts: a Date, 2026-08-02, an ISO instant,
epoch seconds/millis, or a relative duration (-30d, 7 days ago). Unset
means no cutoff.
sessionTtlSeconds?
Section titled “sessionTtlSeconds?”
optionalsessionTtlSeconds?:number
Session lifetime (seconds). Env TUNNEL_AUTH_SESSION_TTL. Default 2592000 (30d).
Matched to the cache-backed signing key’s own 30-day TTL (see
./signing-key.ts): the cookie and the key that validates it should expire
together, or one silently outlives the other.
sqlitePath?
Section titled “sqlitePath?”
optionalsqlitePath?:string
Inherited from
Section titled “Inherited from”AuthStorageConfig.sqlitePath
storage?
Section titled “storage?”
optionalstorage?:AuthStorageMode
Inherited from
Section titled “Inherited from”AuthStorageConfig.storage
subject?
Section titled “subject?”
optionalsubject?:string
Subject line for the code email. Env TUNNEL_AUTH_SUBJECT.
Defaults to “Your verification code”. The wording of the subject and message is deliberately the conventional phrasing rather than anything branded: iOS, Gmail, Outlook, and Android all detect a one-time code from this shape and offer to autofill it, and a novel phrasing is what breaks that detection.
This is the subject TEMPLATE, not the literal line sent: the code is spliced
into it ("123456 is your verification code") because a push notification
shows only the subject and preheader, and that notification is what mobile
autofill reads. See codeEmailSubject in ./code-email.ts.
telemetry?
Section titled “telemetry?”
optionaltelemetry?:TelemetryOptions
Inherited from
Section titled “Inherited from”BasePluginConfig.telemetry