0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 18:18:57 +01:00

chore(utils/jwt): add @module docs (#3101)

This commit is contained in:
Yusuke Wada 2024-07-06 16:10:49 +09:00 committed by GitHub
parent e513fe7c46
commit a90ff2d4fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 5 deletions

View File

@ -1,5 +1,8 @@
// JSON Web Algorithms (JWA)
// https://datatracker.ietf.org/doc/html/rfc7518
/**
* @module
* JSON Web Algorithms (JWA)
* https://datatracker.ietf.org/doc/html/rfc7518
*/
export enum AlgorithmTypes {
HS256 = 'HS256',

View File

@ -1,12 +1,15 @@
/**
* @module
* JSON Web Signature (JWS)
* https://datatracker.ietf.org/doc/html/rfc7515
*/
import { getRuntimeKey } from '../../helper/adapter'
import { decodeBase64 } from '../encode'
import type { SignatureAlgorithm } from './jwa'
import { CryptoKeyUsage, JwtAlgorithmNotImplemented } from './types'
import { utf8Encoder } from './utf8'
// JSON Web Signature (JWS)
// https://datatracker.ietf.org/doc/html/rfc7515
type KeyImporterAlgorithm = Parameters<typeof crypto.subtle.importKey>[2]
type KeyAlgorithm =
| AlgorithmIdentifier

View File

@ -1,3 +1,9 @@
/**
* @module
* JSON Web Token (JWT)
* https://datatracker.ietf.org/doc/html/rfc7519
*/
import { decodeBase64Url, encodeBase64Url } from '../../utils/encode'
import { AlgorithmTypes } from './jwa'
import type { SignatureAlgorithm } from './jwa'

View File

@ -1,3 +1,8 @@
/**
* @module
* Type definitions for JWT utilities.
*/
export class JwtAlgorithmNotImplemented extends Error {
constructor(alg: string) {
super(`${alg} is not an implemented algorithm`)

View File

@ -1,2 +1,7 @@
/**
* @module
* Functions for encoding/decoding UTF8.
*/
export const utf8Encoder: TextEncoder = new TextEncoder()
export const utf8Decoder: TextDecoder = new TextDecoder()