@azure/identity 4.14.0-beta.2 → 4.14.0-beta.4
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/browser/client/identityClient.d.ts.map +1 -1
- package/dist/browser/client/identityClient.js +2 -1
- package/dist/browser/client/identityClient.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/credentials/{authorizationCodeCredential.d.ts → authorizationCodeCredential-browser.d.mts} +2 -2
- package/dist/browser/credentials/authorizationCodeCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{authorizationCodeCredential.js → authorizationCodeCredential-browser.mjs} +1 -1
- package/dist/browser/credentials/authorizationCodeCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/azureCliCredential-browser.d.mts +14 -0
- package/dist/browser/credentials/azureCliCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{azureCliCredential.js → azureCliCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/azureCliCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/azureDeveloperCliCredential-browser.d.mts +14 -0
- package/dist/browser/credentials/azureDeveloperCliCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{azureDeveloperCliCredential.js → azureDeveloperCliCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/azureDeveloperCliCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/azurePipelinesCredential-browser.d.mts +14 -0
- package/dist/browser/credentials/azurePipelinesCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{azurePipelinesCredential.js → azurePipelinesCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/azurePipelinesCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/azurePowerShellCredential-browser.d.mts +13 -0
- package/dist/browser/credentials/azurePowerShellCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{azurePowerShellCredential.js → azurePowerShellCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/azurePowerShellCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/clientAssertionCredential-browser.d.mts +13 -0
- package/dist/browser/credentials/clientAssertionCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{clientAssertionCredential.js → clientAssertionCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/clientAssertionCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/clientCertificateCredential-browser.d.mts +15 -0
- package/dist/browser/credentials/clientCertificateCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{clientCertificateCredential.js → clientCertificateCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/clientCertificateCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/{defaultAzureCredential.d.ts → defaultAzureCredential-browser.d.mts} +2 -2
- package/dist/browser/credentials/defaultAzureCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{defaultAzureCredential.js → defaultAzureCredential-browser.mjs} +1 -1
- package/dist/browser/credentials/defaultAzureCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/defaultAzureCredentialOptions.d.ts +2 -2
- package/dist/browser/credentials/defaultAzureCredentialOptions.js.map +1 -1
- package/dist/browser/credentials/deviceCodeCredential-browser.d.mts +14 -0
- package/dist/browser/credentials/deviceCodeCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{deviceCodeCredential.js → deviceCodeCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/deviceCodeCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/environmentCredential-browser.d.mts +14 -0
- package/dist/browser/credentials/environmentCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{environmentCredential.js → environmentCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/environmentCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/managedIdentityCredential/index-browser.d.mts +11 -0
- package/dist/browser/credentials/managedIdentityCredential/index-browser.d.mts.map +1 -1
- package/dist/browser/credentials/managedIdentityCredential/{index.js → index-browser.mjs} +2 -2
- package/dist/browser/credentials/managedIdentityCredential/index-browser.mjs.map +1 -1
- package/dist/browser/credentials/onBehalfOfCredential-browser.d.mts +13 -0
- package/dist/browser/credentials/onBehalfOfCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{onBehalfOfCredential.js → onBehalfOfCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/onBehalfOfCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/usernamePasswordCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/{visualStudioCodeCredential.d.ts → visualStudioCodeCredential-browser.d.mts} +4 -3
- package/dist/browser/credentials/visualStudioCodeCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{visualStudioCodeCredential.js → visualStudioCodeCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/visualStudioCodeCredential-browser.mjs.map +1 -1
- package/dist/browser/credentials/{workloadIdentityCredential.d.ts → workloadIdentityCredential-browser.d.mts} +4 -3
- package/dist/browser/credentials/workloadIdentityCredential-browser.d.mts.map +1 -1
- package/dist/browser/credentials/{workloadIdentityCredential.js → workloadIdentityCredential-browser.mjs} +2 -2
- package/dist/browser/credentials/workloadIdentityCredential-browser.mjs.map +1 -1
- package/dist/browser/index.d.ts +51 -51
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +19 -19
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/msal/browserFlows/msalBrowserCommon.d.ts.map +1 -1
- package/dist/browser/msal/browserFlows/msalBrowserCommon.js +2 -3
- package/dist/browser/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist/browser/msal/msal-browser.d.mts +2 -0
- package/dist/browser/msal/msal-browser.d.mts.map +1 -1
- package/dist/browser/msal/msal-browser.mjs +4 -0
- package/dist/browser/msal/msal-browser.mjs.map +1 -1
- package/dist/browser/msal/utils.d.ts +5 -4
- package/dist/browser/msal/utils.d.ts.map +1 -1
- package/dist/browser/msal/utils.js +16 -11
- package/dist/browser/msal/utils.js.map +1 -1
- package/dist/browser/util/{processMultiTenantRequest.d.ts → processMultiTenantRequest-browser.d.mts} +2 -1
- package/dist/browser/util/processMultiTenantRequest-browser.d.mts.map +1 -1
- package/dist/browser/util/{processMultiTenantRequest.js → processMultiTenantRequest-browser.mjs} +1 -1
- package/dist/browser/util/processMultiTenantRequest-browser.mjs.map +1 -1
- package/dist/browser/util/tenantIdUtils.d.ts +1 -1
- package/dist/browser/util/tenantIdUtils.d.ts.map +1 -1
- package/dist/browser/util/tenantIdUtils.js +1 -1
- package/dist/browser/util/tenantIdUtils.js.map +1 -1
- package/dist/commonjs/client/identityClient.d.ts.map +1 -1
- package/dist/commonjs/client/identityClient.js +295 -288
- package/dist/commonjs/client/identityClient.js.map +7 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.js +61 -78
- package/dist/commonjs/constants.js.map +7 -1
- package/dist/commonjs/credentials/authorityValidationOptions.js +16 -5
- package/dist/commonjs/credentials/authorityValidationOptions.js.map +7 -1
- package/dist/commonjs/credentials/authorizationCodeCredential.js +98 -74
- package/dist/commonjs/credentials/authorizationCodeCredential.js.map +7 -1
- package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/azureCliCredential.d.ts.map +1 -1
- package/dist/commonjs/credentials/azureCliCredential.js +246 -214
- package/dist/commonjs/credentials/azureCliCredential.js.map +7 -1
- package/dist/commonjs/credentials/azureCliCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/azureCliCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts +12 -4
- package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
- package/dist/commonjs/credentials/azureDeveloperCliCredential.js +262 -224
- package/dist/commonjs/credentials/azureDeveloperCliCredential.js.map +7 -1
- package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/azurePipelinesCredential.js +173 -135
- package/dist/commonjs/credentials/azurePipelinesCredential.js.map +7 -1
- package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/azurePowerShellCredential.d.ts.map +1 -1
- package/dist/commonjs/credentials/azurePowerShellCredential.js +205 -205
- package/dist/commonjs/credentials/azurePowerShellCredential.js.map +7 -1
- package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/brokerAuthOptions.js +16 -3
- package/dist/commonjs/credentials/brokerAuthOptions.js.map +7 -1
- package/dist/commonjs/credentials/brokerCredential.js +103 -70
- package/dist/commonjs/credentials/brokerCredential.js.map +7 -1
- package/dist/commonjs/credentials/browserCustomizationOptions.js +16 -5
- package/dist/commonjs/credentials/browserCustomizationOptions.js.map +7 -1
- package/dist/commonjs/credentials/chainedTokenCredential.js +113 -93
- package/dist/commonjs/credentials/chainedTokenCredential.js.map +7 -1
- package/dist/commonjs/credentials/clientAssertionCredential.js +101 -63
- package/dist/commonjs/credentials/clientAssertionCredential.js.map +7 -1
- package/dist/commonjs/credentials/clientAssertionCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/clientAssertionCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/clientCertificateCredential.js +129 -123
- package/dist/commonjs/credentials/clientCertificateCredential.js.map +7 -1
- package/dist/commonjs/credentials/clientCertificateCredentialModels.js +16 -5
- package/dist/commonjs/credentials/clientCertificateCredentialModels.js.map +7 -1
- package/dist/commonjs/credentials/clientCertificateCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/clientCertificateCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/clientSecretCredential.js +96 -67
- package/dist/commonjs/credentials/clientSecretCredential.js.map +7 -1
- package/dist/commonjs/credentials/clientSecretCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/clientSecretCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/credentialPersistenceOptions.js +16 -5
- package/dist/commonjs/credentials/credentialPersistenceOptions.js.map +7 -1
- package/dist/commonjs/credentials/defaultAzureCredential.js +121 -159
- package/dist/commonjs/credentials/defaultAzureCredential.js.map +7 -1
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js +110 -140
- package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js.map +7 -1
- package/dist/commonjs/credentials/defaultAzureCredentialOptions.d.ts +2 -2
- package/dist/commonjs/credentials/defaultAzureCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/defaultAzureCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/deviceCodeCredential.js +132 -103
- package/dist/commonjs/credentials/deviceCodeCredential.js.map +7 -1
- package/dist/commonjs/credentials/deviceCodeCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/deviceCodeCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/environmentCredential.js +157 -123
- package/dist/commonjs/credentials/environmentCredential.js.map +7 -1
- package/dist/commonjs/credentials/environmentCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/environmentCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/interactiveBrowserCredential.js +144 -107
- package/dist/commonjs/credentials/interactiveBrowserCredential.js.map +7 -1
- package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/interactiveCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/interactiveCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js +92 -91
- package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js +51 -44
- package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/index.js +256 -242
- package/dist/commonjs/credentials/managedIdentityCredential/index.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/models.js +16 -5
- package/dist/commonjs/credentials/managedIdentityCredential/models.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/options.js +16 -5
- package/dist/commonjs/credentials/managedIdentityCredential/options.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js +56 -39
- package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +7 -1
- package/dist/commonjs/credentials/managedIdentityCredential/utils.js +79 -75
- package/dist/commonjs/credentials/managedIdentityCredential/utils.js.map +7 -1
- package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/onBehalfOfCredential.js +168 -126
- package/dist/commonjs/credentials/onBehalfOfCredential.js.map +7 -1
- package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/usernamePasswordCredential.js +112 -75
- package/dist/commonjs/credentials/usernamePasswordCredential.js.map +7 -1
- package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/visualStudioCodeCredential.js +144 -132
- package/dist/commonjs/credentials/visualStudioCodeCredential.js.map +7 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js.map +7 -1
- package/dist/commonjs/credentials/workloadIdentityCredential.js +284 -274
- package/dist/commonjs/credentials/workloadIdentityCredential.js.map +7 -1
- package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js +16 -5
- package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js.map +7 -1
- package/dist/commonjs/errors.js +131 -132
- package/dist/commonjs/errors.js.map +7 -1
- package/dist/commonjs/index.d.ts +33 -33
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +115 -67
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/msal/msal.d.ts +1 -2
- package/dist/commonjs/msal/msal.d.ts.map +1 -1
- package/dist/commonjs/msal/msal.js +30 -9
- package/dist/commonjs/msal/msal.js.map +7 -1
- package/dist/commonjs/msal/nodeFlows/brokerOptions.js +16 -3
- package/dist/commonjs/msal/nodeFlows/brokerOptions.js.map +7 -1
- package/dist/commonjs/msal/nodeFlows/msalClient.d.ts +2 -2
- package/dist/commonjs/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/commonjs/msal/nodeFlows/msalClient.js +450 -478
- package/dist/commonjs/msal/nodeFlows/msalClient.js.map +7 -1
- package/dist/commonjs/msal/nodeFlows/msalPlugins.js +140 -147
- package/dist/commonjs/msal/nodeFlows/msalPlugins.js.map +7 -1
- package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js +16 -5
- package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js.map +7 -1
- package/dist/commonjs/msal/types.js +16 -5
- package/dist/commonjs/msal/types.js.map +7 -1
- package/dist/commonjs/msal/utils.d.ts +5 -4
- package/dist/commonjs/msal/utils.d.ts.map +1 -1
- package/dist/commonjs/msal/utils.js +176 -211
- package/dist/commonjs/msal/utils.js.map +7 -1
- package/dist/commonjs/plugins/consumer.js +32 -40
- package/dist/commonjs/plugins/consumer.js.map +7 -1
- package/dist/commonjs/plugins/provider.js +16 -5
- package/dist/commonjs/plugins/provider.js.map +7 -1
- package/dist/commonjs/regionalAuthority.js +93 -141
- package/dist/commonjs/regionalAuthority.js.map +7 -1
- package/dist/commonjs/tokenCredentialOptions.js +16 -5
- package/dist/commonjs/tokenCredentialOptions.js.map +7 -1
- package/dist/commonjs/tokenProvider.js +52 -52
- package/dist/commonjs/tokenProvider.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/util/authorityHost.js +34 -19
- package/dist/commonjs/util/authorityHost.js.map +7 -1
- package/dist/commonjs/util/certificatesUtils.js +54 -45
- package/dist/commonjs/util/certificatesUtils.js.map +7 -1
- package/dist/commonjs/util/identityTokenEndpoint.js +32 -12
- package/dist/commonjs/util/identityTokenEndpoint.js.map +7 -1
- package/dist/commonjs/util/logging.js +91 -97
- package/dist/commonjs/util/logging.js.map +7 -1
- package/dist/commonjs/util/processMultiTenantRequest.js +43 -33
- package/dist/commonjs/util/processMultiTenantRequest.js.map +7 -1
- package/dist/commonjs/util/processUtils.js +60 -35
- package/dist/commonjs/util/processUtils.js.map +7 -1
- package/dist/commonjs/util/scopeUtils.js +39 -28
- package/dist/commonjs/util/scopeUtils.js.map +7 -1
- package/dist/commonjs/util/subscriptionUtils.js +35 -17
- package/dist/commonjs/util/subscriptionUtils.js.map +7 -1
- package/dist/commonjs/util/tenantIdUtils.d.ts.map +1 -1
- package/dist/commonjs/util/tenantIdUtils.js +61 -45
- package/dist/commonjs/util/tenantIdUtils.js.map +7 -1
- package/dist/commonjs/util/tracing.js +33 -16
- package/dist/commonjs/util/tracing.js.map +7 -1
- package/dist/esm/client/identityClient.d.ts.map +1 -1
- package/dist/esm/client/identityClient.js +2 -1
- package/dist/esm/client/identityClient.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/credentials/azureCliCredential.d.ts.map +1 -1
- package/dist/esm/credentials/azureCliCredential.js +2 -1
- package/dist/esm/credentials/azureCliCredential.js.map +1 -1
- package/dist/esm/credentials/azureDeveloperCliCredential.d.ts +12 -4
- package/dist/esm/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
- package/dist/esm/credentials/azureDeveloperCliCredential.js +40 -14
- package/dist/esm/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist/esm/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist/esm/credentials/azurePowerShellCredential.d.ts.map +1 -1
- package/dist/esm/credentials/azurePowerShellCredential.js +2 -1
- package/dist/esm/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist/esm/credentials/defaultAzureCredential.js.map +1 -1
- package/dist/esm/credentials/defaultAzureCredentialFunctions.js.map +1 -1
- package/dist/esm/credentials/defaultAzureCredentialOptions.d.ts +2 -2
- package/dist/esm/credentials/defaultAzureCredentialOptions.js.map +1 -1
- package/dist/esm/credentials/environmentCredential.js.map +1 -1
- package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/esm/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist/esm/index.d.ts +33 -33
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/msal/msal.d.ts +1 -2
- package/dist/esm/msal/msal.d.ts.map +1 -1
- package/dist/esm/msal/msal.js +1 -2
- package/dist/esm/msal/msal.js.map +1 -1
- package/dist/esm/msal/nodeFlows/msalClient.d.ts +2 -2
- package/dist/esm/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/esm/msal/nodeFlows/msalClient.js +3 -3
- package/dist/esm/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/esm/msal/utils.d.ts +5 -4
- package/dist/esm/msal/utils.d.ts.map +1 -1
- package/dist/esm/msal/utils.js +16 -11
- package/dist/esm/msal/utils.js.map +1 -1
- package/dist/esm/util/tenantIdUtils.d.ts.map +1 -1
- package/dist/esm/util/tenantIdUtils.js.map +1 -1
- package/dist/workerd/client/identityClient.d.ts.map +1 -1
- package/dist/workerd/client/identityClient.js +2 -1
- package/dist/workerd/client/identityClient.js.map +1 -1
- package/dist/workerd/constants.d.ts +1 -1
- package/dist/workerd/constants.js +1 -1
- package/dist/workerd/constants.js.map +1 -1
- package/dist/workerd/credentials/azureCliCredential.d.ts.map +1 -1
- package/dist/workerd/credentials/azureCliCredential.js +2 -1
- package/dist/workerd/credentials/azureCliCredential.js.map +1 -1
- package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts +12 -4
- package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
- package/dist/workerd/credentials/azureDeveloperCliCredential.js +40 -14
- package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -1
- package/dist/workerd/credentials/azurePowerShellCredential.d.ts.map +1 -1
- package/dist/workerd/credentials/azurePowerShellCredential.js +2 -1
- package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredentialFunctions.js.map +1 -1
- package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts +2 -2
- package/dist/workerd/credentials/defaultAzureCredentialOptions.js.map +1 -1
- package/dist/workerd/credentials/environmentCredential.js.map +1 -1
- package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist/workerd/index.d.ts +33 -33
- package/dist/workerd/index.d.ts.map +1 -1
- package/dist/workerd/index.js.map +1 -1
- package/dist/workerd/msal/msal.d.ts +1 -2
- package/dist/workerd/msal/msal.d.ts.map +1 -1
- package/dist/workerd/msal/msal.js +1 -2
- package/dist/workerd/msal/msal.js.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalClient.d.ts +2 -2
- package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -1
- package/dist/workerd/msal/nodeFlows/msalClient.js +3 -3
- package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -1
- package/dist/workerd/msal/utils.d.ts +5 -4
- package/dist/workerd/msal/utils.d.ts.map +1 -1
- package/dist/workerd/msal/utils.js +16 -11
- package/dist/workerd/msal/utils.js.map +1 -1
- package/dist/workerd/util/tenantIdUtils.d.ts.map +1 -1
- package/dist/workerd/util/tenantIdUtils.js.map +1 -1
- package/package.json +29 -36
- package/dist/browser/credentials/azureCliCredential.d.ts +0 -13
- package/dist/browser/credentials/azureDeveloperCliCredential.d.ts +0 -13
- package/dist/browser/credentials/azurePipelinesCredential.d.ts +0 -13
- package/dist/browser/credentials/azurePowerShellCredential.d.ts +0 -12
- package/dist/browser/credentials/brokerCredential.d.ts +0 -35
- package/dist/browser/credentials/brokerCredential.d.ts.map +0 -1
- package/dist/browser/credentials/brokerCredential.js +0 -68
- package/dist/browser/credentials/brokerCredential.js.map +0 -1
- package/dist/browser/credentials/clientAssertionCredential.d.ts +0 -12
- package/dist/browser/credentials/clientCertificateCredential.d.ts +0 -13
- package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts +0 -64
- package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts.map +0 -1
- package/dist/browser/credentials/defaultAzureCredentialFunctions.js +0 -147
- package/dist/browser/credentials/defaultAzureCredentialFunctions.js.map +0 -1
- package/dist/browser/credentials/deviceCodeCredential.d.ts +0 -13
- package/dist/browser/credentials/environmentCredential.d.ts +0 -13
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts +0 -18
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js +0 -97
- package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +0 -13
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -43
- package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/index.d.ts +0 -6
- package/dist/browser/credentials/managedIdentityCredential/models.d.ts +0 -24
- package/dist/browser/credentials/managedIdentityCredential/models.d.ts.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/models.js +0 -4
- package/dist/browser/credentials/managedIdentityCredential/models.js.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +0 -14
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +0 -1
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js +0 -38
- package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
- package/dist/browser/credentials/onBehalfOfCredential.d.ts +0 -12
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js +0 -4
- package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
- package/dist/browser/msal/msal.d.ts +0 -3
- package/dist/browser/msal/msal.js +0 -5
- package/dist/browser/msal/nodeFlows/msalClient.d.ts +0 -205
- package/dist/browser/msal/nodeFlows/msalClient.d.ts.map +0 -1
- package/dist/browser/msal/nodeFlows/msalClient.js +0 -499
- package/dist/browser/msal/nodeFlows/msalClient.js.map +0 -1
- package/dist/browser/msal/nodeFlows/msalPlugins.d.ts +0 -109
- package/dist/browser/msal/nodeFlows/msalPlugins.d.ts.map +0 -1
- package/dist/browser/msal/nodeFlows/msalPlugins.js +0 -160
- package/dist/browser/msal/nodeFlows/msalPlugins.js.map +0 -1
- package/dist/browser/regionalAuthority.d.ts +0 -122
- package/dist/browser/regionalAuthority.d.ts.map +0 -1
- package/dist/browser/regionalAuthority.js +0 -139
- package/dist/browser/regionalAuthority.js.map +0 -1
- package/dist/browser/util/authHostEnv-browser.d.mts +0 -4
- package/dist/browser/util/authHostEnv-browser.d.mts.map +0 -1
- package/dist/browser/util/authHostEnv-browser.mjs +0 -7
- package/dist/browser/util/authHostEnv-browser.mjs.map +0 -1
- package/dist/browser/util/certificatesUtils.d.ts +0 -13
- package/dist/browser/util/certificatesUtils.d.ts.map +0 -1
- package/dist/browser/util/certificatesUtils.js +0 -47
- package/dist/browser/util/certificatesUtils.js.map +0 -1
- package/dist/browser/util/processUtils.d.ts +0 -13
- package/dist/browser/util/processUtils.d.ts.map +0 -1
- package/dist/browser/util/processUtils.js +0 -32
- package/dist/browser/util/processUtils.js.map +0 -1
- package/dist/browser/util/subscriptionUtils.d.ts +0 -6
- package/dist/browser/util/subscriptionUtils.d.ts.map +0 -1
- package/dist/browser/util/subscriptionUtils.js +0 -16
- package/dist/browser/util/subscriptionUtils.js.map +0 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js +0 -5
- package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js +0 -265
- package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js.map +0 -1
- package/dist/commonjs/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
- package/dist/commonjs/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
- package/dist/commonjs/msal/browserFlows/msalBrowserOptions.js +0 -5
- package/dist/commonjs/msal/browserFlows/msalBrowserOptions.js.map +0 -1
- package/dist/commonjs/msal/credentials.d.ts +0 -52
- package/dist/commonjs/msal/credentials.d.ts.map +0 -1
- package/dist/commonjs/msal/credentials.js +0 -5
- package/dist/commonjs/msal/credentials.js.map +0 -1
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js +0 -4
- package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
- package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
- package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
- package/dist/esm/msal/browserFlows/msalBrowserCommon.js +0 -261
- package/dist/esm/msal/browserFlows/msalBrowserCommon.js.map +0 -1
- package/dist/esm/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
- package/dist/esm/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
- package/dist/esm/msal/browserFlows/msalBrowserOptions.js +0 -4
- package/dist/esm/msal/browserFlows/msalBrowserOptions.js.map +0 -1
- package/dist/esm/msal/credentials.d.ts +0 -52
- package/dist/esm/msal/credentials.d.ts.map +0 -1
- package/dist/esm/msal/credentials.js +0 -4
- package/dist/esm/msal/credentials.js.map +0 -1
- package/dist/esm/util/authHostEnv-browser.d.mts +0 -4
- package/dist/esm/util/authHostEnv-browser.d.mts.map +0 -1
- package/dist/esm/util/authHostEnv-browser.mjs +0 -7
- package/dist/esm/util/authHostEnv-browser.mjs.map +0 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js +0 -4
- package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +0 -261
- package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +0 -1
- package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
- package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
- package/dist/workerd/msal/browserFlows/msalBrowserOptions.js +0 -4
- package/dist/workerd/msal/browserFlows/msalBrowserOptions.js.map +0 -1
- package/dist/workerd/msal/credentials.d.ts +0 -52
- package/dist/workerd/msal/credentials.d.ts.map +0 -1
- package/dist/workerd/msal/credentials.js +0 -4
- package/dist/workerd/msal/credentials.js.map +0 -1
- package/dist/workerd/util/authHostEnv-browser.d.mts +0 -4
- package/dist/workerd/util/authHostEnv-browser.d.mts.map +0 -1
- package/dist/workerd/util/authHostEnv-browser.mjs +0 -7
- package/dist/workerd/util/authHostEnv-browser.mjs.map +0 -1
- /package/dist/browser/credentials/{clientSecretCredential.d.ts → clientSecretCredential-browser.d.mts} +0 -0
- /package/dist/browser/credentials/{clientSecretCredential.js → clientSecretCredential-browser.mjs} +0 -0
- /package/dist/browser/credentials/{interactiveBrowserCredential.d.ts → interactiveBrowserCredential-browser.d.mts} +0 -0
- /package/dist/browser/credentials/{interactiveBrowserCredential.js → interactiveBrowserCredential-browser.mjs} +0 -0
- /package/dist/browser/credentials/{usernamePasswordCredential.d.ts → usernamePasswordCredential-browser.d.mts} +0 -0
- /package/dist/browser/credentials/{usernamePasswordCredential.js → usernamePasswordCredential-browser.mjs} +0 -0
- /package/dist/browser/plugins/{consumer.d.ts → consumer-browser.d.mts} +0 -0
- /package/dist/browser/plugins/{consumer.js → consumer-browser.mjs} +0 -0
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var imdsMsi_exports = {};
|
|
19
|
+
__export(imdsMsi_exports, {
|
|
20
|
+
imdsMsi: () => imdsMsi
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(imdsMsi_exports);
|
|
23
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
24
|
+
var import_core_util = require("@azure/core-util");
|
|
25
|
+
var import_logging = require("../../util/logging.js");
|
|
26
|
+
var import_utils = require("./utils.js");
|
|
27
|
+
var import_tracing = require("../../util/tracing.js");
|
|
11
28
|
const msiName = "ManagedIdentityCredential - IMDS";
|
|
12
|
-
const logger = (0,
|
|
29
|
+
const logger = (0, import_logging.credentialLogger)(msiName);
|
|
13
30
|
const imdsHost = "http://169.254.169.254";
|
|
14
31
|
const imdsEndpointPath = "/metadata/identity/oauth2/token";
|
|
15
|
-
/**
|
|
16
|
-
* Generates an invalid request options to get a response quickly from IMDS endpoint.
|
|
17
|
-
* The response indicates the availability of IMSD service; otherwise the request would time out.
|
|
18
|
-
*/
|
|
19
32
|
function prepareInvalidRequestOptions(scopes) {
|
|
20
|
-
|
|
33
|
+
const resource = (0, import_utils.mapScopesToResource)(scopes);
|
|
34
|
+
if (!resource) {
|
|
35
|
+
throw new Error(`${msiName}: Multiple scopes are not supported.`);
|
|
36
|
+
}
|
|
37
|
+
const url = new URL(imdsEndpointPath, process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST ?? imdsHost);
|
|
38
|
+
const rawHeaders = {
|
|
39
|
+
Accept: "application/json"
|
|
40
|
+
// intentionally leave out the Metadata header to invoke an error from IMDS endpoint.
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
// intentionally not including any query
|
|
44
|
+
url: `${url}`,
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: (0, import_core_rest_pipeline.createHttpHeaders)(rawHeaders)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const imdsMsi = {
|
|
50
|
+
name: "imdsMsi",
|
|
51
|
+
async isAvailable(options) {
|
|
52
|
+
const { scopes, identityClient, getTokenOptions } = options;
|
|
53
|
+
const resource = (0, import_utils.mapScopesToResource)(scopes);
|
|
21
54
|
if (!resource) {
|
|
22
|
-
|
|
55
|
+
logger.info(`${msiName}: Unavailable. Multiple scopes are not supported.`);
|
|
56
|
+
return false;
|
|
23
57
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
logger.info(`${msiName}: Unavailable. Multiple scopes are not supported.`);
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
// if the PodIdentityEndpoint environment variable was set no need to probe the endpoint, it can be assumed to exist
|
|
53
|
-
if (process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST) {
|
|
54
|
-
return true;
|
|
58
|
+
if (process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (!identityClient) {
|
|
62
|
+
throw new Error("Missing IdentityClient");
|
|
63
|
+
}
|
|
64
|
+
const requestOptions = prepareInvalidRequestOptions(resource);
|
|
65
|
+
return import_tracing.tracingClient.withSpan(
|
|
66
|
+
"ManagedIdentityCredential-pingImdsEndpoint",
|
|
67
|
+
getTokenOptions ?? {},
|
|
68
|
+
async (updatedOptions) => {
|
|
69
|
+
requestOptions.tracingOptions = updatedOptions.tracingOptions;
|
|
70
|
+
const request = (0, import_core_rest_pipeline.createPipelineRequest)(requestOptions);
|
|
71
|
+
request.timeout = updatedOptions.requestOptions?.timeout || 1e3;
|
|
72
|
+
request.allowInsecureConnection = true;
|
|
73
|
+
let response;
|
|
74
|
+
try {
|
|
75
|
+
logger.info(`${msiName}: Pinging the Azure IMDS endpoint`);
|
|
76
|
+
response = await identityClient.sendRequest(request);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if ((0, import_core_util.isError)(err)) {
|
|
79
|
+
logger.verbose(`${msiName}: Caught error ${err.name}: ${err.message}`);
|
|
80
|
+
}
|
|
81
|
+
logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
|
|
82
|
+
return false;
|
|
55
83
|
}
|
|
56
|
-
if (
|
|
57
|
-
|
|
84
|
+
if (response.status === 403) {
|
|
85
|
+
if (response.bodyAsText?.includes("unreachable")) {
|
|
86
|
+
logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
|
|
87
|
+
logger.info(`${msiName}: ${response.bodyAsText}`);
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
58
90
|
}
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// returned quickly from the endpoint, proving its availability.
|
|
65
|
-
const request = (0, core_rest_pipeline_1.createPipelineRequest)(requestOptions);
|
|
66
|
-
// Default to 1000 if the default of 0 is used.
|
|
67
|
-
// Negative values can still be used to disable the timeout.
|
|
68
|
-
request.timeout = updatedOptions.requestOptions?.timeout || 1000;
|
|
69
|
-
// This MSI uses the imdsEndpoint to get the token, which only uses http://
|
|
70
|
-
request.allowInsecureConnection = true;
|
|
71
|
-
let response;
|
|
72
|
-
try {
|
|
73
|
-
logger.info(`${msiName}: Pinging the Azure IMDS endpoint`);
|
|
74
|
-
response = await identityClient.sendRequest(request);
|
|
75
|
-
}
|
|
76
|
-
catch (err) {
|
|
77
|
-
// If the request failed, or Node.js was unable to establish a connection,
|
|
78
|
-
// or the host was down, we'll assume the IMDS endpoint isn't available.
|
|
79
|
-
if ((0, core_util_1.isError)(err)) {
|
|
80
|
-
logger.verbose(`${msiName}: Caught error ${err.name}: ${err.message}`);
|
|
81
|
-
}
|
|
82
|
-
// This is a special case for Docker Desktop which responds with a 403 with a message that contains "A socket operation was attempted to an unreachable network" or "A socket operation was attempted to an unreachable host"
|
|
83
|
-
// rather than just timing out, as expected.
|
|
84
|
-
logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
if (response.status === 403) {
|
|
88
|
-
if (response.bodyAsText?.includes("unreachable")) {
|
|
89
|
-
logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
|
|
90
|
-
logger.info(`${msiName}: ${response.bodyAsText}`);
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// If we received any response, the endpoint is available
|
|
95
|
-
logger.info(`${msiName}: The Azure IMDS endpoint is available`);
|
|
96
|
-
return true;
|
|
97
|
-
});
|
|
98
|
-
},
|
|
91
|
+
logger.info(`${msiName}: The Azure IMDS endpoint is available`);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
99
96
|
};
|
|
100
|
-
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
imdsMsi
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=imdsMsi.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/credentials/managedIdentityCredential/imdsMsi.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineRequestOptions, PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { createHttpHeaders, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { isError } from \"@azure/core-util\";\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { credentialLogger } from \"../../util/logging.js\";\nimport { mapScopesToResource } from \"./utils.js\";\nimport { tracingClient } from \"../../util/tracing.js\";\nimport type { IdentityClient } from \"../../client/identityClient.js\";\n\nconst msiName = \"ManagedIdentityCredential - IMDS\";\nconst logger = credentialLogger(msiName);\n\nconst imdsHost = \"http://169.254.169.254\";\nconst imdsEndpointPath = \"/metadata/identity/oauth2/token\";\n\n/**\n * Generates an invalid request options to get a response quickly from IMDS endpoint.\n * The response indicates the availability of IMSD service; otherwise the request would time out.\n */\nfunction prepareInvalidRequestOptions(scopes: string | string[]): PipelineRequestOptions {\n const resource = mapScopesToResource(scopes);\n if (!resource) {\n throw new Error(`${msiName}: Multiple scopes are not supported.`);\n }\n\n // Pod Identity will try to process this request even if the Metadata header is missing.\n // We can exclude the request query to ensure no IMDS endpoint tries to process the ping request.\n const url = new URL(imdsEndpointPath, process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST ?? imdsHost);\n\n const rawHeaders: Record<string, string> = {\n Accept: \"application/json\",\n // intentionally leave out the Metadata header to invoke an error from IMDS endpoint.\n };\n\n return {\n // intentionally not including any query\n url: `${url}`,\n method: \"GET\",\n headers: createHttpHeaders(rawHeaders),\n };\n}\n\n/**\n * Defines how to determine whether the Azure IMDS MSI is available.\n *\n * Actually getting the token once we determine IMDS is available is handled by MSAL.\n */\nexport const imdsMsi = {\n name: \"imdsMsi\",\n async isAvailable(options: {\n scopes: string | string[];\n identityClient?: IdentityClient;\n clientId?: string;\n resourceId?: string;\n getTokenOptions?: GetTokenOptions;\n }): Promise<boolean> {\n const { scopes, identityClient, getTokenOptions } = options;\n const resource = mapScopesToResource(scopes);\n if (!resource) {\n logger.info(`${msiName}: Unavailable. Multiple scopes are not supported.`);\n return false;\n }\n\n // if the PodIdentityEndpoint environment variable was set no need to probe the endpoint, it can be assumed to exist\n if (process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST) {\n return true;\n }\n\n if (!identityClient) {\n throw new Error(\"Missing IdentityClient\");\n }\n\n const requestOptions = prepareInvalidRequestOptions(resource);\n\n return tracingClient.withSpan(\n \"ManagedIdentityCredential-pingImdsEndpoint\",\n getTokenOptions ?? {},\n async (updatedOptions) => {\n requestOptions.tracingOptions = updatedOptions.tracingOptions;\n\n // Create a request with a timeout since we expect that\n // not having a \"Metadata\" header should cause an error to be\n // returned quickly from the endpoint, proving its availability.\n const request = createPipelineRequest(requestOptions);\n\n // Default to 1000 if the default of 0 is used.\n // Negative values can still be used to disable the timeout.\n request.timeout = updatedOptions.requestOptions?.timeout || 1000;\n\n // This MSI uses the imdsEndpoint to get the token, which only uses http://\n request.allowInsecureConnection = true;\n let response: PipelineResponse;\n try {\n logger.info(`${msiName}: Pinging the Azure IMDS endpoint`);\n response = await identityClient.sendRequest(request);\n } catch (err: unknown) {\n // If the request failed, or Node.js was unable to establish a connection,\n // or the host was down, we'll assume the IMDS endpoint isn't available.\n if (isError(err)) {\n logger.verbose(`${msiName}: Caught error ${err.name}: ${err.message}`);\n }\n // This is a special case for Docker Desktop which responds with a 403 with a message that contains \"A socket operation was attempted to an unreachable network\" or \"A socket operation was attempted to an unreachable host\"\n // rather than just timing out, as expected.\n logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);\n return false;\n }\n if (response.status === 403) {\n if (response.bodyAsText?.includes(\"unreachable\")) {\n logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);\n logger.info(`${msiName}: ${response.bodyAsText}`);\n return false;\n }\n }\n // If we received any response, the endpoint is available\n logger.info(`${msiName}: The Azure IMDS endpoint is available`);\n return true;\n },\n );\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,gCAAyD;AACzD,uBAAwB;AAGxB,qBAAiC;AACjC,mBAAoC;AACpC,qBAA8B;AAG9B,MAAM,UAAU;AAChB,MAAM,aAAS,iCAAiB,OAAO;AAEvC,MAAM,WAAW;AACjB,MAAM,mBAAmB;AAMzB,SAAS,6BAA6B,QAAmD;AACvF,QAAM,eAAW,kCAAoB,MAAM;AAC3C,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,GAAG,OAAO,sCAAsC;AAAA,EAClE;AAIA,QAAM,MAAM,IAAI,IAAI,kBAAkB,QAAQ,IAAI,qCAAqC,QAAQ;AAE/F,QAAM,aAAqC;AAAA,IACzC,QAAQ;AAAA;AAAA,EAEV;AAEA,SAAO;AAAA;AAAA,IAEL,KAAK,GAAG,GAAG;AAAA,IACX,QAAQ;AAAA,IACR,aAAS,6CAAkB,UAAU;AAAA,EACvC;AACF;AAOO,MAAM,UAAU;AAAA,EACrB,MAAM;AAAA,EACN,MAAM,YAAY,SAMG;AACnB,UAAM,EAAE,QAAQ,gBAAgB,gBAAgB,IAAI;AACpD,UAAM,eAAW,kCAAoB,MAAM;AAC3C,QAAI,CAAC,UAAU;AACb,aAAO,KAAK,GAAG,OAAO,mDAAmD;AACzE,aAAO;AAAA,IACT;AAGA,QAAI,QAAQ,IAAI,mCAAmC;AACjD,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,gBAAgB;AACnB,YAAM,IAAI,MAAM,wBAAwB;AAAA,IAC1C;AAEA,UAAM,iBAAiB,6BAA6B,QAAQ;AAE5D,WAAO,6BAAc;AAAA,MACnB;AAAA,MACA,mBAAmB,CAAC;AAAA,MACpB,OAAO,mBAAmB;AACxB,uBAAe,iBAAiB,eAAe;AAK/C,cAAM,cAAU,iDAAsB,cAAc;AAIpD,gBAAQ,UAAU,eAAe,gBAAgB,WAAW;AAG5D,gBAAQ,0BAA0B;AAClC,YAAI;AACJ,YAAI;AACF,iBAAO,KAAK,GAAG,OAAO,mCAAmC;AACzD,qBAAW,MAAM,eAAe,YAAY,OAAO;AAAA,QACrD,SAAS,KAAc;AAGrB,kBAAI,0BAAQ,GAAG,GAAG;AAChB,mBAAO,QAAQ,GAAG,OAAO,kBAAkB,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,UACvE;AAGA,iBAAO,KAAK,GAAG,OAAO,0CAA0C;AAChE,iBAAO;AAAA,QACT;AACA,YAAI,SAAS,WAAW,KAAK;AAC3B,cAAI,SAAS,YAAY,SAAS,aAAa,GAAG;AAChD,mBAAO,KAAK,GAAG,OAAO,0CAA0C;AAChE,mBAAO,KAAK,GAAG,OAAO,KAAK,SAAS,UAAU,EAAE;AAChD,mBAAO;AAAA,UACT;AAAA,QACF;AAEA,eAAO,KAAK,GAAG,OAAO,wCAAwC;AAC9D,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,46 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var imdsRetryPolicy_exports = {};
|
|
19
|
+
__export(imdsRetryPolicy_exports, {
|
|
20
|
+
imdsRetryPolicy: () => imdsRetryPolicy
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(imdsRetryPolicy_exports);
|
|
23
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
24
|
+
var import_core_util = require("@azure/core-util");
|
|
25
|
+
const DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64;
|
|
26
|
+
const MIN_DELAY_FOR_410_MS = 3e3;
|
|
24
27
|
function imdsRetryPolicy(msiRetryConfig) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
return (0, import_core_rest_pipeline.retryPolicy)(
|
|
29
|
+
[
|
|
30
|
+
{
|
|
31
|
+
name: "imdsRetryPolicy",
|
|
32
|
+
retry: ({ retryCount, response }) => {
|
|
33
|
+
if (response?.status !== 404 && response?.status !== 410) {
|
|
34
|
+
return { skipStrategy: true };
|
|
35
|
+
}
|
|
36
|
+
const initialDelayMs = response?.status === 410 ? Math.max(MIN_DELAY_FOR_410_MS, msiRetryConfig.startDelayInMs) : msiRetryConfig.startDelayInMs;
|
|
37
|
+
return (0, import_core_util.calculateRetryDelay)(retryCount, {
|
|
38
|
+
retryDelayInMs: initialDelayMs,
|
|
39
|
+
maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
maxRetries: msiRetryConfig.maxRetries
|
|
46
|
+
}
|
|
47
|
+
);
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
imdsRetryPolicy
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=imdsRetryPolicy.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/credentials/managedIdentityCredential/imdsRetryPolicy.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"@azure/core-rest-pipeline\";\nimport { retryPolicy } from \"@azure/core-rest-pipeline\";\n\nimport type { MSIConfiguration } from \"./models.js\";\nimport { calculateRetryDelay } from \"@azure/core-util\";\n\n// Matches the default retry configuration in expontentialRetryStrategy.ts\nconst DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;\n\n// For 410 responses, we need at least 70 seconds total retry duration\n// With 5 retries using exponential backoff: delays of d, 2d, 4d, 8d, 16d sum to 31d\n// Accounting for jitter (which can reduce delays by 20%), we need 31d * 0.8 >= 70\n// So we need d >= 70/24.8 = 2.82 seconds. Using 3 seconds to be safe.\nconst MIN_DELAY_FOR_410_MS = 3000;\n\n/**\n * An additional policy that retries on 404 and 410 errors. The default retry policy does not retry on\n * 404s or 410s, but the IMDS endpoint can return these when the token is not yet available or when\n * the identity is still being set up. This policy will retry on 404s and 410s with an exponential backoff.\n * For 410 responses, it uses a minimum 3-second initial delay to ensure at least 70 seconds total duration.\n *\n * @param msiRetryConfig - The retry configuration for the MSI credential.\n * @returns - The policy that will retry on 404s and 410s.\n */\nexport function imdsRetryPolicy(msiRetryConfig: MSIConfiguration[\"retryConfig\"]): PipelinePolicy {\n return retryPolicy(\n [\n {\n name: \"imdsRetryPolicy\",\n retry: ({ retryCount, response }) => {\n if (response?.status !== 404 && response?.status !== 410) {\n return { skipStrategy: true };\n }\n\n // For 410 responses, use a minimum 3-second delay to ensure at least 70 seconds total retry duration\n const initialDelayMs =\n response?.status === 410\n ? Math.max(MIN_DELAY_FOR_410_MS, msiRetryConfig.startDelayInMs)\n : msiRetryConfig.startDelayInMs;\n\n return calculateRetryDelay(retryCount, {\n retryDelayInMs: initialDelayMs,\n maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL,\n });\n },\n },\n ],\n {\n maxRetries: msiRetryConfig.maxRetries,\n },\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,gCAA4B;AAG5B,uBAAoC;AAGpC,MAAM,oCAAoC,MAAO;AAMjD,MAAM,uBAAuB;AAWtB,SAAS,gBAAgB,gBAAiE;AAC/F,aAAO;AAAA,IACL;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,OAAO,CAAC,EAAE,YAAY,SAAS,MAAM;AACnC,cAAI,UAAU,WAAW,OAAO,UAAU,WAAW,KAAK;AACxD,mBAAO,EAAE,cAAc,KAAK;AAAA,UAC9B;AAGA,gBAAM,iBACJ,UAAU,WAAW,MACjB,KAAK,IAAI,sBAAsB,eAAe,cAAc,IAC5D,eAAe;AAErB,qBAAO,sCAAoB,YAAY;AAAA,YACrC,gBAAgB;AAAA,YAChB,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,YAAY,eAAe;AAAA,IAC7B;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|