@azure/msal-node 2.6.0 → 2.7.0-alpha.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 +170 -170
- package/dist/cache/serializer/Deserializer.d.ts +42 -42
- package/dist/cache/serializer/Deserializer.mjs +170 -170
- 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.d.ts +142 -142
- package/dist/client/ClientApplication.mjs +333 -333
- 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 -190
- package/dist/client/ClientCredentialClient.cjs.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts +33 -33
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +195 -191
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- 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 +96 -0
- package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
- package/dist/client/ManagedIdentityApplication.d.ts +24 -0
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
- package/dist/client/ManagedIdentityApplication.mjs +94 -0
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
- package/dist/client/ManagedIdentityClient.cjs +49 -0
- package/dist/client/ManagedIdentityClient.cjs.map +1 -0
- package/dist/client/ManagedIdentityClient.d.ts +25 -0
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
- package/dist/client/ManagedIdentityClient.mjs +47 -0
- package/dist/client/ManagedIdentityClient.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
- package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
- package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
- package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.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 +88 -72
- package/dist/config/Configuration.cjs.map +1 -1
- package/dist/config/Configuration.d.ts +122 -107
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +88 -73
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.cjs +59 -0
- package/dist/config/ManagedIdentityId.cjs.map +1 -0
- package/dist/config/ManagedIdentityId.d.ts +12 -0
- package/dist/config/ManagedIdentityId.d.ts.map +1 -0
- package/dist/config/ManagedIdentityId.mjs +57 -0
- package/dist/config/ManagedIdentityId.mjs.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
- package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
- 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 +40 -0
- package/dist/error/ManagedIdentityError.cjs.map +1 -0
- package/dist/error/ManagedIdentityError.d.ts +22 -0
- package/dist/error/ManagedIdentityError.d.ts.map +1 -0
- package/dist/error/ManagedIdentityError.mjs +36 -0
- package/dist/error/ManagedIdentityError.mjs.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
- package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
- package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
- package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
- 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 +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +44 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +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 -276
- package/dist/network/HttpClient.cjs.map +1 -1
- package/dist/network/HttpClient.d.ts +26 -25
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +283 -276
- package/dist/network/HttpClient.mjs.map +1 -1
- 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 +9 -0
- package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
- package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
- package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
- 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 +25 -0
- package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
- package/dist/utils/Constants.cjs +109 -80
- package/dist/utils/Constants.cjs.map +1 -1
- package/dist/utils/Constants.d.ts +106 -86
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -81
- 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 +3 -3
- package/src/cache/NodeStorage.ts +1 -4
- package/src/client/ClientCredentialClient.ts +65 -25
- package/src/client/ManagedIdentityApplication.ts +194 -0
- package/src/client/ManagedIdentityClient.ts +111 -0
- package/src/client/ManagedIdentitySources/AppService.ts +151 -0
- package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
- package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
- package/src/client/ManagedIdentitySources/Imds.ts +112 -0
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
- package/src/config/Configuration.ts +47 -1
- package/src/config/ManagedIdentityId.ts +73 -0
- package/src/config/ManagedIdentityRequestParameters.ts +53 -0
- package/src/error/ManagedIdentityError.ts +46 -0
- package/src/error/ManagedIdentityErrorCodes.ts +15 -0
- package/src/index.ts +4 -0
- package/src/network/HttpClient.ts +17 -5
- package/src/packageMetadata.ts +1 -1
- package/src/request/ManagedIdentityRequest.ts +15 -0
- package/src/request/ManagedIdentityRequestParams.ts +14 -0
- package/src/response/ManagedIdentityTokenResponse.ts +33 -0
- package/src/utils/Constants.ts +27 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Authority,
|
|
8
|
+
INetworkModule,
|
|
9
|
+
Logger,
|
|
10
|
+
AuthenticationResult,
|
|
11
|
+
} from "@azure/msal-common";
|
|
12
|
+
import { AppService } from "./ManagedIdentitySources/AppService";
|
|
13
|
+
import { AzureArc } from "./ManagedIdentitySources/AzureArc";
|
|
14
|
+
import { CloudShell } from "./ManagedIdentitySources/CloudShell";
|
|
15
|
+
import { Imds } from "./ManagedIdentitySources/Imds";
|
|
16
|
+
import { ServiceFabric } from "./ManagedIdentitySources/ServiceFabric";
|
|
17
|
+
import { CryptoProvider } from "../crypto/CryptoProvider";
|
|
18
|
+
import {
|
|
19
|
+
ManagedIdentityErrorCodes,
|
|
20
|
+
createManagedIdentityError,
|
|
21
|
+
} from "../error/ManagedIdentityError";
|
|
22
|
+
import { ManagedIdentityRequest } from "../request/ManagedIdentityRequest";
|
|
23
|
+
import { ManagedIdentityId } from "../config/ManagedIdentityId";
|
|
24
|
+
import { NodeStorage } from "../cache/NodeStorage";
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Class to initialize a managed identity and identify the service.
|
|
28
|
+
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs
|
|
29
|
+
*/
|
|
30
|
+
export class ManagedIdentityClient {
|
|
31
|
+
private logger: Logger;
|
|
32
|
+
private nodeStorage: NodeStorage;
|
|
33
|
+
private networkClient: INetworkModule;
|
|
34
|
+
private cryptoProvider: CryptoProvider;
|
|
35
|
+
|
|
36
|
+
static identitySource:
|
|
37
|
+
| ServiceFabric
|
|
38
|
+
| AppService
|
|
39
|
+
| CloudShell
|
|
40
|
+
| AzureArc
|
|
41
|
+
| Imds
|
|
42
|
+
| undefined;
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
logger: Logger,
|
|
46
|
+
nodeStorage: NodeStorage,
|
|
47
|
+
networkClient: INetworkModule,
|
|
48
|
+
cryptoProvider: CryptoProvider
|
|
49
|
+
) {
|
|
50
|
+
this.logger = logger;
|
|
51
|
+
this.nodeStorage = nodeStorage;
|
|
52
|
+
this.networkClient = networkClient;
|
|
53
|
+
this.cryptoProvider = cryptoProvider;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public async sendManagedIdentityTokenRequest(
|
|
57
|
+
managedIdentityRequest: ManagedIdentityRequest,
|
|
58
|
+
managedIdentityId: ManagedIdentityId,
|
|
59
|
+
fakeAuthority: Authority,
|
|
60
|
+
refreshAccessToken?: boolean
|
|
61
|
+
): Promise<AuthenticationResult> {
|
|
62
|
+
if (!ManagedIdentityClient.identitySource) {
|
|
63
|
+
ManagedIdentityClient.identitySource =
|
|
64
|
+
this.selectManagedIdentitySource(
|
|
65
|
+
this.logger,
|
|
66
|
+
this.nodeStorage,
|
|
67
|
+
this.networkClient,
|
|
68
|
+
this.cryptoProvider
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return ManagedIdentityClient.identitySource.acquireTokenWithManagedIdentity(
|
|
73
|
+
managedIdentityRequest,
|
|
74
|
+
managedIdentityId,
|
|
75
|
+
fakeAuthority,
|
|
76
|
+
refreshAccessToken
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Tries to create a managed identity source for all sources
|
|
82
|
+
* @returns the managed identity Source
|
|
83
|
+
*/
|
|
84
|
+
private selectManagedIdentitySource(
|
|
85
|
+
logger: Logger,
|
|
86
|
+
nodeStorage: NodeStorage,
|
|
87
|
+
networkClient: INetworkModule,
|
|
88
|
+
cryptoProvider: CryptoProvider
|
|
89
|
+
): ServiceFabric | AppService | CloudShell | AzureArc | Imds {
|
|
90
|
+
const source =
|
|
91
|
+
AppService.tryCreate(
|
|
92
|
+
logger,
|
|
93
|
+
nodeStorage,
|
|
94
|
+
networkClient,
|
|
95
|
+
cryptoProvider
|
|
96
|
+
) ||
|
|
97
|
+
AzureArc.tryCreate(
|
|
98
|
+
logger,
|
|
99
|
+
nodeStorage,
|
|
100
|
+
networkClient,
|
|
101
|
+
cryptoProvider
|
|
102
|
+
) ||
|
|
103
|
+
Imds.tryCreate(logger, nodeStorage, networkClient, cryptoProvider);
|
|
104
|
+
if (!source) {
|
|
105
|
+
throw createManagedIdentityError(
|
|
106
|
+
ManagedIdentityErrorCodes.unableToCreateSource
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return source;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { INetworkModule, Logger, UrlString } from "@azure/msal-common";
|
|
7
|
+
import { BaseManagedIdentitySource } from "./BaseManagedIdentitySource";
|
|
8
|
+
import {
|
|
9
|
+
HttpMethod,
|
|
10
|
+
MANAGED_IDENTITY_CLIENT_ID,
|
|
11
|
+
MANAGED_IDENTITY_OBJECT_ID,
|
|
12
|
+
MANAGED_IDENTITY_RESOURCE_ID,
|
|
13
|
+
ManagedIdentityIdType,
|
|
14
|
+
SECRET_HEADER_NAME,
|
|
15
|
+
} from "../../utils/Constants";
|
|
16
|
+
import { CryptoProvider } from "../../crypto/CryptoProvider";
|
|
17
|
+
import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRequestParameters";
|
|
18
|
+
import { ManagedIdentityId } from "../../config/ManagedIdentityId";
|
|
19
|
+
import {
|
|
20
|
+
ManagedIdentityErrorCodes,
|
|
21
|
+
createManagedIdentityError,
|
|
22
|
+
} from "../../error/ManagedIdentityError";
|
|
23
|
+
import { NodeStorage } from "../../cache/NodeStorage";
|
|
24
|
+
|
|
25
|
+
// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
|
|
26
|
+
const APP_SERVICE_MSI_API_VERSION: string = "2019-08-01";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AppServiceManagedIdentitySource.cs
|
|
30
|
+
*/
|
|
31
|
+
export class AppService extends BaseManagedIdentitySource {
|
|
32
|
+
private endpoint: string;
|
|
33
|
+
private secret: string;
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
logger: Logger,
|
|
37
|
+
nodeStorage: NodeStorage,
|
|
38
|
+
networkClient: INetworkModule,
|
|
39
|
+
cryptoProvider: CryptoProvider,
|
|
40
|
+
endpoint: string,
|
|
41
|
+
secret: string
|
|
42
|
+
) {
|
|
43
|
+
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
44
|
+
|
|
45
|
+
this.endpoint = endpoint;
|
|
46
|
+
this.secret = secret;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public static tryCreate(
|
|
50
|
+
logger: Logger,
|
|
51
|
+
nodeStorage: NodeStorage,
|
|
52
|
+
networkClient: INetworkModule,
|
|
53
|
+
cryptoProvider: CryptoProvider
|
|
54
|
+
): AppService | null {
|
|
55
|
+
const secret: string | undefined = process.env["IDENTITY_HEADER"];
|
|
56
|
+
|
|
57
|
+
const [areEnvironmentVariablesValidated, endpoint]: [
|
|
58
|
+
boolean,
|
|
59
|
+
string | undefined
|
|
60
|
+
] = validateEnvironmentVariables(
|
|
61
|
+
process.env["IDENTITY_ENDPOINT"] || undefined,
|
|
62
|
+
secret,
|
|
63
|
+
logger
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return areEnvironmentVariablesValidated
|
|
67
|
+
? new AppService(
|
|
68
|
+
logger,
|
|
69
|
+
nodeStorage,
|
|
70
|
+
networkClient,
|
|
71
|
+
cryptoProvider,
|
|
72
|
+
endpoint as string,
|
|
73
|
+
secret as string
|
|
74
|
+
)
|
|
75
|
+
: null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public createRequest(
|
|
79
|
+
resource: string,
|
|
80
|
+
managedIdentityId: ManagedIdentityId
|
|
81
|
+
): ManagedIdentityRequestParameters {
|
|
82
|
+
const request: ManagedIdentityRequestParameters =
|
|
83
|
+
new ManagedIdentityRequestParameters(HttpMethod.GET, this.endpoint);
|
|
84
|
+
|
|
85
|
+
request.headers[SECRET_HEADER_NAME] = this.secret;
|
|
86
|
+
request.queryParameters["api-version"] = APP_SERVICE_MSI_API_VERSION;
|
|
87
|
+
request.queryParameters["resource"] = resource;
|
|
88
|
+
// bodyParameters calculated in BaseManagedIdentity.acquireTokenWithManagedIdentity
|
|
89
|
+
|
|
90
|
+
switch (managedIdentityId.idType) {
|
|
91
|
+
case ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID:
|
|
92
|
+
this.logger.info(
|
|
93
|
+
"[Managed Identity] Adding user assigned client id to the request."
|
|
94
|
+
);
|
|
95
|
+
request.queryParameters[MANAGED_IDENTITY_CLIENT_ID] =
|
|
96
|
+
managedIdentityId.id;
|
|
97
|
+
break;
|
|
98
|
+
|
|
99
|
+
case ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID:
|
|
100
|
+
this.logger.info(
|
|
101
|
+
"[Managed Identity] Adding user assigned resource id to the request."
|
|
102
|
+
);
|
|
103
|
+
request.queryParameters[MANAGED_IDENTITY_RESOURCE_ID] =
|
|
104
|
+
managedIdentityId.id;
|
|
105
|
+
break;
|
|
106
|
+
|
|
107
|
+
case ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID:
|
|
108
|
+
this.logger.info(
|
|
109
|
+
"[Managed Identity] Adding user assigned object id to the request."
|
|
110
|
+
);
|
|
111
|
+
request.queryParameters[MANAGED_IDENTITY_OBJECT_ID] =
|
|
112
|
+
managedIdentityId.id;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return request;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const validateEnvironmentVariables = (
|
|
121
|
+
endpoint: string | undefined,
|
|
122
|
+
secret: string | undefined,
|
|
123
|
+
logger: Logger
|
|
124
|
+
): [boolean, string | undefined] => {
|
|
125
|
+
let endpointUrlString: string | undefined;
|
|
126
|
+
|
|
127
|
+
// if either of the endpoint or secret environment variables are undefined, this MSI provider is unavailable.
|
|
128
|
+
if (!endpoint || !secret) {
|
|
129
|
+
logger.info(
|
|
130
|
+
"[Managed Identity] App Service managed identity is unavailable because one or both of the 'IDENTITY_HEADER' and 'IDENTITY_ENDPOINT' environment variables are missing."
|
|
131
|
+
);
|
|
132
|
+
return [false, endpointUrlString];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
endpointUrlString = new UrlString(endpoint).urlString;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
logger.info(
|
|
139
|
+
"[Managed Identity] App Service managed identity is unavailable because the 'IDENTITY_ENDPOINT' environment variable is malformed."
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
throw createManagedIdentityError(
|
|
143
|
+
ManagedIdentityErrorCodes.urlParseError
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
logger.info(
|
|
148
|
+
`[Managed Identity] Environment variables validation passed for App Service managed identity. Endpoint URI: ${endpointUrlString}. Creating App Service managed identity.`
|
|
149
|
+
);
|
|
150
|
+
return [true, endpointUrlString];
|
|
151
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AuthError,
|
|
8
|
+
ClientAuthErrorCodes,
|
|
9
|
+
createClientAuthError,
|
|
10
|
+
HttpStatus,
|
|
11
|
+
INetworkModule,
|
|
12
|
+
NetworkResponse,
|
|
13
|
+
NetworkRequestOptions,
|
|
14
|
+
Logger,
|
|
15
|
+
UrlString,
|
|
16
|
+
ServerAuthorizationTokenResponse,
|
|
17
|
+
} from "@azure/msal-common";
|
|
18
|
+
import { ManagedIdentityId } from "../../config/ManagedIdentityId";
|
|
19
|
+
import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRequestParameters";
|
|
20
|
+
import { BaseManagedIdentitySource } from "./BaseManagedIdentitySource";
|
|
21
|
+
import { CryptoProvider } from "../../crypto/CryptoProvider";
|
|
22
|
+
import {
|
|
23
|
+
ManagedIdentityErrorCodes,
|
|
24
|
+
createManagedIdentityError,
|
|
25
|
+
} from "../../error/ManagedIdentityError";
|
|
26
|
+
import {
|
|
27
|
+
AUTHORIZATION_HEADER_NAME,
|
|
28
|
+
HttpMethod,
|
|
29
|
+
METADATA_HEADER_NAME,
|
|
30
|
+
ManagedIdentityIdType,
|
|
31
|
+
} from "../../utils/Constants";
|
|
32
|
+
import { NodeStorage } from "../../cache/NodeStorage";
|
|
33
|
+
import { readFileSync } from "fs";
|
|
34
|
+
import { ManagedIdentityTokenResponse } from "../../response/ManagedIdentityTokenResponse";
|
|
35
|
+
|
|
36
|
+
export const ARC_API_VERSION: string = "2019-11-01";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AzureArcManagedIdentitySource.cs
|
|
40
|
+
*/
|
|
41
|
+
export class AzureArc extends BaseManagedIdentitySource {
|
|
42
|
+
private endpoint: string;
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
logger: Logger,
|
|
46
|
+
nodeStorage: NodeStorage,
|
|
47
|
+
networkClient: INetworkModule,
|
|
48
|
+
cryptoProvider: CryptoProvider,
|
|
49
|
+
endpoint: string
|
|
50
|
+
) {
|
|
51
|
+
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
52
|
+
|
|
53
|
+
this.endpoint = endpoint;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public static tryCreate(
|
|
57
|
+
logger: Logger,
|
|
58
|
+
nodeStorage: NodeStorage,
|
|
59
|
+
networkClient: INetworkModule,
|
|
60
|
+
cryptoProvider: CryptoProvider
|
|
61
|
+
): AzureArc | null {
|
|
62
|
+
const imdsEndpoint: string | undefined = process.env["IMDS_ENDPOINT"];
|
|
63
|
+
|
|
64
|
+
const [areEnvironmentVariablesValidated, endpoint]: [
|
|
65
|
+
boolean,
|
|
66
|
+
string | undefined
|
|
67
|
+
] = validateEnvironmentVariables(
|
|
68
|
+
process.env["IDENTITY_ENDPOINT"] || undefined,
|
|
69
|
+
imdsEndpoint,
|
|
70
|
+
logger
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return areEnvironmentVariablesValidated
|
|
74
|
+
? new AzureArc(
|
|
75
|
+
logger,
|
|
76
|
+
nodeStorage,
|
|
77
|
+
networkClient,
|
|
78
|
+
cryptoProvider,
|
|
79
|
+
endpoint as string
|
|
80
|
+
)
|
|
81
|
+
: null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public createRequest(
|
|
85
|
+
resource: string,
|
|
86
|
+
managedIdentityId: ManagedIdentityId
|
|
87
|
+
): ManagedIdentityRequestParameters {
|
|
88
|
+
if (
|
|
89
|
+
managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED
|
|
90
|
+
) {
|
|
91
|
+
throw createManagedIdentityError(
|
|
92
|
+
ManagedIdentityErrorCodes.unableToCreateAzureArc
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const request: ManagedIdentityRequestParameters =
|
|
97
|
+
new ManagedIdentityRequestParameters(
|
|
98
|
+
HttpMethod.GET,
|
|
99
|
+
this.endpoint.replace("localhost", "127.0.0.1")
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
request.headers[METADATA_HEADER_NAME] = "true";
|
|
103
|
+
request.queryParameters["api-version"] = ARC_API_VERSION;
|
|
104
|
+
request.queryParameters["resource"] = resource;
|
|
105
|
+
// bodyParameters calculated in BaseManagedIdentity.acquireTokenWithManagedIdentity
|
|
106
|
+
|
|
107
|
+
return request;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public async getServerTokenResponseAsync(
|
|
111
|
+
originalResponse: NetworkResponse<ManagedIdentityTokenResponse>,
|
|
112
|
+
networkClient: INetworkModule,
|
|
113
|
+
networkRequest: ManagedIdentityRequestParameters,
|
|
114
|
+
networkRequestOptions: NetworkRequestOptions
|
|
115
|
+
): Promise<ServerAuthorizationTokenResponse> {
|
|
116
|
+
let retryResponse:
|
|
117
|
+
| NetworkResponse<ManagedIdentityTokenResponse>
|
|
118
|
+
| undefined;
|
|
119
|
+
|
|
120
|
+
if (originalResponse.status === HttpStatus.UNAUTHORIZED) {
|
|
121
|
+
const wwwAuthHeader: string =
|
|
122
|
+
originalResponse.headers["www-authenticate"];
|
|
123
|
+
if (!wwwAuthHeader) {
|
|
124
|
+
throw createManagedIdentityError(
|
|
125
|
+
ManagedIdentityErrorCodes.wwwAuthenticateHeaderMissing
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
if (!wwwAuthHeader.includes("Basic realm=")) {
|
|
129
|
+
throw createManagedIdentityError(
|
|
130
|
+
ManagedIdentityErrorCodes.wwwAuthenticateHeaderUnsupportedFormat
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const secretFile = wwwAuthHeader.split("Basic realm=")[1];
|
|
135
|
+
let secret;
|
|
136
|
+
try {
|
|
137
|
+
secret = readFileSync(secretFile, "utf-8");
|
|
138
|
+
} catch (e) {
|
|
139
|
+
throw createManagedIdentityError(
|
|
140
|
+
ManagedIdentityErrorCodes.unableToReadSecretFile
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const authHeaderValue = `Basic ${secret}`;
|
|
144
|
+
|
|
145
|
+
this.logger.info(
|
|
146
|
+
`[Managed Identity] Adding authorization header to the request.`
|
|
147
|
+
);
|
|
148
|
+
networkRequest.headers[AUTHORIZATION_HEADER_NAME] = authHeaderValue;
|
|
149
|
+
|
|
150
|
+
try {
|
|
151
|
+
retryResponse =
|
|
152
|
+
await networkClient.sendGetRequestAsync<ManagedIdentityTokenResponse>(
|
|
153
|
+
networkRequest.computeUri(),
|
|
154
|
+
networkRequestOptions
|
|
155
|
+
);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
if (error instanceof AuthError) {
|
|
158
|
+
throw error;
|
|
159
|
+
} else {
|
|
160
|
+
throw createClientAuthError(
|
|
161
|
+
ClientAuthErrorCodes.networkError
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return this.getServerTokenResponse(retryResponse || originalResponse);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const validateEnvironmentVariables = (
|
|
172
|
+
identityEndpoint: string | undefined,
|
|
173
|
+
imdsEndpoint: string | undefined,
|
|
174
|
+
logger: Logger
|
|
175
|
+
): [boolean, string | undefined] => {
|
|
176
|
+
let endpointUrlString: string | undefined;
|
|
177
|
+
|
|
178
|
+
// if either of the identity or imds endpoints are undefined, this MSI provider is unavailable.
|
|
179
|
+
if (!identityEndpoint || !imdsEndpoint) {
|
|
180
|
+
logger.info(
|
|
181
|
+
"[Managed Identity] Azure Arc managed identity is unavailable because one or both of the 'IDENTITY_ENDPOINT' and 'IMDS_ENDPOINT' environment variables are missing."
|
|
182
|
+
);
|
|
183
|
+
return [false, endpointUrlString];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
try {
|
|
187
|
+
endpointUrlString = new UrlString(identityEndpoint).urlString;
|
|
188
|
+
} catch (error) {
|
|
189
|
+
logger.info(
|
|
190
|
+
"[Managed Identity] App service managed identity is unavailable because the 'IDENTITY_ENDPOINT' environment variable is malformed."
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
throw createManagedIdentityError(
|
|
194
|
+
ManagedIdentityErrorCodes.urlParseError
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
logger.info(
|
|
199
|
+
`[Managed Identity] Environment variables validation passed for Azure Arc managed identity. Endpoint URI: ${endpointUrlString}. Creating Azure Arc managed identity.`
|
|
200
|
+
);
|
|
201
|
+
return [
|
|
202
|
+
true,
|
|
203
|
+
// remove trailing slash
|
|
204
|
+
endpointUrlString.endsWith("/")
|
|
205
|
+
? endpointUrlString.slice(0, -1)
|
|
206
|
+
: endpointUrlString,
|
|
207
|
+
];
|
|
208
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AuthError,
|
|
8
|
+
Authority,
|
|
9
|
+
ClientAuthErrorCodes,
|
|
10
|
+
Constants,
|
|
11
|
+
HeaderNames,
|
|
12
|
+
INetworkModule,
|
|
13
|
+
Logger,
|
|
14
|
+
NetworkRequestOptions,
|
|
15
|
+
NetworkResponse,
|
|
16
|
+
ResponseHandler,
|
|
17
|
+
ServerAuthorizationTokenResponse,
|
|
18
|
+
TimeUtils,
|
|
19
|
+
createClientAuthError,
|
|
20
|
+
AuthenticationResult,
|
|
21
|
+
} from "@azure/msal-common";
|
|
22
|
+
import { ManagedIdentityId } from "../../config/ManagedIdentityId";
|
|
23
|
+
import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRequestParameters";
|
|
24
|
+
import { CryptoProvider } from "../../crypto/CryptoProvider";
|
|
25
|
+
import { ManagedIdentityRequest } from "../../request/ManagedIdentityRequest";
|
|
26
|
+
import { HttpMethod } from "../../utils/Constants";
|
|
27
|
+
import { ManagedIdentityTokenResponse } from "../../response/ManagedIdentityTokenResponse";
|
|
28
|
+
import { NodeStorage } from "../../cache/NodeStorage";
|
|
29
|
+
|
|
30
|
+
export abstract class BaseManagedIdentitySource {
|
|
31
|
+
protected logger: Logger;
|
|
32
|
+
private nodeStorage: NodeStorage;
|
|
33
|
+
private networkClient: INetworkModule;
|
|
34
|
+
private cryptoProvider: CryptoProvider;
|
|
35
|
+
|
|
36
|
+
constructor(
|
|
37
|
+
logger: Logger,
|
|
38
|
+
nodeStorage: NodeStorage,
|
|
39
|
+
networkClient: INetworkModule,
|
|
40
|
+
cryptoProvider: CryptoProvider
|
|
41
|
+
) {
|
|
42
|
+
this.logger = logger;
|
|
43
|
+
this.nodeStorage = nodeStorage;
|
|
44
|
+
this.networkClient = networkClient;
|
|
45
|
+
this.cryptoProvider = cryptoProvider;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
abstract createRequest(
|
|
49
|
+
request: string,
|
|
50
|
+
managedIdentityId: ManagedIdentityId
|
|
51
|
+
): ManagedIdentityRequestParameters;
|
|
52
|
+
|
|
53
|
+
public async getServerTokenResponseAsync(
|
|
54
|
+
response: NetworkResponse<ManagedIdentityTokenResponse>,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
_networkClient: INetworkModule,
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
58
|
+
_networkRequest: ManagedIdentityRequestParameters,
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
60
|
+
_networkRequestOptions: NetworkRequestOptions
|
|
61
|
+
): Promise<ServerAuthorizationTokenResponse> {
|
|
62
|
+
return this.getServerTokenResponse(response);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public getServerTokenResponse(
|
|
66
|
+
response: NetworkResponse<ManagedIdentityTokenResponse>
|
|
67
|
+
): ServerAuthorizationTokenResponse {
|
|
68
|
+
const serverTokenResponse: ServerAuthorizationTokenResponse = {
|
|
69
|
+
status: response.status,
|
|
70
|
+
|
|
71
|
+
// success
|
|
72
|
+
access_token: response.body.access_token,
|
|
73
|
+
expires_in: response.body.expires_on,
|
|
74
|
+
scope: response.body.resource,
|
|
75
|
+
token_type: response.body.token_type,
|
|
76
|
+
|
|
77
|
+
// error
|
|
78
|
+
error: response.body.message,
|
|
79
|
+
correlation_id: response.body.correlationId,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// compute refresh_in as 1/2 of expires_in, but only if expires_in > 2h
|
|
83
|
+
if (
|
|
84
|
+
serverTokenResponse.expires_in &&
|
|
85
|
+
serverTokenResponse.expires_in > 2 * 3600
|
|
86
|
+
) {
|
|
87
|
+
serverTokenResponse.refresh_in = serverTokenResponse.expires_in / 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return serverTokenResponse;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public async acquireTokenWithManagedIdentity(
|
|
94
|
+
managedIdentityRequest: ManagedIdentityRequest,
|
|
95
|
+
managedIdentityId: ManagedIdentityId,
|
|
96
|
+
fakeAuthority: Authority,
|
|
97
|
+
refreshAccessToken?: boolean
|
|
98
|
+
): Promise<AuthenticationResult> {
|
|
99
|
+
const networkRequest: ManagedIdentityRequestParameters =
|
|
100
|
+
this.createRequest(
|
|
101
|
+
managedIdentityRequest.resource,
|
|
102
|
+
managedIdentityId
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const headers: Record<string, string> = networkRequest.headers;
|
|
106
|
+
headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;
|
|
107
|
+
const networkRequestOptions: NetworkRequestOptions = { headers };
|
|
108
|
+
if (managedIdentityRequest.forceRefresh) {
|
|
109
|
+
networkRequestOptions.body =
|
|
110
|
+
networkRequest.computeParametersBodyString();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
114
|
+
let response: NetworkResponse<ManagedIdentityTokenResponse>;
|
|
115
|
+
try {
|
|
116
|
+
// Sources that send POST requests: Cloud Shell
|
|
117
|
+
if (networkRequest.httpMethod === HttpMethod.POST) {
|
|
118
|
+
response =
|
|
119
|
+
await this.networkClient.sendPostRequestAsync<ManagedIdentityTokenResponse>(
|
|
120
|
+
networkRequest.computeUri(),
|
|
121
|
+
networkRequestOptions
|
|
122
|
+
);
|
|
123
|
+
// Sources that send GET requests: App Service, Azure Arc, IMDS, Service Fabric
|
|
124
|
+
} else {
|
|
125
|
+
response =
|
|
126
|
+
await this.networkClient.sendGetRequestAsync<ManagedIdentityTokenResponse>(
|
|
127
|
+
networkRequest.computeUri(),
|
|
128
|
+
networkRequestOptions
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (error instanceof AuthError) {
|
|
133
|
+
throw error;
|
|
134
|
+
} else {
|
|
135
|
+
throw createClientAuthError(ClientAuthErrorCodes.networkError);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const responseHandler = new ResponseHandler(
|
|
140
|
+
managedIdentityId.id,
|
|
141
|
+
this.nodeStorage,
|
|
142
|
+
this.cryptoProvider,
|
|
143
|
+
this.logger,
|
|
144
|
+
null,
|
|
145
|
+
null
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const serverTokenResponse: ServerAuthorizationTokenResponse =
|
|
149
|
+
await this.getServerTokenResponseAsync(
|
|
150
|
+
response,
|
|
151
|
+
this.networkClient,
|
|
152
|
+
networkRequest,
|
|
153
|
+
networkRequestOptions
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
responseHandler.validateTokenResponse(
|
|
157
|
+
serverTokenResponse,
|
|
158
|
+
refreshAccessToken
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
// caches the token
|
|
162
|
+
return responseHandler.handleServerTokenResponse(
|
|
163
|
+
serverTokenResponse,
|
|
164
|
+
fakeAuthority,
|
|
165
|
+
reqTimestamp,
|
|
166
|
+
managedIdentityRequest
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ManagedIdentityId } from "../../config/ManagedIdentityId";
|
|
7
|
+
import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRequestParameters";
|
|
8
|
+
import { BaseManagedIdentitySource } from "./BaseManagedIdentitySource";
|
|
9
|
+
|
|
10
|
+
export class CloudShell extends BaseManagedIdentitySource {
|
|
11
|
+
public createRequest(
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
_resource: string,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
_managedIdentityId: ManagedIdentityId
|
|
16
|
+
): ManagedIdentityRequestParameters {
|
|
17
|
+
throw new Error("Method not implemented.");
|
|
18
|
+
}
|
|
19
|
+
}
|