modules inc

This commit is contained in:
nannal
2021-07-15 23:10:20 +03:00
parent 6bb353de89
commit 5921b02b7c
845 changed files with 105299 additions and 121 deletions

View File

@@ -0,0 +1,46 @@
import { SignedHttpRequest } from "./SignedHttpRequest";
/**
* The PkceCodes type describes the structure
* of objects that contain PKCE code
* challenge and verifier pairs
*/
export declare type PkceCodes = {
verifier: string;
challenge: string;
};
/**
* Interface for crypto functions used by library
*/
export interface ICrypto {
/**
* Creates a guid randomly.
*/
createNewGuid(): string;
/**
* base64 Encode string
* @param input
*/
base64Encode(input: string): string;
/**
* base64 decode string
* @param input
*/
base64Decode(input: string): string;
/**
* Generate PKCE codes for OAuth. See RFC here: https://tools.ietf.org/html/rfc7636
*/
generatePkceCodes(): Promise<PkceCodes>;
/**
* Generates an JWK RSA S256 Thumbprint
* @param resourceRequestMethod
* @param resourceRequestUri
*/
getPublicKeyThumbprint(resourceRequestMethod: string, resourceRequestUri: string): Promise<string>;
/**
* Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.
* @param accessToken
*/
signJwt(payload: SignedHttpRequest, kid: string): Promise<string>;
}
export declare const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto;
//# sourceMappingURL=ICrypto.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/ICrypto.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AACH,oBAAY,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB;;OAEG;IACH,aAAa,IAAI,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC;;;;OAIG;IACH,sBAAsB,CAAC,qBAAqB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnG;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,6BAA6B,EAAE,OAyB3C,CAAC"}

View File

@@ -0,0 +1,8 @@
import { ICrypto } from "./ICrypto";
export declare class PopTokenGenerator {
private cryptoUtils;
constructor(cryptoUtils: ICrypto);
generateCnf(resourceRequestMethod: string, resourceRequestUri: string): Promise<string>;
signPopToken(accessToken: string, resourceRequestMethod: string, resourceRequestUri: string): Promise<string>;
}
//# sourceMappingURL=PopTokenGenerator.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,WAAW,CAAU;gBAEjB,WAAW,EAAE,OAAO;IAI1B,WAAW,CAAC,qBAAqB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASvF,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAmBtH"}

View File

@@ -0,0 +1,11 @@
export declare type SignedHttpRequest = {
at?: string;
cnf?: object;
m?: string;
u?: string;
p?: string;
q?: [Array<string>, string];
ts?: string;
nonce?: string;
};
//# sourceMappingURL=SignedHttpRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SignedHttpRequest.d.ts","sourceRoot":"","sources":["../../src/crypto/SignedHttpRequest.ts"],"names":[],"mappings":"AAKA,oBAAY,iBAAiB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}