@azure/identity 2.0.3-alpha.20220210.1 → 2.0.3-alpha.20220211.2

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.

Potentially problematic release.


This version of @azure/identity might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -1,9 +1,23 @@
1
1
  # Release History
2
2
 
3
+ ## 2.1.0-beta.1 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ - Added log warning for non-support of user assigned identity in Managed Identity credentials in Cloud Shell environments
8
+
9
+ ### Breaking Changes
10
+
11
+ ### Bugs Fixed
12
+
13
+ ### Other Changes
14
+
3
15
  ## 2.0.3 (Unreleased)
4
16
 
5
17
  ### Features Added
6
18
 
19
+ - Added log warning for non-support of user assigned identity in Managed Identity credentials in Cloud Shell environments
20
+
7
21
  ### Breaking Changes
8
22
 
9
23
  ### Bugs Fixed
package/dist/index.js CHANGED
@@ -318,10 +318,14 @@ function credentialLoggerInstance(title, parent, log = logger$j) {
318
318
  function info(message) {
319
319
  log.info(`${fullTitle} =>`, message);
320
320
  }
321
+ function warning(message) {
322
+ log.warning(`${fullTitle} =>`, message);
323
+ }
321
324
  return {
322
325
  title,
323
326
  fullTitle,
324
327
  info,
328
+ warning,
325
329
  };
326
330
  }
327
331
  /**
@@ -2292,6 +2296,7 @@ function prepareRequestOptions$4(scopes, clientId) {
2292
2296
  }
2293
2297
  /**
2294
2298
  * Defines how to determine whether the Azure Cloud Shell MSI is available, and also how to retrieve a token from the Azure Cloud Shell MSI.
2299
+ * Since Azure Managed Identities aren't available in the Azure Cloud Shell, we log a warning for users that try to access cloud shell using user assigned identity.
2295
2300
  */
2296
2301
  const cloudShellMsi = {
2297
2302
  async isAvailable(scopes) {
@@ -2308,6 +2313,9 @@ const cloudShellMsi = {
2308
2313
  },
2309
2314
  async getToken(configuration, getTokenOptions = {}) {
2310
2315
  const { identityClient, scopes, clientId } = configuration;
2316
+ if (clientId) {
2317
+ logger$9.warning(`${msiName$4}: does not support user-assigned identities in the Cloud Shell environment. Argument clientId will be ignored.`);
2318
+ }
2311
2319
  logger$9.info(`${msiName$4}: Using the endpoint coming form the environment variable MSI_ENDPOINT = ${process.env.MSI_ENDPOINT}.`);
2312
2320
  const request = coreRestPipeline.createPipelineRequest(Object.assign(Object.assign({ abortSignal: getTokenOptions.abortSignal }, prepareRequestOptions$4(scopes, clientId)), {
2313
2321
  // Generally, MSI endpoints use the HTTP protocol, without transport layer security (TLS).