@pagopa/io-react-native-jwt 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +21 -16
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/pagopa/ioreactnativejwt/IoReactNativeJwtModule.kt +19 -15
- package/lib/commonjs/algorithms.js +7 -9
- package/lib/commonjs/algorithms.js.map +1 -1
- package/lib/commonjs/hash.js +2 -2
- package/lib/commonjs/hash.js.map +1 -1
- package/lib/commonjs/index.js +9 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/jwe/index.js +1 -1
- package/lib/commonjs/jwe/index.js.map +1 -1
- package/lib/commonjs/jwk/index.js +6 -7
- package/lib/commonjs/jwk/index.js.map +1 -1
- package/lib/commonjs/jwt/index.js +12 -13
- package/lib/commonjs/jwt/index.js.map +1 -1
- package/lib/commonjs/jwt/jwt_claims_set.js +5 -6
- package/lib/commonjs/jwt/jwt_claims_set.js.map +1 -1
- package/lib/commonjs/jwt/produce.js +5 -5
- package/lib/commonjs/jwt/produce.js.map +1 -1
- package/lib/commonjs/jwt/sign.js +5 -5
- package/lib/commonjs/jwt/sign.js.map +1 -1
- package/lib/commonjs/jwt/unsecured.js +5 -5
- package/lib/commonjs/jwt/unsecured.js.map +1 -1
- package/lib/commonjs/types.js +2 -4
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/asn1.js +4 -4
- package/lib/commonjs/utils/asn1.js.map +1 -1
- package/lib/commonjs/utils/base64.js +1 -1
- package/lib/commonjs/utils/base64.js.map +1 -1
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/errors.js +3 -8
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/is_object.js.map +1 -1
- package/lib/commonjs/utils/proxy.js +1 -2
- package/lib/commonjs/utils/proxy.js.map +1 -1
- package/lib/commonjs/utils/secs.js.map +1 -1
- package/lib/module/algorithms.js +8 -7
- package/lib/module/algorithms.js.map +1 -1
- package/lib/module/hash.js +4 -2
- package/lib/module/hash.js.map +1 -1
- package/lib/module/index.js +11 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/jwe/index.js +3 -1
- package/lib/module/jwe/index.js.map +1 -1
- package/lib/module/jwk/index.js +7 -6
- package/lib/module/jwk/index.js.map +1 -1
- package/lib/module/jwt/index.js +14 -13
- package/lib/module/jwt/index.js.map +1 -1
- package/lib/module/jwt/jwt_claims_set.js +6 -5
- package/lib/module/jwt/jwt_claims_set.js.map +1 -1
- package/lib/module/jwt/produce.js +4 -2
- package/lib/module/jwt/produce.js.map +1 -1
- package/lib/module/jwt/sign.js +7 -5
- package/lib/module/jwt/sign.js.map +1 -1
- package/lib/module/jwt/unsecured.js +6 -4
- package/lib/module/jwt/unsecured.js.map +1 -1
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/asn1.js +6 -4
- package/lib/module/utils/asn1.js.map +1 -1
- package/lib/module/utils/base64.js +3 -1
- package/lib/module/utils/base64.js.map +1 -1
- package/lib/module/utils/crypto.js +2 -0
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/errors.js +5 -8
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/is_object.js +2 -0
- package/lib/module/utils/is_object.js.map +1 -1
- package/lib/module/utils/proxy.js +2 -0
- package/lib/module/utils/proxy.js.map +1 -1
- package/lib/module/utils/secs.js +4 -2
- package/lib/module/utils/secs.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/{algorithms.d.ts → commonjs/src/algorithms.d.ts} +1 -1
- package/lib/typescript/commonjs/src/algorithms.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jwe/index.d.ts.map +1 -0
- package/lib/typescript/{jwk → commonjs/src/jwk}/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/jwk/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jwt/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jwt/jwt_claims_set.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jwt/produce.d.ts.map +1 -0
- package/lib/typescript/{jwt → commonjs/src/jwt}/sign.d.ts +1 -1
- package/lib/typescript/commonjs/src/jwt/sign.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jwt/unsecured.d.ts.map +1 -0
- package/lib/typescript/{types.d.ts → commonjs/src/types.d.ts} +2 -2
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/asn1.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/base64.d.ts.map +1 -0
- package/lib/typescript/{utils → commonjs/src/utils}/crypto.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/crypto.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/is_object.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/proxy.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/secs.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/algorithms.d.ts +8 -0
- package/lib/typescript/module/src/algorithms.d.ts.map +1 -0
- package/lib/typescript/module/src/hash.d.ts +5 -0
- package/lib/typescript/module/src/hash.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +12 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jwe/index.d.ts +32 -0
- package/lib/typescript/module/src/jwe/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jwk/index.d.ts +30 -0
- package/lib/typescript/module/src/jwk/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jwt/index.d.ts +102 -0
- package/lib/typescript/module/src/jwt/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jwt/jwt_claims_set.d.ts +4 -0
- package/lib/typescript/module/src/jwt/jwt_claims_set.d.ts.map +1 -0
- package/lib/typescript/module/src/jwt/produce.d.ts +55 -0
- package/lib/typescript/module/src/jwt/produce.d.ts.map +1 -0
- package/lib/typescript/module/src/jwt/sign.d.ts +61 -0
- package/lib/typescript/module/src/jwt/sign.d.ts.map +1 -0
- package/lib/typescript/module/src/jwt/unsecured.d.ts +64 -0
- package/lib/typescript/module/src/jwt/unsecured.d.ts.map +1 -0
- package/lib/typescript/module/src/types.d.ts +475 -0
- package/lib/typescript/module/src/types.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/asn1.d.ts +3 -0
- package/lib/typescript/module/src/utils/asn1.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/base64.d.ts +5 -0
- package/lib/typescript/module/src/utils/base64.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/crypto.d.ts +25 -0
- package/lib/typescript/module/src/utils/crypto.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/errors.d.ts +194 -0
- package/lib/typescript/module/src/utils/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/is_object.d.ts +2 -0
- package/lib/typescript/module/src/utils/is_object.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/proxy.d.ts +2 -0
- package/lib/typescript/module/src/utils/proxy.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/secs.d.ts +4 -0
- package/lib/typescript/module/src/utils/secs.d.ts.map +1 -0
- package/package.json +60 -33
- package/pagopa-io-react-native-jwt.podspec +17 -17
- package/src/jwt/sign.ts +1 -1
- package/src/types.ts +2 -2
- package/src/utils/crypto.ts +1 -1
- package/lib/typescript/algorithms.d.ts.map +0 -1
- package/lib/typescript/hash.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/jwe/index.d.ts.map +0 -1
- package/lib/typescript/jwk/index.d.ts.map +0 -1
- package/lib/typescript/jwt/index.d.ts.map +0 -1
- package/lib/typescript/jwt/jwt_claims_set.d.ts.map +0 -1
- package/lib/typescript/jwt/produce.d.ts.map +0 -1
- package/lib/typescript/jwt/sign.d.ts.map +0 -1
- package/lib/typescript/jwt/unsecured.d.ts.map +0 -1
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/asn1.d.ts.map +0 -1
- package/lib/typescript/utils/base64.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/errors.d.ts.map +0 -1
- package/lib/typescript/utils/is_object.d.ts.map +0 -1
- package/lib/typescript/utils/proxy.d.ts.map +0 -1
- package/lib/typescript/utils/secs.d.ts.map +0 -1
- /package/lib/typescript/{hash.d.ts → commonjs/src/hash.d.ts} +0 -0
- /package/lib/typescript/{index.d.ts → commonjs/src/index.d.ts} +0 -0
- /package/lib/typescript/{jwe → commonjs/src/jwe}/index.d.ts +0 -0
- /package/lib/typescript/{jwt → commonjs/src/jwt}/index.d.ts +0 -0
- /package/lib/typescript/{jwt → commonjs/src/jwt}/jwt_claims_set.d.ts +0 -0
- /package/lib/typescript/{jwt → commonjs/src/jwt}/produce.d.ts +0 -0
- /package/lib/typescript/{jwt → commonjs/src/jwt}/unsecured.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/asn1.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/base64.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/errors.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/is_object.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/proxy.d.ts +0 -0
- /package/lib/typescript/{utils → commonjs/src/utils}/secs.d.ts +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { JWSHeaderParameters, JWTDecodeResult } from '../types';
|
|
2
|
+
import { ProduceJWT } from './produce';
|
|
3
|
+
import type { CryptoContext } from '../utils/crypto';
|
|
4
|
+
/**
|
|
5
|
+
* The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage with a given signature
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* const crypto: Crypto = { any implementation fo Crypto interface }
|
|
11
|
+
*
|
|
12
|
+
* const jwt = new SignJWT(crypto)
|
|
13
|
+
* .setPayload({ 'urn:example:claim': true })
|
|
14
|
+
* .setProtectedHeader({ typ })
|
|
15
|
+
* .setIssuedAt()
|
|
16
|
+
* .setIssuer('urn:example:issuer')
|
|
17
|
+
* .setAudience('urn:example:audience')
|
|
18
|
+
* .setExpirationTime('2h')
|
|
19
|
+
*
|
|
20
|
+
* jwt.data()
|
|
21
|
+
* await jwt.sign()
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class SignJWT extends ProduceJWT {
|
|
25
|
+
private _protectedHeader;
|
|
26
|
+
private crypto;
|
|
27
|
+
/**
|
|
28
|
+
* @param crypto An implementation of the crypto interface. @see utils/crypto for more.
|
|
29
|
+
*/
|
|
30
|
+
constructor(crypto: CryptoContext);
|
|
31
|
+
/**
|
|
32
|
+
* Sets the JWS Protected Header on the SignJWT object.
|
|
33
|
+
* Any invocation overrides what's been already put in the header.
|
|
34
|
+
* Value for "alg" are ignored, as it will be inferred by the key used by the cryptographic context.
|
|
35
|
+
*
|
|
36
|
+
* @param protectedHeader JWS Protected Header.
|
|
37
|
+
*/
|
|
38
|
+
setProtectedHeader(protectedHeader: Omit<JWSHeaderParameters, 'alg'>): this;
|
|
39
|
+
/**
|
|
40
|
+
* Return a JWT without signature (`header.payload`).
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
private unsigned;
|
|
44
|
+
private getSelectedSigningAlgorithm;
|
|
45
|
+
/**
|
|
46
|
+
* Return a signed JWT.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
sign(): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Plain data of the produced JWT
|
|
52
|
+
*/
|
|
53
|
+
data(): JWTDecodeResult;
|
|
54
|
+
/**
|
|
55
|
+
* Decodes a signed JWT
|
|
56
|
+
*
|
|
57
|
+
* @param jwt JWT to sign that needs to be decoded.
|
|
58
|
+
*/
|
|
59
|
+
static decode(jwt: string): JWTDecodeResult;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=sign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../../src/jwt/sign.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,OAAO,CAAC,gBAAgB,CAAwC;IAChE,OAAO,CAAC,MAAM,CAAgB;IAE9B;;OAEG;gBACS,MAAM,EAAE,aAAa;IAKjC;;;;;;OAMG;IACH,kBAAkB,CAAC,eAAe,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC;IAKpE;;;OAGG;YACW,QAAQ;YASR,2BAA2B;IAUzC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAa7B;;OAEG;IACH,IAAI,IAAI,eAAe;IAIvB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;CAkC5C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { JWTClaimVerificationOptions, JWTPayload, JWTUnsecuredHeaderParameters } from '../types';
|
|
2
|
+
import { ProduceJWT } from './produce';
|
|
3
|
+
export interface UnsecuredResult {
|
|
4
|
+
payload: JWTPayload;
|
|
5
|
+
header: JWTUnsecuredHeaderParameters;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The UnsecuredJWT class is a utility for dealing with `{ "alg": "none" }` Unsecured JWTs.
|
|
9
|
+
*
|
|
10
|
+
* @example Encoding
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* const unsecuredJwt = new UnsecuredJWT({ 'urn:example:claim': true })
|
|
14
|
+
* .setIssuedAt()
|
|
15
|
+
* .setIssuer('urn:example:issuer')
|
|
16
|
+
* .setAudience('urn:example:audience')
|
|
17
|
+
* .setExpirationTime('2h')
|
|
18
|
+
* .encode()
|
|
19
|
+
*
|
|
20
|
+
* console.log(unsecuredJwt)
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Decoding
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* const payload = UnsecuredJWT.decode(jwt, {
|
|
27
|
+
* issuer: 'urn:example:issuer',
|
|
28
|
+
* audience: 'urn:example:audience',
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* console.log(payload)
|
|
32
|
+
* ```
|
|
33
|
+
* * @example JWT content ToSign
|
|
34
|
+
*
|
|
35
|
+
* ```js
|
|
36
|
+
* const jwtToSign = new UnsecuredJWT({ 'urn:example:claim': true })
|
|
37
|
+
* .setIssuedAt()
|
|
38
|
+
* .setIssuer('urn:example:issuer')
|
|
39
|
+
* .setAudience('urn:example:audience')
|
|
40
|
+
* .setExpirationTime('2h')
|
|
41
|
+
* .toSign()
|
|
42
|
+
*
|
|
43
|
+
* console.log(jwtToSign)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class UnsecuredJWT extends ProduceJWT {
|
|
47
|
+
/** Encodes the Unsecured JWT. */
|
|
48
|
+
encode(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Decodes an unsecured JWT.
|
|
51
|
+
*
|
|
52
|
+
* @param jwt Unsecured JWT to decode the payload of.
|
|
53
|
+
* @param options JWT Claims Set validation options.
|
|
54
|
+
*/
|
|
55
|
+
static decode(jwt: string, options?: JWTClaimVerificationOptions): UnsecuredResult;
|
|
56
|
+
/**
|
|
57
|
+
* Decodes an unsecured JWT payload.
|
|
58
|
+
*
|
|
59
|
+
* @param jwt Unsecured JWT payload to decode.
|
|
60
|
+
* @param options JWT Claims Set validation options.
|
|
61
|
+
*/
|
|
62
|
+
static decodePayload(jwt: string, options?: JWTClaimVerificationOptions): JWTPayload;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=unsecured.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsecured.d.ts","sourceRoot":"","sources":["../../../../../src/jwt/unsecured.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,UAAU,EACV,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,4BAA4B,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,iCAAiC;IACjC,MAAM,IAAI,MAAM;IAOhB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe;IA6BlB;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,2BAA2B,GACpC,UAAU;CAed"}
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { SupportedAlgorithm } from './algorithms';
|
|
3
|
+
export interface JWTDecodeResult {
|
|
4
|
+
/** JWT Claims Set. */
|
|
5
|
+
payload: JWTPayload;
|
|
6
|
+
/** JWS Protected Header. */
|
|
7
|
+
protectedHeader: JWSHeaderParameters;
|
|
8
|
+
}
|
|
9
|
+
export interface JoseHeaderParameters {
|
|
10
|
+
/** "kid" (Key ID) Header Parameter. */
|
|
11
|
+
kid?: string;
|
|
12
|
+
/** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter. */
|
|
13
|
+
x5t?: string;
|
|
14
|
+
/** "x5c" (X.509 Certificate Chain) Header Parameter. */
|
|
15
|
+
x5c?: string[];
|
|
16
|
+
/** "x5u" (X.509 URL) Header Parameter. */
|
|
17
|
+
x5u?: string;
|
|
18
|
+
/** "jku" (JWK Set URL) Header Parameter. */
|
|
19
|
+
jku?: string;
|
|
20
|
+
/** "jwk" (JSON Web Key) Header Parameter. */
|
|
21
|
+
jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n'>;
|
|
22
|
+
/** "typ" (Type) Header Parameter. */
|
|
23
|
+
typ?: string;
|
|
24
|
+
/** "cty" (Content Type) Header Parameter. */
|
|
25
|
+
cty?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
|
|
28
|
+
export interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
29
|
+
/** JWS "alg" (Algorithm) Header Parameter. */
|
|
30
|
+
alg?: SupportedAlgorithm;
|
|
31
|
+
/**
|
|
32
|
+
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
|
|
33
|
+
* Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
|
|
34
|
+
*/
|
|
35
|
+
b64?: boolean;
|
|
36
|
+
/** JWS "crit" (Critical) Header Parameter. */
|
|
37
|
+
crit?: string[];
|
|
38
|
+
/** Any other JWS Header member. */
|
|
39
|
+
[propName: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
/** JOSE Header for an unsecued JWT */
|
|
42
|
+
export interface JWTUnsecuredHeaderParameters extends JoseHeaderParameters {
|
|
43
|
+
alg?: 'none';
|
|
44
|
+
}
|
|
45
|
+
/** Recognized JWE Header Parameters, any other Header members may also be present. */
|
|
46
|
+
export interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
47
|
+
/** JWE "alg" (Algorithm) Header Parameter. */
|
|
48
|
+
alg?: 'RSA-OAEP-256' | 'RSA-OAEP' | 'ECDH-ES';
|
|
49
|
+
/** JWE "enc" (Encryption Algorithm) Header Parameter. */
|
|
50
|
+
enc?: 'A256CBC-HS512' | 'A128CBC-HS256' | 'A128CBC-HS256';
|
|
51
|
+
/** Any other JWE Header member. */
|
|
52
|
+
[propName: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
/** Recognized JWT Claims Set members, any other members may also be present. */
|
|
55
|
+
export interface JWTPayload {
|
|
56
|
+
/**
|
|
57
|
+
* JWT Issuer
|
|
58
|
+
*
|
|
59
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
|
|
60
|
+
*/
|
|
61
|
+
iss?: string;
|
|
62
|
+
/**
|
|
63
|
+
* JWT Subject
|
|
64
|
+
*
|
|
65
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
|
|
66
|
+
*/
|
|
67
|
+
sub?: string;
|
|
68
|
+
/**
|
|
69
|
+
* JWT Audience
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
|
|
72
|
+
*/
|
|
73
|
+
aud?: string | string[];
|
|
74
|
+
/**
|
|
75
|
+
* JWT ID
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
|
|
78
|
+
*/
|
|
79
|
+
jti?: string;
|
|
80
|
+
/**
|
|
81
|
+
* JWT Not Before
|
|
82
|
+
*
|
|
83
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
|
|
84
|
+
*/
|
|
85
|
+
nbf?: number;
|
|
86
|
+
/**
|
|
87
|
+
* JWT Expiration Time
|
|
88
|
+
*
|
|
89
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
|
|
90
|
+
*/
|
|
91
|
+
exp?: number;
|
|
92
|
+
/**
|
|
93
|
+
* JWT Issued At
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
|
|
96
|
+
*/
|
|
97
|
+
iat?: number;
|
|
98
|
+
/** Any other JWT Claim Set member. */
|
|
99
|
+
[propName: string]: unknown;
|
|
100
|
+
}
|
|
101
|
+
/** JWT Claims Set verification options. */
|
|
102
|
+
export interface JWTClaimVerificationOptions {
|
|
103
|
+
/** Expected JWT "aud" (Audience) Claim value(s). */
|
|
104
|
+
audience?: string | string[];
|
|
105
|
+
/**
|
|
106
|
+
* Expected clock tolerance
|
|
107
|
+
*
|
|
108
|
+
* - In seconds when number (e.g. 5)
|
|
109
|
+
* - Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
|
|
110
|
+
*/
|
|
111
|
+
clockTolerance?: string | number;
|
|
112
|
+
/** Expected JWT "iss" (Issuer) Claim value(s). */
|
|
113
|
+
issuer?: string | string[];
|
|
114
|
+
/**
|
|
115
|
+
* Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
|
|
116
|
+
*
|
|
117
|
+
* - In seconds when number (e.g. 5)
|
|
118
|
+
* - Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
|
|
119
|
+
*/
|
|
120
|
+
maxTokenAge?: string | number;
|
|
121
|
+
/** Expected JWT "sub" (Subject) Claim value. */
|
|
122
|
+
subject?: string;
|
|
123
|
+
/** Expected JWT "typ" (Type) Header Parameter value. */
|
|
124
|
+
typ?: string;
|
|
125
|
+
/** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
|
|
126
|
+
currentDate?: Date;
|
|
127
|
+
/**
|
|
128
|
+
* Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
|
|
129
|
+
* the {@link JWTClaimVerificationOptions.issuer issuer option} is set, then "iss" must be present;
|
|
130
|
+
* if the {@link JWTClaimVerificationOptions.audience audience option} is set, then "aud" must be
|
|
131
|
+
* present; if the {@link JWTClaimVerificationOptions.subject subject option} is set, then "sub"
|
|
132
|
+
* must be present; if the {@link JWTClaimVerificationOptions.maxTokenAge maxTokenAge option} is
|
|
133
|
+
* set, then "iat" must be present.
|
|
134
|
+
*/
|
|
135
|
+
requiredClaims?: string[];
|
|
136
|
+
}
|
|
137
|
+
export type JWK = z.infer<typeof JWK>;
|
|
138
|
+
export declare const JWK: z.ZodObject<{
|
|
139
|
+
alg: z.ZodOptional<z.ZodString>;
|
|
140
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
141
|
+
d: z.ZodOptional<z.ZodString>;
|
|
142
|
+
dp: z.ZodOptional<z.ZodString>;
|
|
143
|
+
dq: z.ZodOptional<z.ZodString>;
|
|
144
|
+
e: z.ZodOptional<z.ZodString>;
|
|
145
|
+
/** JWK "ext" (Extractable) Parameter. */
|
|
146
|
+
ext: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
k: z.ZodOptional<z.ZodString>;
|
|
148
|
+
/** JWK "key_ops" (Key Operations) Parameter. */
|
|
149
|
+
key_ops: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
150
|
+
/** JWK "kid" (Key ID) Parameter. */
|
|
151
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
152
|
+
/** JWK "kty" (Key Type) Parameter.
|
|
153
|
+
* This attribute is required to discriminate the
|
|
154
|
+
* type of EC/RSA algorithm */
|
|
155
|
+
kty: z.ZodString;
|
|
156
|
+
n: z.ZodOptional<z.ZodString>;
|
|
157
|
+
oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
158
|
+
d: z.ZodOptional<z.ZodString>;
|
|
159
|
+
r: z.ZodOptional<z.ZodString>;
|
|
160
|
+
t: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
d?: string | undefined;
|
|
163
|
+
r?: string | undefined;
|
|
164
|
+
t?: string | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
d?: string | undefined;
|
|
167
|
+
r?: string | undefined;
|
|
168
|
+
t?: string | undefined;
|
|
169
|
+
}>, "many">>;
|
|
170
|
+
p: z.ZodOptional<z.ZodString>;
|
|
171
|
+
q: z.ZodOptional<z.ZodString>;
|
|
172
|
+
qi: z.ZodOptional<z.ZodString>;
|
|
173
|
+
/** JWK "use" (Public Key Use) Parameter. */
|
|
174
|
+
use: z.ZodOptional<z.ZodString>;
|
|
175
|
+
x: z.ZodOptional<z.ZodString>;
|
|
176
|
+
y: z.ZodOptional<z.ZodString>;
|
|
177
|
+
/** JWK "x5c" (X.509 Certificate Chain) Parameter. */
|
|
178
|
+
x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
179
|
+
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter. */
|
|
180
|
+
x5t: z.ZodOptional<z.ZodString>;
|
|
181
|
+
/** "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter. */
|
|
182
|
+
'x5t#S256': z.ZodOptional<z.ZodString>;
|
|
183
|
+
/** JWK "x5u" (X.509 URL) Parameter. */
|
|
184
|
+
x5u: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
kty: string;
|
|
187
|
+
alg?: string | undefined;
|
|
188
|
+
crv?: string | undefined;
|
|
189
|
+
d?: string | undefined;
|
|
190
|
+
dp?: string | undefined;
|
|
191
|
+
dq?: string | undefined;
|
|
192
|
+
e?: string | undefined;
|
|
193
|
+
ext?: boolean | undefined;
|
|
194
|
+
k?: string | undefined;
|
|
195
|
+
key_ops?: string[] | undefined;
|
|
196
|
+
kid?: string | undefined;
|
|
197
|
+
n?: string | undefined;
|
|
198
|
+
oth?: {
|
|
199
|
+
d?: string | undefined;
|
|
200
|
+
r?: string | undefined;
|
|
201
|
+
t?: string | undefined;
|
|
202
|
+
}[] | undefined;
|
|
203
|
+
p?: string | undefined;
|
|
204
|
+
q?: string | undefined;
|
|
205
|
+
qi?: string | undefined;
|
|
206
|
+
use?: string | undefined;
|
|
207
|
+
x?: string | undefined;
|
|
208
|
+
y?: string | undefined;
|
|
209
|
+
x5c?: string[] | undefined;
|
|
210
|
+
x5t?: string | undefined;
|
|
211
|
+
'x5t#S256'?: string | undefined;
|
|
212
|
+
x5u?: string | undefined;
|
|
213
|
+
}, {
|
|
214
|
+
kty: string;
|
|
215
|
+
alg?: string | undefined;
|
|
216
|
+
crv?: string | undefined;
|
|
217
|
+
d?: string | undefined;
|
|
218
|
+
dp?: string | undefined;
|
|
219
|
+
dq?: string | undefined;
|
|
220
|
+
e?: string | undefined;
|
|
221
|
+
ext?: boolean | undefined;
|
|
222
|
+
k?: string | undefined;
|
|
223
|
+
key_ops?: string[] | undefined;
|
|
224
|
+
kid?: string | undefined;
|
|
225
|
+
n?: string | undefined;
|
|
226
|
+
oth?: {
|
|
227
|
+
d?: string | undefined;
|
|
228
|
+
r?: string | undefined;
|
|
229
|
+
t?: string | undefined;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
p?: string | undefined;
|
|
232
|
+
q?: string | undefined;
|
|
233
|
+
qi?: string | undefined;
|
|
234
|
+
use?: string | undefined;
|
|
235
|
+
x?: string | undefined;
|
|
236
|
+
y?: string | undefined;
|
|
237
|
+
x5c?: string[] | undefined;
|
|
238
|
+
x5t?: string | undefined;
|
|
239
|
+
'x5t#S256'?: string | undefined;
|
|
240
|
+
x5u?: string | undefined;
|
|
241
|
+
}>;
|
|
242
|
+
export type WithJWKS = z.infer<typeof WithJWKS>;
|
|
243
|
+
export declare const WithJWKS: z.ZodObject<{
|
|
244
|
+
jwks: z.ZodObject<{
|
|
245
|
+
keys: z.ZodArray<z.ZodObject<{
|
|
246
|
+
alg: z.ZodOptional<z.ZodString>;
|
|
247
|
+
crv: z.ZodOptional<z.ZodString>;
|
|
248
|
+
d: z.ZodOptional<z.ZodString>;
|
|
249
|
+
dp: z.ZodOptional<z.ZodString>;
|
|
250
|
+
dq: z.ZodOptional<z.ZodString>;
|
|
251
|
+
e: z.ZodOptional<z.ZodString>;
|
|
252
|
+
/** JWK "ext" (Extractable) Parameter. */
|
|
253
|
+
ext: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
k: z.ZodOptional<z.ZodString>;
|
|
255
|
+
/** JWK "key_ops" (Key Operations) Parameter. */
|
|
256
|
+
key_ops: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
257
|
+
/** JWK "kid" (Key ID) Parameter. */
|
|
258
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
259
|
+
/** JWK "kty" (Key Type) Parameter.
|
|
260
|
+
* This attribute is required to discriminate the
|
|
261
|
+
* type of EC/RSA algorithm */
|
|
262
|
+
kty: z.ZodString;
|
|
263
|
+
n: z.ZodOptional<z.ZodString>;
|
|
264
|
+
oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
265
|
+
d: z.ZodOptional<z.ZodString>;
|
|
266
|
+
r: z.ZodOptional<z.ZodString>;
|
|
267
|
+
t: z.ZodOptional<z.ZodString>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
d?: string | undefined;
|
|
270
|
+
r?: string | undefined;
|
|
271
|
+
t?: string | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
d?: string | undefined;
|
|
274
|
+
r?: string | undefined;
|
|
275
|
+
t?: string | undefined;
|
|
276
|
+
}>, "many">>;
|
|
277
|
+
p: z.ZodOptional<z.ZodString>;
|
|
278
|
+
q: z.ZodOptional<z.ZodString>;
|
|
279
|
+
qi: z.ZodOptional<z.ZodString>;
|
|
280
|
+
/** JWK "use" (Public Key Use) Parameter. */
|
|
281
|
+
use: z.ZodOptional<z.ZodString>;
|
|
282
|
+
x: z.ZodOptional<z.ZodString>;
|
|
283
|
+
y: z.ZodOptional<z.ZodString>;
|
|
284
|
+
/** JWK "x5c" (X.509 Certificate Chain) Parameter. */
|
|
285
|
+
x5c: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
286
|
+
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter. */
|
|
287
|
+
x5t: z.ZodOptional<z.ZodString>;
|
|
288
|
+
/** "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter. */
|
|
289
|
+
'x5t#S256': z.ZodOptional<z.ZodString>;
|
|
290
|
+
/** JWK "x5u" (X.509 URL) Parameter. */
|
|
291
|
+
x5u: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
kty: string;
|
|
294
|
+
alg?: string | undefined;
|
|
295
|
+
crv?: string | undefined;
|
|
296
|
+
d?: string | undefined;
|
|
297
|
+
dp?: string | undefined;
|
|
298
|
+
dq?: string | undefined;
|
|
299
|
+
e?: string | undefined;
|
|
300
|
+
ext?: boolean | undefined;
|
|
301
|
+
k?: string | undefined;
|
|
302
|
+
key_ops?: string[] | undefined;
|
|
303
|
+
kid?: string | undefined;
|
|
304
|
+
n?: string | undefined;
|
|
305
|
+
oth?: {
|
|
306
|
+
d?: string | undefined;
|
|
307
|
+
r?: string | undefined;
|
|
308
|
+
t?: string | undefined;
|
|
309
|
+
}[] | undefined;
|
|
310
|
+
p?: string | undefined;
|
|
311
|
+
q?: string | undefined;
|
|
312
|
+
qi?: string | undefined;
|
|
313
|
+
use?: string | undefined;
|
|
314
|
+
x?: string | undefined;
|
|
315
|
+
y?: string | undefined;
|
|
316
|
+
x5c?: string[] | undefined;
|
|
317
|
+
x5t?: string | undefined;
|
|
318
|
+
'x5t#S256'?: string | undefined;
|
|
319
|
+
x5u?: string | undefined;
|
|
320
|
+
}, {
|
|
321
|
+
kty: string;
|
|
322
|
+
alg?: string | undefined;
|
|
323
|
+
crv?: string | undefined;
|
|
324
|
+
d?: string | undefined;
|
|
325
|
+
dp?: string | undefined;
|
|
326
|
+
dq?: string | undefined;
|
|
327
|
+
e?: string | undefined;
|
|
328
|
+
ext?: boolean | undefined;
|
|
329
|
+
k?: string | undefined;
|
|
330
|
+
key_ops?: string[] | undefined;
|
|
331
|
+
kid?: string | undefined;
|
|
332
|
+
n?: string | undefined;
|
|
333
|
+
oth?: {
|
|
334
|
+
d?: string | undefined;
|
|
335
|
+
r?: string | undefined;
|
|
336
|
+
t?: string | undefined;
|
|
337
|
+
}[] | undefined;
|
|
338
|
+
p?: string | undefined;
|
|
339
|
+
q?: string | undefined;
|
|
340
|
+
qi?: string | undefined;
|
|
341
|
+
use?: string | undefined;
|
|
342
|
+
x?: string | undefined;
|
|
343
|
+
y?: string | undefined;
|
|
344
|
+
x5c?: string[] | undefined;
|
|
345
|
+
x5t?: string | undefined;
|
|
346
|
+
'x5t#S256'?: string | undefined;
|
|
347
|
+
x5u?: string | undefined;
|
|
348
|
+
}>, "many">;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
keys: {
|
|
351
|
+
kty: string;
|
|
352
|
+
alg?: string | undefined;
|
|
353
|
+
crv?: string | undefined;
|
|
354
|
+
d?: string | undefined;
|
|
355
|
+
dp?: string | undefined;
|
|
356
|
+
dq?: string | undefined;
|
|
357
|
+
e?: string | undefined;
|
|
358
|
+
ext?: boolean | undefined;
|
|
359
|
+
k?: string | undefined;
|
|
360
|
+
key_ops?: string[] | undefined;
|
|
361
|
+
kid?: string | undefined;
|
|
362
|
+
n?: string | undefined;
|
|
363
|
+
oth?: {
|
|
364
|
+
d?: string | undefined;
|
|
365
|
+
r?: string | undefined;
|
|
366
|
+
t?: string | undefined;
|
|
367
|
+
}[] | undefined;
|
|
368
|
+
p?: string | undefined;
|
|
369
|
+
q?: string | undefined;
|
|
370
|
+
qi?: string | undefined;
|
|
371
|
+
use?: string | undefined;
|
|
372
|
+
x?: string | undefined;
|
|
373
|
+
y?: string | undefined;
|
|
374
|
+
x5c?: string[] | undefined;
|
|
375
|
+
x5t?: string | undefined;
|
|
376
|
+
'x5t#S256'?: string | undefined;
|
|
377
|
+
x5u?: string | undefined;
|
|
378
|
+
}[];
|
|
379
|
+
}, {
|
|
380
|
+
keys: {
|
|
381
|
+
kty: string;
|
|
382
|
+
alg?: string | undefined;
|
|
383
|
+
crv?: string | undefined;
|
|
384
|
+
d?: string | undefined;
|
|
385
|
+
dp?: string | undefined;
|
|
386
|
+
dq?: string | undefined;
|
|
387
|
+
e?: string | undefined;
|
|
388
|
+
ext?: boolean | undefined;
|
|
389
|
+
k?: string | undefined;
|
|
390
|
+
key_ops?: string[] | undefined;
|
|
391
|
+
kid?: string | undefined;
|
|
392
|
+
n?: string | undefined;
|
|
393
|
+
oth?: {
|
|
394
|
+
d?: string | undefined;
|
|
395
|
+
r?: string | undefined;
|
|
396
|
+
t?: string | undefined;
|
|
397
|
+
}[] | undefined;
|
|
398
|
+
p?: string | undefined;
|
|
399
|
+
q?: string | undefined;
|
|
400
|
+
qi?: string | undefined;
|
|
401
|
+
use?: string | undefined;
|
|
402
|
+
x?: string | undefined;
|
|
403
|
+
y?: string | undefined;
|
|
404
|
+
x5c?: string[] | undefined;
|
|
405
|
+
x5t?: string | undefined;
|
|
406
|
+
'x5t#S256'?: string | undefined;
|
|
407
|
+
x5u?: string | undefined;
|
|
408
|
+
}[];
|
|
409
|
+
}>;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
jwks: {
|
|
412
|
+
keys: {
|
|
413
|
+
kty: string;
|
|
414
|
+
alg?: string | undefined;
|
|
415
|
+
crv?: string | undefined;
|
|
416
|
+
d?: string | undefined;
|
|
417
|
+
dp?: string | undefined;
|
|
418
|
+
dq?: string | undefined;
|
|
419
|
+
e?: string | undefined;
|
|
420
|
+
ext?: boolean | undefined;
|
|
421
|
+
k?: string | undefined;
|
|
422
|
+
key_ops?: string[] | undefined;
|
|
423
|
+
kid?: string | undefined;
|
|
424
|
+
n?: string | undefined;
|
|
425
|
+
oth?: {
|
|
426
|
+
d?: string | undefined;
|
|
427
|
+
r?: string | undefined;
|
|
428
|
+
t?: string | undefined;
|
|
429
|
+
}[] | undefined;
|
|
430
|
+
p?: string | undefined;
|
|
431
|
+
q?: string | undefined;
|
|
432
|
+
qi?: string | undefined;
|
|
433
|
+
use?: string | undefined;
|
|
434
|
+
x?: string | undefined;
|
|
435
|
+
y?: string | undefined;
|
|
436
|
+
x5c?: string[] | undefined;
|
|
437
|
+
x5t?: string | undefined;
|
|
438
|
+
'x5t#S256'?: string | undefined;
|
|
439
|
+
x5u?: string | undefined;
|
|
440
|
+
}[];
|
|
441
|
+
};
|
|
442
|
+
}, {
|
|
443
|
+
jwks: {
|
|
444
|
+
keys: {
|
|
445
|
+
kty: string;
|
|
446
|
+
alg?: string | undefined;
|
|
447
|
+
crv?: string | undefined;
|
|
448
|
+
d?: string | undefined;
|
|
449
|
+
dp?: string | undefined;
|
|
450
|
+
dq?: string | undefined;
|
|
451
|
+
e?: string | undefined;
|
|
452
|
+
ext?: boolean | undefined;
|
|
453
|
+
k?: string | undefined;
|
|
454
|
+
key_ops?: string[] | undefined;
|
|
455
|
+
kid?: string | undefined;
|
|
456
|
+
n?: string | undefined;
|
|
457
|
+
oth?: {
|
|
458
|
+
d?: string | undefined;
|
|
459
|
+
r?: string | undefined;
|
|
460
|
+
t?: string | undefined;
|
|
461
|
+
}[] | undefined;
|
|
462
|
+
p?: string | undefined;
|
|
463
|
+
q?: string | undefined;
|
|
464
|
+
qi?: string | undefined;
|
|
465
|
+
use?: string | undefined;
|
|
466
|
+
x?: string | undefined;
|
|
467
|
+
y?: string | undefined;
|
|
468
|
+
x5c?: string[] | undefined;
|
|
469
|
+
x5t?: string | undefined;
|
|
470
|
+
'x5t#S256'?: string | undefined;
|
|
471
|
+
x5u?: string | undefined;
|
|
472
|
+
}[];
|
|
473
|
+
};
|
|
474
|
+
}>;
|
|
475
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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1
|
+
export declare function encodeBase64(value: string): string;
|
|
2
|
+
export declare function decodeBase64(value: string): string;
|
|
3
|
+
export declare function removePadding(encoded: string): string;
|
|
4
|
+
export declare function addPadding(encoded: string): string;
|
|
5
|
+
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../../src/utils/base64.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAYlD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JWK } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The interface of a cryptographic context to be used to sign tokens.
|
|
4
|
+
* Implementations are assumed to be initialized on a single, already-existing key pair.
|
|
5
|
+
*
|
|
6
|
+
* The generation and persistence of the key pair is delegated to the implementation.
|
|
7
|
+
*/
|
|
8
|
+
export interface CryptoContext {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the public key to be used in this context.
|
|
11
|
+
* MUST be the same key at every invocation.
|
|
12
|
+
* @returns The public key to be used
|
|
13
|
+
* @throws If no keys are found
|
|
14
|
+
*/
|
|
15
|
+
getPublicKey: () => Promise<JWK>;
|
|
16
|
+
/**
|
|
17
|
+
* Produce a cryptographic signature for a given value.
|
|
18
|
+
* The signature MUST be produced using the private key paired with the public retrieved by getPublicKey()
|
|
19
|
+
* @param value The value to be signed
|
|
20
|
+
* @returns The signature
|
|
21
|
+
* @throws If no keys are found
|
|
22
|
+
*/
|
|
23
|
+
getSignature: (value: string) => Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../../src/utils/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD"}
|