Commit iniziale
This commit is contained in:
69
node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts
generated
vendored
Normal file
69
node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
|
||||
import { ShrOptions, SignedHttpRequest } from "./SignedHttpRequest.js";
|
||||
/**
|
||||
* The PkceCodes type describes the structure
|
||||
* of objects that contain PKCE code
|
||||
* challenge and verifier pairs
|
||||
*/
|
||||
export type PkceCodes = {
|
||||
verifier: string;
|
||||
challenge: string;
|
||||
};
|
||||
export type SignedHttpRequestParameters = Pick<BaseAuthRequest, "resourceRequestMethod" | "resourceRequestUri" | "shrClaims" | "shrNonce" | "shrOptions"> & {
|
||||
correlationId?: 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;
|
||||
/**
|
||||
* base64 URL safe encoded string
|
||||
*/
|
||||
base64UrlEncode(input: string): string;
|
||||
/**
|
||||
* Stringifies and base64Url encodes input public key
|
||||
* @param inputKid
|
||||
* @returns Base64Url encoded public key
|
||||
*/
|
||||
encodeKid(inputKid: string): string;
|
||||
/**
|
||||
* Generates an JWK RSA S256 Thumbprint
|
||||
* @param request
|
||||
*/
|
||||
getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>;
|
||||
/**
|
||||
* Removes cryptographic keypair from key store matching the keyId passed in
|
||||
* @param kid
|
||||
*/
|
||||
removeTokenBindingKey(kid: string): Promise<boolean>;
|
||||
/**
|
||||
* Removes all cryptographic keys from IndexedDB storage
|
||||
*/
|
||||
clearKeystore(): Promise<boolean>;
|
||||
/**
|
||||
* 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, shrOptions?: ShrOptions, correlationId?: string): Promise<string>;
|
||||
/**
|
||||
* Returns the SHA-256 hash of an input string
|
||||
* @param plainText
|
||||
*/
|
||||
hashString(plainText: string): Promise<string>;
|
||||
}
|
||||
export declare const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto;
|
||||
//# sourceMappingURL=ICrypto.d.ts.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ICrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/ICrypto.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC1C,eAAe,EACb,uBAAuB,GACvB,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,YAAY,CACjB,GAAG;IACA,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,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,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;;OAGG;IACH,sBAAsB,CAClB,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB;;;OAGG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,OAAO,CACH,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,UAAU,EACvB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,6BAA6B,EAAE,OA+B3C,CAAC"}
|
||||
44
node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs
generated
vendored
Normal file
44
node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
||||
'use strict';
|
||||
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
||||
import { methodNotImplemented } from '../error/ClientAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
||||
createNewGuid: () => {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
base64Decode: () => {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
base64Encode: () => {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
base64UrlEncode: () => {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
encodeKid: () => {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
async getPublicKeyThumbprint() {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
async removeTokenBindingKey() {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
async clearKeystore() {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
async signJwt() {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
async hashString() {
|
||||
throw createClientAuthError(methodNotImplemented);
|
||||
},
|
||||
};
|
||||
|
||||
export { DEFAULT_CRYPTO_IMPLEMENTATION };
|
||||
//# sourceMappingURL=ICrypto.mjs.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ICrypto.mjs","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.methodNotImplemented"],"mappings":";;;;;AAAA;;;AAGG;AA2FU,MAAA,6BAA6B,GAAY;IAClD,aAAa,EAAE,MAAa;AACxB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;IACD,YAAY,EAAE,MAAa;AACvB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;IACD,YAAY,EAAE,MAAa;AACvB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;IACD,eAAe,EAAE,MAAa;AAC1B,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;IACD,SAAS,EAAE,MAAa;AACpB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;AACD,IAAA,MAAM,sBAAsB,GAAA;AACxB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;AACD,IAAA,MAAM,qBAAqB,GAAA;AACvB,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;AACD,IAAA,MAAM,aAAa,GAAA;AACf,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;AACD,IAAA,MAAM,OAAO,GAAA;AACT,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;AACD,IAAA,MAAM,UAAU,GAAA;AACZ,QAAA,MAAM,qBAAqB,CAACA,oBAAyC,CAAC,CAAC;KAC1E;;;;;"}
|
||||
5
node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts
generated
vendored
Normal file
5
node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface IGuidGenerator {
|
||||
generateGuid(): string;
|
||||
isGuid(guid: string): boolean;
|
||||
}
|
||||
//# sourceMappingURL=IGuidGenerator.d.ts.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IGuidGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/IGuidGenerator.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC3B,YAAY,IAAI,MAAM,CAAC;IACvB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC"}
|
||||
23
node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts
generated
vendored
Normal file
23
node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { JsonWebTokenTypes } from "../utils/Constants.js";
|
||||
export type JoseHeaderOptions = {
|
||||
typ?: JsonWebTokenTypes;
|
||||
alg?: string;
|
||||
kid?: string;
|
||||
};
|
||||
/** @internal */
|
||||
export declare class JoseHeader {
|
||||
typ?: JsonWebTokenTypes;
|
||||
alg?: string;
|
||||
kid?: string;
|
||||
constructor(options: JoseHeaderOptions);
|
||||
/**
|
||||
* Builds SignedHttpRequest formatted JOSE Header from the
|
||||
* JOSE Header options provided or previously set on the object and returns
|
||||
* the stringified header object.
|
||||
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
||||
* @param shrHeaderOptions
|
||||
* @returns
|
||||
*/
|
||||
static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string;
|
||||
}
|
||||
//# sourceMappingURL=JoseHeader.d.ts.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"JoseHeader.d.ts","sourceRoot":"","sources":["../../src/crypto/JoseHeader.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC5B,GAAG,CAAC,EAAE,iBAAiB,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,gBAAgB;AAChB,qBAAa,UAAU;IACZ,GAAG,CAAC,EAAE,iBAAiB,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,EAAE,iBAAiB;IAMtC;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,MAAM;CAoBzE"}
|
||||
46
node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs
generated
vendored
Normal file
46
node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
||||
'use strict';
|
||||
import { createJoseHeaderError } from '../error/JoseHeaderError.mjs';
|
||||
import { JsonWebTokenTypes } from '../utils/Constants.mjs';
|
||||
import { missingKidError, missingAlgError } from '../error/JoseHeaderErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/** @internal */
|
||||
class JoseHeader {
|
||||
constructor(options) {
|
||||
this.typ = options.typ;
|
||||
this.alg = options.alg;
|
||||
this.kid = options.kid;
|
||||
}
|
||||
/**
|
||||
* Builds SignedHttpRequest formatted JOSE Header from the
|
||||
* JOSE Header options provided or previously set on the object and returns
|
||||
* the stringified header object.
|
||||
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
||||
* @param shrHeaderOptions
|
||||
* @returns
|
||||
*/
|
||||
static getShrHeaderString(shrHeaderOptions) {
|
||||
// KeyID is required on the SHR header
|
||||
if (!shrHeaderOptions.kid) {
|
||||
throw createJoseHeaderError(missingKidError);
|
||||
}
|
||||
// Alg is required on the SHR header
|
||||
if (!shrHeaderOptions.alg) {
|
||||
throw createJoseHeaderError(missingAlgError);
|
||||
}
|
||||
const shrHeader = new JoseHeader({
|
||||
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
||||
typ: shrHeaderOptions.typ || JsonWebTokenTypes.Pop,
|
||||
kid: shrHeaderOptions.kid,
|
||||
alg: shrHeaderOptions.alg,
|
||||
});
|
||||
return JSON.stringify(shrHeader);
|
||||
}
|
||||
}
|
||||
|
||||
export { JoseHeader };
|
||||
//# sourceMappingURL=JoseHeader.mjs.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"JoseHeader.mjs","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":[null],"names":["JoseHeaderErrorCodes.missingKidError","JoseHeaderErrorCodes.missingAlgError"],"mappings":";;;;;;AAAA;;;AAGG;AAcH;MACa,UAAU,CAAA;AAKnB,IAAA,WAAA,CAAY,OAA0B,EAAA;AAClC,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC1B;AAED;;;;;;;AAOG;IACH,OAAO,kBAAkB,CAAC,gBAAmC,EAAA;;AAEzD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,qBAAqB,CAACA,eAAoC,CAAC,CAAC;AACrE,SAAA;;AAGD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,qBAAqB,CAACC,eAAoC,CAAC,CAAC;AACrE,SAAA;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC;;AAE7B,YAAA,GAAG,EAAE,gBAAgB,CAAC,GAAG,IAAI,iBAAiB,CAAC,GAAG;YAClD,GAAG,EAAE,gBAAgB,CAAC,GAAG;YACzB,GAAG,EAAE,gBAAgB,CAAC,GAAG;AAC5B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC;AACJ;;;;"}
|
||||
60
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts
generated
vendored
Normal file
60
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { ICrypto, SignedHttpRequestParameters } from "./ICrypto.js";
|
||||
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
||||
import { Logger } from "../logger/Logger.js";
|
||||
/**
|
||||
* See eSTS docs for more info.
|
||||
* - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.
|
||||
* - xms_ksl element, representing the storage location of the key's secret component on the client device. One of two values:
|
||||
* - sw: software storage
|
||||
* - uhw: hardware storage
|
||||
*/
|
||||
type ReqCnf = {
|
||||
kid: string;
|
||||
xms_ksl: KeyLocation;
|
||||
};
|
||||
export type ReqCnfData = {
|
||||
kid: string;
|
||||
reqCnfString: string;
|
||||
};
|
||||
declare const KeyLocation: {
|
||||
readonly SW: "sw";
|
||||
readonly UHW: "uhw";
|
||||
};
|
||||
export type KeyLocation = (typeof KeyLocation)[keyof typeof KeyLocation];
|
||||
/** @internal */
|
||||
export declare class PopTokenGenerator {
|
||||
private cryptoUtils;
|
||||
private performanceClient?;
|
||||
constructor(cryptoUtils: ICrypto, performanceClient?: IPerformanceClient);
|
||||
/**
|
||||
* Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
|
||||
* and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
generateCnf(request: SignedHttpRequestParameters, logger: Logger): Promise<ReqCnfData>;
|
||||
/**
|
||||
* Generates key_id for a SHR token request
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
generateKid(request: SignedHttpRequestParameters): Promise<ReqCnf>;
|
||||
/**
|
||||
* Signs the POP access_token with the local generated key-pair
|
||||
* @param accessToken
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise<string>;
|
||||
/**
|
||||
* Utility function to generate the signed JWT for an access_token
|
||||
* @param payload
|
||||
* @param kid
|
||||
* @param request
|
||||
* @param claims
|
||||
* @returns
|
||||
*/
|
||||
signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise<string>;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=PopTokenGenerator.d.ts.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAGpF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;;;GAMG;AACH,KAAK,MAAM,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,WAAW;;;CAGP,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,gBAAgB;AAChB,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAqB;gBAEnC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,kBAAkB;IAKxE;;;;;OAKG;IACG,WAAW,CACb,OAAO,EAAE,2BAA2B,EACpC,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC;IAuBtB;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBxE;;;;;OAKG;IACG,YAAY,CACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;;;;OAOG;IACG,WAAW,CACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,EACpC,MAAM,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;CAiCrB"}
|
||||
91
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs
generated
vendored
Normal file
91
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
/*! @azure/msal-common v15.1.1 2025-02-05 */
|
||||
'use strict';
|
||||
import { nowSeconds } from '../utils/TimeUtils.mjs';
|
||||
import { UrlString } from '../url/UrlString.mjs';
|
||||
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
|
||||
import { invokeAsync } from '../utils/FunctionWrappers.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
const KeyLocation = {
|
||||
SW: "sw",
|
||||
UHW: "uhw",
|
||||
};
|
||||
/** @internal */
|
||||
class PopTokenGenerator {
|
||||
constructor(cryptoUtils, performanceClient) {
|
||||
this.cryptoUtils = cryptoUtils;
|
||||
this.performanceClient = performanceClient;
|
||||
}
|
||||
/**
|
||||
* Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
|
||||
* and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async generateCnf(request, logger) {
|
||||
this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
||||
const reqCnf = await invokeAsync(this.generateKid.bind(this), PerformanceEvents.PopTokenGenerateCnf, logger, this.performanceClient, request.correlationId)(request);
|
||||
const reqCnfString = this.cryptoUtils.base64UrlEncode(JSON.stringify(reqCnf));
|
||||
return {
|
||||
kid: reqCnf.kid,
|
||||
reqCnfString,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Generates key_id for a SHR token request
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async generateKid(request) {
|
||||
this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
|
||||
const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);
|
||||
return {
|
||||
kid: kidThumbprint,
|
||||
xms_ksl: KeyLocation.SW,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Signs the POP access_token with the local generated key-pair
|
||||
* @param accessToken
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async signPopToken(accessToken, keyId, request) {
|
||||
return this.signPayload(accessToken, keyId, request);
|
||||
}
|
||||
/**
|
||||
* Utility function to generate the signed JWT for an access_token
|
||||
* @param payload
|
||||
* @param kid
|
||||
* @param request
|
||||
* @param claims
|
||||
* @returns
|
||||
*/
|
||||
async signPayload(payload, keyId, request, claims) {
|
||||
// Deconstruct request to extract SHR parameters
|
||||
const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, shrOptions, } = request;
|
||||
const resourceUrlString = resourceRequestUri
|
||||
? new UrlString(resourceRequestUri)
|
||||
: undefined;
|
||||
const resourceUrlComponents = resourceUrlString?.getUrlComponents();
|
||||
return this.cryptoUtils.signJwt({
|
||||
at: payload,
|
||||
ts: nowSeconds(),
|
||||
m: resourceRequestMethod?.toUpperCase(),
|
||||
u: resourceUrlComponents?.HostNameAndPort,
|
||||
nonce: shrNonce || this.cryptoUtils.createNewGuid(),
|
||||
p: resourceUrlComponents?.AbsolutePath,
|
||||
q: resourceUrlComponents?.QueryString
|
||||
? [[], resourceUrlComponents.QueryString]
|
||||
: undefined,
|
||||
client_claims: shrClaims || undefined,
|
||||
...claims,
|
||||
}, keyId, shrOptions, request.correlationId);
|
||||
}
|
||||
}
|
||||
|
||||
export { PopTokenGenerator };
|
||||
//# sourceMappingURL=PopTokenGenerator.mjs.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PopTokenGenerator.mjs","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":[null],"names":["TimeUtils.nowSeconds"],"mappings":";;;;;;;AAAA;;;AAGG;AA2BH,MAAM,WAAW,GAAG;AAChB,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,GAAG,EAAE,KAAK;CACJ,CAAC;AAGX;MACa,iBAAiB,CAAA;IAI1B,WAAY,CAAA,WAAoB,EAAE,iBAAsC,EAAA;AACpE,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;KAC9C;AAED;;;;;AAKG;AACH,IAAA,MAAM,WAAW,CACb,OAAoC,EACpC,MAAc,EAAA;AAEd,QAAA,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CACvC,iBAAiB,CAAC,mBAAmB,EACrC,OAAO,CAAC,aAAa,CACxB,CAAC;AAEF,QAAA,MAAM,MAAM,GAAG,MAAM,WAAW,CAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3B,iBAAiB,CAAC,mBAAmB,EACrC,MAAM,EACN,IAAI,CAAC,iBAAiB,EACtB,OAAO,CAAC,aAAa,CACxB,CAAC,OAAO,CAAC,CAAC;AACX,QAAA,MAAM,YAAY,GAAW,IAAI,CAAC,WAAW,CAAC,eAAe,CACzD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CACzB,CAAC;QAEF,OAAO;YACH,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,YAAY;SACf,CAAC;KACL;AAED;;;;AAIG;IACH,MAAM,WAAW,CAAC,OAAoC,EAAA;AAClD,QAAA,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CACvC,iBAAiB,CAAC,mBAAmB,EACrC,OAAO,CAAC,aAAa,CACxB,CAAC;QAEF,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAC/D,OAAO,CACV,CAAC;QAEF,OAAO;AACH,YAAA,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW,CAAC,EAAE;SAC1B,CAAC;KACL;AAED;;;;;AAKG;AACH,IAAA,MAAM,YAAY,CACd,WAAmB,EACnB,KAAa,EACb,OAAoC,EAAA;QAEpC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KACxD;AAED;;;;;;;AAOG;IACH,MAAM,WAAW,CACb,OAAe,EACf,KAAa,EACb,OAAoC,EACpC,MAAe,EAAA;;AAGf,QAAA,MAAM,EACF,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,UAAU,GACb,GAAG,OAAO,CAAC;QAEZ,MAAM,iBAAiB,GAAG,kBAAkB;AACxC,cAAE,IAAI,SAAS,CAAC,kBAAkB,CAAC;cACjC,SAAS,CAAC;AAChB,QAAA,MAAM,qBAAqB,GAAG,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AACpE,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC3B;AACI,YAAA,EAAE,EAAE,OAAO;AACX,YAAA,EAAE,EAAEA,UAAoB,EAAE;AAC1B,YAAA,CAAC,EAAE,qBAAqB,EAAE,WAAW,EAAE;YACvC,CAAC,EAAE,qBAAqB,EAAE,eAAe;YACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;YACnD,CAAC,EAAE,qBAAqB,EAAE,YAAY;YACtC,CAAC,EAAE,qBAAqB,EAAE,WAAW;AACjC,kBAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC;AACzC,kBAAE,SAAS;YACf,aAAa,EAAE,SAAS,IAAI,SAAS;AACrC,YAAA,GAAG,MAAM;SACZ,EACD,KAAK,EACL,UAAU,EACV,OAAO,CAAC,aAAa,CACxB,CAAC;KACL;AACJ;;;;"}
|
||||
16
node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts
generated
vendored
Normal file
16
node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { JoseHeaderOptions } from "./JoseHeader.js";
|
||||
export type SignedHttpRequest = {
|
||||
at?: string;
|
||||
cnf?: object;
|
||||
m?: string;
|
||||
u?: string;
|
||||
p?: string;
|
||||
q?: [Array<string>, string];
|
||||
ts?: number;
|
||||
nonce?: string;
|
||||
client_claims?: string;
|
||||
};
|
||||
export type ShrOptions = {
|
||||
header: JoseHeaderOptions;
|
||||
};
|
||||
//# sourceMappingURL=SignedHttpRequest.d.ts.map
|
||||
1
node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SignedHttpRequest.d.ts","sourceRoot":"","sources":["../../src/crypto/SignedHttpRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,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;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,MAAM,EAAE,iBAAiB,CAAC;CAC7B,CAAC"}
|
||||
Reference in New Issue
Block a user