Skip to content

jin-frame / providers/security/ApiKeyProvider / ApiKeyProvider

Class: ApiKeyProvider

Defined in: packages/jin-frame/src/providers/security/ApiKeyProvider.ts:9

API Key security provider that implements authentication using API keys. Supports API key placement in headers, query parameters, or cookies.

Implements

Constructors

Constructor

new ApiKeyProvider(name, keyName, location): ApiKeyProvider

Defined in: packages/jin-frame/src/providers/security/ApiKeyProvider.ts:28

Creates a new API Key provider

Parameters

name

string

Name of this security provider instance

keyName

string

The name of the API key parameter (e.g., 'X-API-Key', 'apikey')

location

Where to place the API key: 'header', 'query', or 'cookie'

"header" | "query" | "cookie"

Returns

ApiKeyProvider

Properties

name

readonly name: string

Defined in: packages/jin-frame/src/providers/security/ApiKeyProvider.ts:14

Name of this security provider instance

Implementation of

ISecurityProvider.name


type

readonly type: "api-key"

Defined in: packages/jin-frame/src/providers/security/ApiKeyProvider.ts:11

Type identifier for this security provider

Implementation of

ISecurityProvider.type

Methods

createContext()

createContext(authorization?, dynamicKey?): ISecurityContext

Defined in: packages/jin-frame/src/providers/security/ApiKeyProvider.ts:40

Creates security context with API key authentication

Parameters

authorization?

AuthorizationData

Authorization data containing the API key

dynamicKey?

string

Optional dynamic API key that overrides the authorization data

Returns

ISecurityContext

Security context with the API key applied to the appropriate location

Implementation of

ISecurityProvider.createContext