HttpApiSecurity
Annotations
Signature
declare const annotate: {
<I, S>(tag: Tag<I, S>, value: S): <A extends HttpApiSecurity>(self: A) => A;
<A extends HttpApiSecurity, I, S>(self: A, tag: Tag<I, S>, value: S): A;
};annotateContext
Added in v1.0.0
Source
Signature
declare const annotateContext: {
<I>(context: Context<I>): <A extends HttpApiSecurity>(self: A) => A;
<A extends HttpApiSecurity, I>(self: A, context: Context<I>): A;
};Constructors
Signature
declare function apiKey(options: {
readonly in?: "header" | "query" | "cookie";
readonly key: string;
}): ApiKey;Signature
declare const basic: Basic;Create an Bearer token security scheme.
You can implement some api middleware for this security scheme using HttpApiBuilder.middlewareSecurity.
Signature
declare const bearer: Bearer;Models
Signature
interface ApiKey extends Proto<Redacted> {
readonly _tag: "ApiKey";
readonly in: "header" | "query" | "cookie";
readonly key: string;
}Signature
interface Basic extends Proto<Credentials> {
readonly _tag: "Basic";
}Signature
interface Bearer extends Proto<Redacted> {
readonly _tag: "Bearer";
}Credentials interface
Added in v1.0.0
Source
Signature
interface Credentials {
readonly password: Redacted;
readonly username: string;
}HttpApiSecurity
Added in v1.0.0
Source
HttpApiSecurity type
Added in v1.0.0
Source
Signature
type HttpApiSecurity = Bearer | ApiKey | Basic;
Create an API key security scheme.
You can implement some api middleware for this security scheme using
HttpApiBuilder.middlewareSecurity.To set the correct cookie in a handler, you can use
HttpApiBuilder.securitySetCookie.The default value for
inis "header".