@azure/msal-node 2.7.0-alpha.0 → 2.7.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/dist/cache/ITokenCache.d.ts +15 -15
- package/dist/cache/NodeStorage.cjs +423 -423
- package/dist/cache/NodeStorage.cjs.map +1 -1
- package/dist/cache/NodeStorage.d.ts +193 -193
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +424 -424
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.cjs +265 -265
- package/dist/cache/TokenCache.d.ts +90 -90
- package/dist/cache/TokenCache.mjs +265 -265
- package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
- package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
- package/dist/cache/distributed/ICacheClient.d.ts +17 -17
- package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
- package/dist/cache/serializer/Deserializer.cjs +167 -170
- package/dist/cache/serializer/Deserializer.cjs.map +1 -1
- package/dist/cache/serializer/Deserializer.d.ts +42 -42
- package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +168 -171
- package/dist/cache/serializer/Deserializer.mjs.map +1 -1
- package/dist/cache/serializer/Serializer.cjs +137 -137
- package/dist/cache/serializer/Serializer.d.ts +39 -39
- package/dist/cache/serializer/Serializer.mjs +137 -137
- package/dist/cache/serializer/SerializerTypes.d.ts +102 -102
- package/dist/client/ClientApplication.cjs +333 -333
- package/dist/client/ClientApplication.cjs.map +1 -1
- package/dist/client/ClientApplication.d.ts +142 -142
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +333 -333
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.cjs +116 -116
- package/dist/client/ClientAssertion.d.ts +46 -46
- package/dist/client/ClientAssertion.mjs +116 -116
- package/dist/client/ClientCredentialClient.cjs +194 -194
- package/dist/client/ClientCredentialClient.d.ts +33 -33
- package/dist/client/ClientCredentialClient.mjs +194 -194
- package/dist/client/ConfidentialClientApplication.cjs +163 -163
- package/dist/client/ConfidentialClientApplication.d.ts +58 -58
- package/dist/client/ConfidentialClientApplication.mjs +163 -163
- package/dist/client/DeviceCodeClient.cjs +207 -207
- package/dist/client/DeviceCodeClient.d.ts +53 -53
- package/dist/client/DeviceCodeClient.mjs +207 -207
- package/dist/client/IConfidentialClientApplication.d.ts +39 -39
- package/dist/client/IPublicClientApplication.d.ts +42 -42
- package/dist/client/ManagedIdentityApplication.cjs +79 -78
- package/dist/client/ManagedIdentityApplication.cjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.d.ts +23 -23
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +79 -78
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
- package/dist/client/ManagedIdentityClient.cjs +40 -36
- package/dist/client/ManagedIdentityClient.cjs.map +1 -1
- package/dist/client/ManagedIdentityClient.d.ts +19 -24
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +40 -36
- package/dist/client/ManagedIdentityClient.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.cjs +42 -69
- package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +16 -16
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +43 -70
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.cjs +81 -92
- package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +18 -18
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +84 -95
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +112 -77
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +30 -18
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +114 -80
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.cjs +47 -0
- package/dist/client/ManagedIdentitySources/CloudShell.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +15 -6
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +45 -0
- package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.cjs +43 -52
- package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +12 -12
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +44 -53
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +61 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +16 -6
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +59 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -0
- package/dist/client/OnBehalfOfClient.cjs +202 -202
- package/dist/client/OnBehalfOfClient.d.ts +47 -47
- package/dist/client/OnBehalfOfClient.mjs +202 -202
- package/dist/client/PublicClientApplication.cjs +229 -229
- package/dist/client/PublicClientApplication.d.ts +71 -71
- package/dist/client/PublicClientApplication.mjs +229 -229
- package/dist/client/UsernamePasswordClient.cjs +95 -95
- package/dist/client/UsernamePasswordClient.d.ts +25 -25
- package/dist/client/UsernamePasswordClient.mjs +95 -95
- package/dist/config/Configuration.cjs +102 -86
- package/dist/config/Configuration.cjs.map +1 -1
- package/dist/config/Configuration.d.ts +123 -122
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +102 -86
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.cjs +48 -48
- package/dist/config/ManagedIdentityId.d.ts +11 -11
- package/dist/config/ManagedIdentityId.mjs +48 -48
- package/dist/config/ManagedIdentityRequestParameters.cjs +28 -29
- package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts +11 -11
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +28 -29
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.cjs +75 -75
- package/dist/crypto/CryptoProvider.d.ts +52 -52
- package/dist/crypto/CryptoProvider.mjs +75 -75
- package/dist/crypto/GuidGenerator.cjs +22 -22
- package/dist/crypto/GuidGenerator.d.ts +14 -14
- package/dist/crypto/GuidGenerator.mjs +22 -22
- package/dist/crypto/HashUtils.cjs +13 -13
- package/dist/crypto/HashUtils.d.ts +8 -8
- package/dist/crypto/HashUtils.mjs +13 -13
- package/dist/crypto/PkceGenerator.cjs +49 -49
- package/dist/crypto/PkceGenerator.d.ts +22 -22
- package/dist/crypto/PkceGenerator.mjs +49 -49
- package/dist/error/ManagedIdentityError.cjs +39 -28
- package/dist/error/ManagedIdentityError.cjs.map +1 -1
- package/dist/error/ManagedIdentityError.d.ts +27 -21
- package/dist/error/ManagedIdentityError.d.ts.map +1 -1
- package/dist/error/ManagedIdentityError.mjs +40 -29
- package/dist/error/ManagedIdentityError.mjs.map +1 -1
- package/dist/error/ManagedIdentityErrorCodes.cjs +27 -14
- package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -1
- package/dist/error/ManagedIdentityErrorCodes.d.ts +19 -9
- package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +24 -14
- package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
- package/dist/error/NodeAuthError.cjs +85 -85
- package/dist/error/NodeAuthError.d.ts +65 -65
- package/dist/error/NodeAuthError.mjs +85 -85
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +44 -44
- package/dist/index.mjs +1 -1
- package/dist/internals.cjs +8 -8
- package/dist/internals.d.ts +6 -6
- package/dist/internals.mjs +8 -8
- package/dist/network/HttpClient.cjs +283 -283
- package/dist/network/HttpClient.cjs.map +1 -1
- package/dist/network/HttpClient.d.ts +25 -26
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +283 -283
- package/dist/network/HttpClient.mjs.map +1 -1
- package/dist/network/HttpClientWithRetries.cjs +44 -0
- package/dist/network/HttpClientWithRetries.cjs.map +1 -0
- package/dist/network/HttpClientWithRetries.d.ts +12 -0
- package/dist/network/HttpClientWithRetries.d.ts.map +1 -0
- package/dist/network/HttpClientWithRetries.mjs +42 -0
- package/dist/network/HttpClientWithRetries.mjs.map +1 -0
- package/dist/network/ILoopbackClient.d.ts +10 -10
- package/dist/network/LoopbackClient.cjs +77 -77
- package/dist/network/LoopbackClient.d.ts +21 -21
- package/dist/network/LoopbackClient.mjs +77 -77
- package/dist/packageMetadata.cjs +4 -4
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
- package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
- package/dist/request/ClientCredentialRequest.d.ts +14 -14
- package/dist/request/DeviceCodeRequest.d.ts +15 -15
- package/dist/request/InteractiveRequest.d.ts +22 -22
- package/dist/request/ManagedIdentityRequest.d.ts +8 -8
- package/dist/request/ManagedIdentityRequestParams.d.ts +9 -9
- package/dist/request/OnBehalfOfRequest.d.ts +14 -14
- package/dist/request/RefreshTokenRequest.d.ts +17 -17
- package/dist/request/SignOutRequest.d.ts +5 -5
- package/dist/request/SilentFlowRequest.d.ts +16 -16
- package/dist/request/UsernamePasswordRequest.d.ts +19 -19
- package/dist/response/ManagedIdentityTokenResponse.d.ts +24 -24
- package/dist/retry/IHttpRetryPolicy.d.ts +6 -0
- package/dist/retry/IHttpRetryPolicy.d.ts.map +1 -0
- package/dist/retry/LinearRetryPolicy.cjs +47 -0
- package/dist/retry/LinearRetryPolicy.cjs.map +1 -0
- package/dist/retry/LinearRetryPolicy.d.ts +12 -0
- package/dist/retry/LinearRetryPolicy.d.ts.map +1 -0
- package/dist/retry/LinearRetryPolicy.mjs +45 -0
- package/dist/retry/LinearRetryPolicy.mjs.map +1 -0
- package/dist/utils/Constants.cjs +141 -103
- package/dist/utils/Constants.cjs.map +1 -1
- package/dist/utils/Constants.d.ts +131 -106
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +133 -100
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.cjs +44 -44
- package/dist/utils/EncodingUtils.d.ts +26 -26
- package/dist/utils/EncodingUtils.mjs +44 -44
- package/dist/utils/NetworkUtils.cjs +38 -38
- package/dist/utils/NetworkUtils.d.ts +5 -5
- package/dist/utils/NetworkUtils.mjs +38 -38
- package/package.json +5 -5
- package/src/cache/NodeStorage.ts +4 -9
- package/src/cache/serializer/Deserializer.ts +1 -5
- package/src/client/ClientApplication.ts +5 -4
- package/src/client/ManagedIdentityApplication.ts +3 -3
- package/src/client/ManagedIdentityClient.ts +23 -11
- package/src/client/ManagedIdentitySources/AppService.ts +68 -97
- package/src/client/ManagedIdentitySources/AzureArc.ts +59 -68
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +70 -2
- package/src/client/ManagedIdentitySources/CloudShell.ts +93 -8
- package/src/client/ManagedIdentitySources/Imds.ts +54 -40
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +126 -5
- package/src/config/Configuration.ts +44 -16
- package/src/config/ManagedIdentityRequestParameters.ts +1 -6
- package/src/error/ManagedIdentityError.ts +15 -2
- package/src/error/ManagedIdentityErrorCodes.ts +19 -0
- package/src/network/HttpClient.ts +6 -11
- package/src/network/HttpClientWithRetries.ts +80 -0
- package/src/packageMetadata.ts +1 -1
- package/src/retry/IHttpRetryPolicy.ts +18 -0
- package/src/retry/LinearRetryPolicy.ts +71 -0
- package/src/utils/Constants.ts +43 -7
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.7.0
|
|
1
|
+
/*! @azure/msal-node v2.7.0 2024-04-11 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { createManagedIdentityError } from '../error/ManagedIdentityError.mjs';
|
|
4
4
|
import { ManagedIdentityIdType, DEFAULT_MANAGED_IDENTITY_ID } from '../utils/Constants.mjs';
|
|
5
5
|
import { invalidManagedIdentityIdType } from '../error/ManagedIdentityErrorCodes.mjs';
|
|
6
6
|
|
|
7
|
-
/*
|
|
8
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
* Licensed under the MIT License.
|
|
10
|
-
*/
|
|
11
|
-
class ManagedIdentityId {
|
|
12
|
-
get id() {
|
|
13
|
-
return this._id;
|
|
14
|
-
}
|
|
15
|
-
set id(value) {
|
|
16
|
-
this._id = value;
|
|
17
|
-
}
|
|
18
|
-
get idType() {
|
|
19
|
-
return this._idType;
|
|
20
|
-
}
|
|
21
|
-
set idType(value) {
|
|
22
|
-
this._idType = value;
|
|
23
|
-
}
|
|
24
|
-
constructor(managedIdentityIdParams) {
|
|
25
|
-
const userAssignedClientId = managedIdentityIdParams?.userAssignedClientId;
|
|
26
|
-
const userAssignedResourceId = managedIdentityIdParams?.userAssignedResourceId;
|
|
27
|
-
const userAssignedObjectId = managedIdentityIdParams?.userAssignedObjectId;
|
|
28
|
-
if (userAssignedClientId) {
|
|
29
|
-
if (userAssignedResourceId || userAssignedObjectId) {
|
|
30
|
-
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
31
|
-
}
|
|
32
|
-
this.id = userAssignedClientId;
|
|
33
|
-
this.idType = ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID;
|
|
34
|
-
}
|
|
35
|
-
else if (userAssignedResourceId) {
|
|
36
|
-
if (userAssignedClientId || userAssignedObjectId) {
|
|
37
|
-
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
38
|
-
}
|
|
39
|
-
this.id = userAssignedResourceId;
|
|
40
|
-
this.idType = ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID;
|
|
41
|
-
}
|
|
42
|
-
else if (userAssignedObjectId) {
|
|
43
|
-
if (userAssignedClientId || userAssignedResourceId) {
|
|
44
|
-
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
45
|
-
}
|
|
46
|
-
this.id = userAssignedObjectId;
|
|
47
|
-
this.idType = ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.id = DEFAULT_MANAGED_IDENTITY_ID;
|
|
51
|
-
this.idType = ManagedIdentityIdType.SYSTEM_ASSIGNED;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
class ManagedIdentityId {
|
|
12
|
+
get id() {
|
|
13
|
+
return this._id;
|
|
14
|
+
}
|
|
15
|
+
set id(value) {
|
|
16
|
+
this._id = value;
|
|
17
|
+
}
|
|
18
|
+
get idType() {
|
|
19
|
+
return this._idType;
|
|
20
|
+
}
|
|
21
|
+
set idType(value) {
|
|
22
|
+
this._idType = value;
|
|
23
|
+
}
|
|
24
|
+
constructor(managedIdentityIdParams) {
|
|
25
|
+
const userAssignedClientId = managedIdentityIdParams?.userAssignedClientId;
|
|
26
|
+
const userAssignedResourceId = managedIdentityIdParams?.userAssignedResourceId;
|
|
27
|
+
const userAssignedObjectId = managedIdentityIdParams?.userAssignedObjectId;
|
|
28
|
+
if (userAssignedClientId) {
|
|
29
|
+
if (userAssignedResourceId || userAssignedObjectId) {
|
|
30
|
+
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
31
|
+
}
|
|
32
|
+
this.id = userAssignedClientId;
|
|
33
|
+
this.idType = ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID;
|
|
34
|
+
}
|
|
35
|
+
else if (userAssignedResourceId) {
|
|
36
|
+
if (userAssignedClientId || userAssignedObjectId) {
|
|
37
|
+
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
38
|
+
}
|
|
39
|
+
this.id = userAssignedResourceId;
|
|
40
|
+
this.idType = ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID;
|
|
41
|
+
}
|
|
42
|
+
else if (userAssignedObjectId) {
|
|
43
|
+
if (userAssignedClientId || userAssignedResourceId) {
|
|
44
|
+
throw createManagedIdentityError(invalidManagedIdentityIdType);
|
|
45
|
+
}
|
|
46
|
+
this.id = userAssignedObjectId;
|
|
47
|
+
this.idType = ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.id = DEFAULT_MANAGED_IDENTITY_ID;
|
|
51
|
+
this.idType = ManagedIdentityIdType.SYSTEM_ASSIGNED;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export { ManagedIdentityId };
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.7.0
|
|
1
|
+
/*! @azure/msal-node v2.7.0 2024-04-11 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var msalCommon = require('@azure/msal-common');
|
|
6
6
|
|
|
7
|
-
/*
|
|
8
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
* Licensed under the MIT License.
|
|
10
|
-
*/
|
|
11
|
-
class ManagedIdentityRequestParameters {
|
|
12
|
-
constructor(httpMethod, endpoint) {
|
|
13
|
-
this.httpMethod = httpMethod;
|
|
14
|
-
this._baseEndpoint = endpoint;
|
|
15
|
-
this.headers = {};
|
|
16
|
-
this.bodyParameters = {};
|
|
17
|
-
this.queryParameters = {};
|
|
18
|
-
}
|
|
19
|
-
computeUri() {
|
|
20
|
-
const parameterBuilder = new msalCommon.RequestParameterBuilder();
|
|
21
|
-
if (this.queryParameters) {
|
|
22
|
-
parameterBuilder.addExtraQueryParameters(this.queryParameters);
|
|
23
|
-
}
|
|
24
|
-
const queryParametersString = parameterBuilder.createQueryString();
|
|
25
|
-
return msalCommon.UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
|
|
26
|
-
}
|
|
27
|
-
computeParametersBodyString() {
|
|
28
|
-
const parameterBuilder = new msalCommon.RequestParameterBuilder();
|
|
29
|
-
if (this.bodyParameters) {
|
|
30
|
-
parameterBuilder.addExtraQueryParameters(this.bodyParameters);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
class ManagedIdentityRequestParameters {
|
|
12
|
+
constructor(httpMethod, endpoint) {
|
|
13
|
+
this.httpMethod = httpMethod;
|
|
14
|
+
this._baseEndpoint = endpoint;
|
|
15
|
+
this.headers = {};
|
|
16
|
+
this.bodyParameters = {};
|
|
17
|
+
this.queryParameters = {};
|
|
18
|
+
}
|
|
19
|
+
computeUri() {
|
|
20
|
+
const parameterBuilder = new msalCommon.RequestParameterBuilder();
|
|
21
|
+
if (this.queryParameters) {
|
|
22
|
+
parameterBuilder.addExtraQueryParameters(this.queryParameters);
|
|
23
|
+
}
|
|
24
|
+
const queryParametersString = parameterBuilder.createQueryString();
|
|
25
|
+
return msalCommon.UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
|
|
26
|
+
}
|
|
27
|
+
computeParametersBodyString() {
|
|
28
|
+
const parameterBuilder = new msalCommon.RequestParameterBuilder();
|
|
29
|
+
if (this.bodyParameters) {
|
|
30
|
+
parameterBuilder.addExtraQueryParameters(this.bodyParameters);
|
|
31
|
+
}
|
|
32
|
+
return parameterBuilder.createQueryString();
|
|
33
|
+
}
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
exports.ManagedIdentityRequestParameters = ManagedIdentityRequestParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedIdentityRequestParameters.cjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":["RequestParameterBuilder","UrlString"],"mappings":";;;;;;AAAA;;;AAGG;MAKU,gCAAgC,CAAA;IAOzC,WAAY,CAAA,UAAsB,EAAE,QAAgB,EAAA;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;AAC9B,QAAA,IAAI,CAAC,OAAO,GAAG,EAA4B,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,EAA4B,CAAC;AACnD,QAAA,IAAI,CAAC,eAAe,GAAG,EAA4B,CAAC;KACvD;IAEM,UAAU,GAAA;AACb,QAAA,MAAM,gBAAgB,GAAG,IAAIA,kCAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,eAAe,EAAE;AACtB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAClE,SAAA;AAED,QAAA,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAEnE,OAAOC,oBAAS,CAAC,iBAAiB,CAC9B,IAAI,CAAC,aAAa,EAClB,qBAAqB,CACxB,CAAC;KACL;IAEM,2BAA2B,GAAA;AAC9B,QAAA,MAAM,gBAAgB,GAAG,IAAID,kCAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,cAAc,EAAE;AACrB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACjE,SAAA;AAED,QAAA,
|
|
1
|
+
{"version":3,"file":"ManagedIdentityRequestParameters.cjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":["RequestParameterBuilder","UrlString"],"mappings":";;;;;;AAAA;;;AAGG;MAKU,gCAAgC,CAAA;IAOzC,WAAY,CAAA,UAAsB,EAAE,QAAgB,EAAA;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;AAC9B,QAAA,IAAI,CAAC,OAAO,GAAG,EAA4B,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,EAA4B,CAAC;AACnD,QAAA,IAAI,CAAC,eAAe,GAAG,EAA4B,CAAC;KACvD;IAEM,UAAU,GAAA;AACb,QAAA,MAAM,gBAAgB,GAAG,IAAIA,kCAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,eAAe,EAAE;AACtB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAClE,SAAA;AAED,QAAA,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAEnE,OAAOC,oBAAS,CAAC,iBAAiB,CAC9B,IAAI,CAAC,aAAa,EAClB,qBAAqB,CACxB,CAAC;KACL;IAEM,2BAA2B,GAAA;AAC9B,QAAA,MAAM,gBAAgB,GAAG,IAAID,kCAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,cAAc,EAAE;AACrB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACjE,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C;AACJ;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { HttpMethod } from "../utils/Constants";
|
|
2
|
-
export declare class ManagedIdentityRequestParameters {
|
|
3
|
-
private _baseEndpoint;
|
|
4
|
-
httpMethod: HttpMethod;
|
|
5
|
-
headers: Record<string, string>;
|
|
6
|
-
bodyParameters: Record<string, string>;
|
|
7
|
-
queryParameters: Record<string, string>;
|
|
8
|
-
constructor(httpMethod: HttpMethod, endpoint: string);
|
|
9
|
-
computeUri(): string;
|
|
10
|
-
computeParametersBodyString(): string;
|
|
11
|
-
}
|
|
1
|
+
import { HttpMethod } from "../utils/Constants";
|
|
2
|
+
export declare class ManagedIdentityRequestParameters {
|
|
3
|
+
private _baseEndpoint;
|
|
4
|
+
httpMethod: HttpMethod;
|
|
5
|
+
headers: Record<string, string>;
|
|
6
|
+
bodyParameters: Record<string, string>;
|
|
7
|
+
queryParameters: Record<string, string>;
|
|
8
|
+
constructor(httpMethod: HttpMethod, endpoint: string);
|
|
9
|
+
computeUri(): string;
|
|
10
|
+
computeParametersBodyString(): string;
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=ManagedIdentityRequestParameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedIdentityRequestParameters.d.ts","sourceRoot":"","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,qBAAa,gCAAgC;IACzC,OAAO,CAAC,aAAa,CAAS;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEnC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM;IAQ7C,UAAU,IAAI,MAAM;IAepB,2BAA2B,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"ManagedIdentityRequestParameters.d.ts","sourceRoot":"","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,qBAAa,gCAAgC;IACzC,OAAO,CAAC,aAAa,CAAS;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEnC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM;IAQ7C,UAAU,IAAI,MAAM;IAepB,2BAA2B,IAAI,MAAM;CAS/C"}
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.7.0
|
|
1
|
+
/*! @azure/msal-node v2.7.0 2024-04-11 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { RequestParameterBuilder, UrlString } from '@azure/msal-common';
|
|
4
4
|
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
-
* Licensed under the MIT License.
|
|
8
|
-
*/
|
|
9
|
-
class ManagedIdentityRequestParameters {
|
|
10
|
-
constructor(httpMethod, endpoint) {
|
|
11
|
-
this.httpMethod = httpMethod;
|
|
12
|
-
this._baseEndpoint = endpoint;
|
|
13
|
-
this.headers = {};
|
|
14
|
-
this.bodyParameters = {};
|
|
15
|
-
this.queryParameters = {};
|
|
16
|
-
}
|
|
17
|
-
computeUri() {
|
|
18
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
19
|
-
if (this.queryParameters) {
|
|
20
|
-
parameterBuilder.addExtraQueryParameters(this.queryParameters);
|
|
21
|
-
}
|
|
22
|
-
const queryParametersString = parameterBuilder.createQueryString();
|
|
23
|
-
return UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
|
|
24
|
-
}
|
|
25
|
-
computeParametersBodyString() {
|
|
26
|
-
const parameterBuilder = new RequestParameterBuilder();
|
|
27
|
-
if (this.bodyParameters) {
|
|
28
|
-
parameterBuilder.addExtraQueryParameters(this.bodyParameters);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
class ManagedIdentityRequestParameters {
|
|
10
|
+
constructor(httpMethod, endpoint) {
|
|
11
|
+
this.httpMethod = httpMethod;
|
|
12
|
+
this._baseEndpoint = endpoint;
|
|
13
|
+
this.headers = {};
|
|
14
|
+
this.bodyParameters = {};
|
|
15
|
+
this.queryParameters = {};
|
|
16
|
+
}
|
|
17
|
+
computeUri() {
|
|
18
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
19
|
+
if (this.queryParameters) {
|
|
20
|
+
parameterBuilder.addExtraQueryParameters(this.queryParameters);
|
|
21
|
+
}
|
|
22
|
+
const queryParametersString = parameterBuilder.createQueryString();
|
|
23
|
+
return UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
|
|
24
|
+
}
|
|
25
|
+
computeParametersBodyString() {
|
|
26
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
27
|
+
if (this.bodyParameters) {
|
|
28
|
+
parameterBuilder.addExtraQueryParameters(this.bodyParameters);
|
|
29
|
+
}
|
|
30
|
+
return parameterBuilder.createQueryString();
|
|
31
|
+
}
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export { ManagedIdentityRequestParameters };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedIdentityRequestParameters.mjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;MAKU,gCAAgC,CAAA;IAOzC,WAAY,CAAA,UAAsB,EAAE,QAAgB,EAAA;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;AAC9B,QAAA,IAAI,CAAC,OAAO,GAAG,EAA4B,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,EAA4B,CAAC;AACnD,QAAA,IAAI,CAAC,eAAe,GAAG,EAA4B,CAAC;KACvD;IAEM,UAAU,GAAA;AACb,QAAA,MAAM,gBAAgB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,eAAe,EAAE;AACtB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAClE,SAAA;AAED,QAAA,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAEnE,OAAO,SAAS,CAAC,iBAAiB,CAC9B,IAAI,CAAC,aAAa,EAClB,qBAAqB,CACxB,CAAC;KACL;IAEM,2BAA2B,GAAA;AAC9B,QAAA,MAAM,gBAAgB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,cAAc,EAAE;AACrB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACjE,SAAA;AAED,QAAA,
|
|
1
|
+
{"version":3,"file":"ManagedIdentityRequestParameters.mjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;MAKU,gCAAgC,CAAA;IAOzC,WAAY,CAAA,UAAsB,EAAE,QAAgB,EAAA;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;AAC9B,QAAA,IAAI,CAAC,OAAO,GAAG,EAA4B,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,EAA4B,CAAC;AACnD,QAAA,IAAI,CAAC,eAAe,GAAG,EAA4B,CAAC;KACvD;IAEM,UAAU,GAAA;AACb,QAAA,MAAM,gBAAgB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,eAAe,EAAE;AACtB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAClE,SAAA;AAED,QAAA,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAEnE,OAAO,SAAS,CAAC,iBAAiB,CAC9B,IAAI,CAAC,aAAa,EAClB,qBAAqB,CACxB,CAAC;KACL;IAEM,2BAA2B,GAAA;AAC9B,QAAA,MAAM,gBAAgB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAEvD,IAAI,IAAI,CAAC,cAAc,EAAE;AACrB,YAAA,gBAAgB,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACjE,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C;AACJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.7.0
|
|
1
|
+
/*! @azure/msal-node v2.7.0 2024-04-11 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -7,80 +7,80 @@ var EncodingUtils = require('../utils/EncodingUtils.cjs');
|
|
|
7
7
|
var PkceGenerator = require('./PkceGenerator.cjs');
|
|
8
8
|
var HashUtils = require('./HashUtils.cjs');
|
|
9
9
|
|
|
10
|
-
/*
|
|
11
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
-
* Licensed under the MIT License.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
16
|
-
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
class CryptoProvider {
|
|
20
|
-
constructor() {
|
|
21
|
-
// Browser crypto needs to be validated first before any other classes can be set.
|
|
22
|
-
this.pkceGenerator = new PkceGenerator.PkceGenerator();
|
|
23
|
-
this.guidGenerator = new GuidGenerator.GuidGenerator();
|
|
24
|
-
this.hashUtils = new HashUtils.HashUtils();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new random GUID - used to populate state and nonce.
|
|
28
|
-
* @returns string (GUID)
|
|
29
|
-
*/
|
|
30
|
-
createNewGuid() {
|
|
31
|
-
return this.guidGenerator.generateGuid();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Encodes input string to base64.
|
|
35
|
-
* @param input - string to be encoded
|
|
36
|
-
*/
|
|
37
|
-
base64Encode(input) {
|
|
38
|
-
return EncodingUtils.EncodingUtils.base64Encode(input);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Decodes input string from base64.
|
|
42
|
-
* @param input - string to be decoded
|
|
43
|
-
*/
|
|
44
|
-
base64Decode(input) {
|
|
45
|
-
return EncodingUtils.EncodingUtils.base64Decode(input);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Generates PKCE codes used in Authorization Code Flow.
|
|
49
|
-
*/
|
|
50
|
-
generatePkceCodes() {
|
|
51
|
-
return this.pkceGenerator.generatePkceCodes();
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
|
|
55
|
-
*/
|
|
56
|
-
getPublicKeyThumbprint() {
|
|
57
|
-
throw new Error("Method not implemented.");
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
61
|
-
* @param kid
|
|
62
|
-
*/
|
|
63
|
-
removeTokenBindingKey() {
|
|
64
|
-
throw new Error("Method not implemented.");
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Removes all cryptographic keys from Keystore
|
|
68
|
-
*/
|
|
69
|
-
clearKeystore() {
|
|
70
|
-
throw new Error("Method not implemented.");
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
|
|
74
|
-
*/
|
|
75
|
-
signJwt() {
|
|
76
|
-
throw new Error("Method not implemented.");
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Returns the SHA-256 hash of an input string
|
|
80
|
-
*/
|
|
81
|
-
async hashString(plainText) {
|
|
82
|
-
return EncodingUtils.EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
|
|
83
|
-
}
|
|
10
|
+
/*
|
|
11
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
+
* Licensed under the MIT License.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
16
|
+
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
class CryptoProvider {
|
|
20
|
+
constructor() {
|
|
21
|
+
// Browser crypto needs to be validated first before any other classes can be set.
|
|
22
|
+
this.pkceGenerator = new PkceGenerator.PkceGenerator();
|
|
23
|
+
this.guidGenerator = new GuidGenerator.GuidGenerator();
|
|
24
|
+
this.hashUtils = new HashUtils.HashUtils();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new random GUID - used to populate state and nonce.
|
|
28
|
+
* @returns string (GUID)
|
|
29
|
+
*/
|
|
30
|
+
createNewGuid() {
|
|
31
|
+
return this.guidGenerator.generateGuid();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Encodes input string to base64.
|
|
35
|
+
* @param input - string to be encoded
|
|
36
|
+
*/
|
|
37
|
+
base64Encode(input) {
|
|
38
|
+
return EncodingUtils.EncodingUtils.base64Encode(input);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Decodes input string from base64.
|
|
42
|
+
* @param input - string to be decoded
|
|
43
|
+
*/
|
|
44
|
+
base64Decode(input) {
|
|
45
|
+
return EncodingUtils.EncodingUtils.base64Decode(input);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generates PKCE codes used in Authorization Code Flow.
|
|
49
|
+
*/
|
|
50
|
+
generatePkceCodes() {
|
|
51
|
+
return this.pkceGenerator.generatePkceCodes();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
|
|
55
|
+
*/
|
|
56
|
+
getPublicKeyThumbprint() {
|
|
57
|
+
throw new Error("Method not implemented.");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
61
|
+
* @param kid
|
|
62
|
+
*/
|
|
63
|
+
removeTokenBindingKey() {
|
|
64
|
+
throw new Error("Method not implemented.");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Removes all cryptographic keys from Keystore
|
|
68
|
+
*/
|
|
69
|
+
clearKeystore() {
|
|
70
|
+
throw new Error("Method not implemented.");
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
|
|
74
|
+
*/
|
|
75
|
+
signJwt() {
|
|
76
|
+
throw new Error("Method not implemented.");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns the SHA-256 hash of an input string
|
|
80
|
+
*/
|
|
81
|
+
async hashString(plainText) {
|
|
82
|
+
return EncodingUtils.EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
|
|
83
|
+
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
exports.CryptoProvider = CryptoProvider;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { ICrypto, PkceCodes } from "@azure/msal-common";
|
|
2
|
-
/**
|
|
3
|
-
* This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
4
|
-
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare class CryptoProvider implements ICrypto {
|
|
8
|
-
private pkceGenerator;
|
|
9
|
-
private guidGenerator;
|
|
10
|
-
private hashUtils;
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Creates a new random GUID - used to populate state and nonce.
|
|
14
|
-
* @returns string (GUID)
|
|
15
|
-
*/
|
|
16
|
-
createNewGuid(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Encodes input string to base64.
|
|
19
|
-
* @param input - string to be encoded
|
|
20
|
-
*/
|
|
21
|
-
base64Encode(input: string): string;
|
|
22
|
-
/**
|
|
23
|
-
* Decodes input string from base64.
|
|
24
|
-
* @param input - string to be decoded
|
|
25
|
-
*/
|
|
26
|
-
base64Decode(input: string): string;
|
|
27
|
-
/**
|
|
28
|
-
* Generates PKCE codes used in Authorization Code Flow.
|
|
29
|
-
*/
|
|
30
|
-
generatePkceCodes(): Promise<PkceCodes>;
|
|
31
|
-
/**
|
|
32
|
-
* Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
|
|
33
|
-
*/
|
|
34
|
-
getPublicKeyThumbprint(): Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
37
|
-
* @param kid
|
|
38
|
-
*/
|
|
39
|
-
removeTokenBindingKey(): Promise<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Removes all cryptographic keys from Keystore
|
|
42
|
-
*/
|
|
43
|
-
clearKeystore(): Promise<boolean>;
|
|
44
|
-
/**
|
|
45
|
-
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
|
|
46
|
-
*/
|
|
47
|
-
signJwt(): Promise<string>;
|
|
48
|
-
/**
|
|
49
|
-
* Returns the SHA-256 hash of an input string
|
|
50
|
-
*/
|
|
51
|
-
hashString(plainText: string): Promise<string>;
|
|
52
|
-
}
|
|
1
|
+
import { ICrypto, PkceCodes } from "@azure/msal-common";
|
|
2
|
+
/**
|
|
3
|
+
* This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
4
|
+
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class CryptoProvider implements ICrypto {
|
|
8
|
+
private pkceGenerator;
|
|
9
|
+
private guidGenerator;
|
|
10
|
+
private hashUtils;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new random GUID - used to populate state and nonce.
|
|
14
|
+
* @returns string (GUID)
|
|
15
|
+
*/
|
|
16
|
+
createNewGuid(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Encodes input string to base64.
|
|
19
|
+
* @param input - string to be encoded
|
|
20
|
+
*/
|
|
21
|
+
base64Encode(input: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Decodes input string from base64.
|
|
24
|
+
* @param input - string to be decoded
|
|
25
|
+
*/
|
|
26
|
+
base64Decode(input: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Generates PKCE codes used in Authorization Code Flow.
|
|
29
|
+
*/
|
|
30
|
+
generatePkceCodes(): Promise<PkceCodes>;
|
|
31
|
+
/**
|
|
32
|
+
* Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
|
|
33
|
+
*/
|
|
34
|
+
getPublicKeyThumbprint(): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
37
|
+
* @param kid
|
|
38
|
+
*/
|
|
39
|
+
removeTokenBindingKey(): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Removes all cryptographic keys from Keystore
|
|
42
|
+
*/
|
|
43
|
+
clearKeystore(): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
|
|
46
|
+
*/
|
|
47
|
+
signJwt(): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the SHA-256 hash of an input string
|
|
50
|
+
*/
|
|
51
|
+
hashString(plainText: string): Promise<string>;
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=CryptoProvider.d.ts.map
|