Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions src/asherah.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@
/// <reference types="node" />
export type AsherahConfig = {
/** The name of this service (Required) */
ServiceName: string;
readonly ServiceName: string;
/** The name of the product that owns this service (Required) */
ProductID: string;
readonly ProductID: string;
/** The amount of time a key is considered valid */
ExpireAfter: number | null;
readonly ExpireAfter: number | null;
/** The amount of time before cached keys are considered stale */
CheckInterval: number | null;
/** Determines the type of metastore to use for persisting keys (Required) { "rdbms", "dynamodb", "memory" } */
Metastore: string;
readonly CheckInterval: number | null;
/** Determines the type of metastore to use for persisting keys (Required) */
readonly Metastore: "rdbms" | "dynamodb" | "test-debug-memory" | string;
/** The database connection string (Required if metastore=rdbms) */
ConnectionString: string | null;
/** Required for Aurora sessions using write forwarding { "eventual", "global", "session" } */
ReplicaReadConsistency: string | null;
readonly ConnectionString: string | null;
/** Required for Aurora sessions using write forwarding */
readonly ReplicaReadConsistency: "eventual" | "global" | "session" | string | null;
/** An optional endpoint URL (hostname only or fully qualified URI) (only supported by metastore=dynamodb) */
DynamoDBEndpoint: string | null;
readonly DynamoDBEndpoint: string | null;
/** The AWS region for DynamoDB requests (defaults to globally configured region) (only supported by metastore=dynamodb) */
DynamoDBRegion: string | null;
readonly DynamoDBRegion: string | null;
/** The table name for DynamoDB (only supported by metastore=dynamodb) */
DynamoDBTableName: string | null;
readonly DynamoDBTableName: string | null;
/** Define the maximum number of sessions to cache (Default 1000) */
SessionCacheMaxSize: number | null;
readonly SessionCacheMaxSize: number | null;
/** The amount of time a session will remain cached (Default 2h) */
SessionCacheDuration: number | null;
/** Configures the master key management service (Default kms) { "aws", "static" } */
KMS: string | null;
readonly SessionCacheDuration: number | null;
/** Configures the master key management service (Default kms) */
readonly KMS: "aws" | "test-debug-static" | string | null;
/** Dictionary of REGION: ARN (required if kms=aws) */
RegionMap: {
[name: string]: string;
readonly RegionMap: {
readonly [name: string]: string;
} | null;
/** The preferred AWS region (required if kms=aws) */
PreferredRegion: string | null;
readonly PreferredRegion: string | null;
/** Configure the metastore to use regional suffixes (only supported by metastore=dynamodb) */
EnableRegionSuffix: boolean | null;
readonly EnableRegionSuffix: boolean | null;
/** Enable shared session caching */
EnableSessionCaching: boolean | null;
readonly EnableSessionCaching: boolean | null;
/** Enable verbose logging output */
Verbose: boolean | null;
readonly Verbose: boolean | null;
/** Disable the zero-copy optimization for the cobhan buffer protocol */
DisableZeroCopy: boolean | null;
readonly DisableZeroCopy: boolean | null;
/** Enable canary buffer corruption checks (default: false) */
EnableCanaries: boolean | null;
readonly EnableCanaries: boolean | null;
};

type LogHookCallback = (level: number, message: string) => void;
/** Callback function type for log hook */
export type LogHookCallback = (level: number, message: string) => void;

export declare function setup(config: AsherahConfig): void;
export declare function setup_async(config: AsherahConfig): Promise<void>;
Expand Down
Loading