Skip to content

lightgun-poc / lib/auth / KeyGate

Interface: KeyGate ​

Defined in: lib/auth.ts:62

Decides, per connection, whether a presented key opens the gate.

Properties ​

key ​

key: string | null

Defined in: lib/auth.ts:64

The session key network clients must present; null = gate open.

Methods ​

allow() ​

allow(remoteAddress, presented): boolean

Defined in: lib/auth.ts:68

The one question both intakes ask.

Parameters ​

remoteAddress ​

string | undefined

presented ​

string | null | undefined

Returns ​

boolean


required() ​

required(remoteAddress): boolean

Defined in: lib/auth.ts:66

Whether this particular connection must present the key at all.

Parameters ​

remoteAddress ​

string | undefined

Returns ​

boolean

Released under the MIT License.