/
opt
/
canhelp
/
node_modules
/
hono
/
dist
/
types
/
utils
/
jwt
/
/opt/canhelp/node_modules/hono/dist/types/utils/jwt
mkdir
upload
Name
Size
Mode
Actions
index.d.ts
873
0644
edit
dl
rm
jwa.d.ts
665
0644
edit
dl
rm
jws.d.ts
556
0644
edit
dl
rm
jwt.d.ts
1685
0644
edit
dl
rm
types.d.ts
2498
0644
edit
dl
rm
utf8.d.ts
154
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/hono/dist/types/utils/jwt/jwt.d.ts
(1685B)
/** * @module * JSON Web Token (JWT) * https://datatracker.ietf.org/doc/html/rfc7519 */ import type { AsymmetricAlgorithm, SignatureAlgorithm } from './jwa'; import type { HonoJsonWebKey, SignatureKey } from './jws'; import type { JWTPayload } from './types'; export interface TokenHeader { alg: SignatureAlgorithm; typ?: 'JWT'; kid?: string; } export declare function isTokenHeader(obj: unknown): obj is TokenHeader; export declare const sign: (payload: JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise<string>; export type VerifyOptions = { /** The expected issuer used for verifying the token */ iss?: string | RegExp; /** Verify the `nbf` claim (default: `true`) */ nbf?: boolean; /** Verify the `exp` claim (default: `true`) */ exp?: boolean; /** Verify the `iat` claim (default: `true`) */ iat?: boolean; /** Acceptable audience(s) for the token */ aud?: string | string[] | RegExp; }; export type VerifyOptionsWithAlg = { /** The algorithm used for decoding the token */ alg: SignatureAlgorithm; } & VerifyOptions; export declare const verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | VerifyOptionsWithAlg) => Promise<JWTPayload>; export declare const verifyWithJwks: (token: string, options: { keys?: HonoJsonWebKey[]; jwks_uri?: string; verification?: VerifyOptions; allowedAlgorithms: readonly AsymmetricAlgorithm[]; }, init?: RequestInit) => Promise<JWTPayload>; export declare const decode: (token: string) => { header: TokenHeader; payload: JWTPayload; }; export declare const decodeHeader: (token: string) => TokenHeader;
Save
cmd:
run