@microsoft/vscode-azext-azureauth 4.2.1 → 4.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.2.2 - 2025-09-10
4
+
5
+ * [#2073](https://github.com/microsoft/vscode-azuretools/pull/2073) Changes to adjust to proposed API changes
6
+
3
7
  ## 4.2.1 - 2025-08-27
4
8
 
5
9
  * [#2068](https://github.com/microsoft/vscode-azuretools/pull/2068) Changes to adjust to proposed API changes
@@ -17,5 +17,5 @@ export interface AzureAuthentication {
17
17
  *
18
18
  * @returns A VS Code authentication session or undefined, if none could be obtained.
19
19
  */
20
- getSessionWithScopes(scopes: string[] | vscode.AuthenticationWWWAuthenticateRequest): vscode.ProviderResult<vscode.AuthenticationSession>;
20
+ getSessionWithScopes(scopes: string[] | vscode.AuthenticationWwwAuthenticateRequest): vscode.ProviderResult<vscode.AuthenticationSession>;
21
21
  }
@@ -25,7 +25,7 @@ const vscode = require("vscode");
25
25
  const getSessionFromVSCode_1 = require("./getSessionFromVSCode");
26
26
  const NotSignedInError_1 = require("./NotSignedInError");
27
27
  const configuredAzureEnv_1 = require("./utils/configuredAzureEnv");
28
- const isAuthenticationWWWAuthenticateRequest_1 = require("./utils/isAuthenticationWWWAuthenticateRequest");
28
+ const isAuthenticationWwwAuthenticateRequest_1 = require("./utils/isAuthenticationWwwAuthenticateRequest");
29
29
  const EventDebounce = 5 * 1000; // 5 seconds
30
30
  /**
31
31
  * A class for obtaining Azure subscription information using VSCode's built-in authentication
@@ -373,7 +373,7 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
373
373
  // in order to handle a challenge, we must enable createIfNone so
374
374
  // that we can prompt the user to step-up their session with MFA
375
375
  // otherwise, never prompt the user
376
- return (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, Object.assign(Object.assign({}, ((0, isAuthenticationWWWAuthenticateRequest_1.isAuthenticationWWWAuthenticateRequest)(scopes) ? { createIfNone: true } : { silent: true })), { account }));
376
+ return (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, Object.assign(Object.assign({}, ((0, isAuthenticationWwwAuthenticateRequest_1.isAuthenticationWwwAuthenticateRequest)(scopes) ? { createIfNone: true } : { silent: true })), { account }));
377
377
  },
378
378
  }
379
379
  };
@@ -5,9 +5,9 @@ import * as vscode from "vscode";
5
5
  * * Getting the list of scopes, adding the tenant id to the scope list if needed
6
6
  *
7
7
  * @param scopes - top-level resource scopes (e.g. http://management.azure.com, http://storage.azure.com) or .default scopes. All resources/scopes will be normalized to the `.default` scope for each resource.
8
- * Use `vscode.AuthenticationWWWAuthenticateRequest` if you need to pass in a challenge (WWW-Authenticate header). Note: Use of `vscode.AuthenticationWWWAuthenticateRequest` requires VS Code 1.104 or newer.
8
+ * Use `vscode.AuthenticationWwwAuthenticateRequest` if you need to pass in a challenge (WWW-Authenticate header). Note: Use of `vscode.AuthenticationWwwAuthenticateRequest` requires VS Code 1.104 or newer.
9
9
  * @param tenantId - (Optional) The tenant ID, will be added to the scopes
10
10
  * @param options - see {@link vscode.AuthenticationGetSessionOptions}
11
11
  * @returns An authentication session if available, or undefined if there are no sessions
12
12
  */
13
- export declare function getSessionFromVSCode(scopes?: string | string[] | vscode.AuthenticationWWWAuthenticateRequest, tenantId?: string, options?: vscode.AuthenticationGetSessionOptions): Promise<vscode.AuthenticationSession | undefined>;
13
+ export declare function getSessionFromVSCode(scopes?: string | string[] | vscode.AuthenticationWwwAuthenticateRequest, tenantId?: string, options?: vscode.AuthenticationGetSessionOptions): Promise<vscode.AuthenticationSession | undefined>;
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.getSessionFromVSCode = getSessionFromVSCode;
17
17
  const vscode = require("vscode");
18
18
  const configuredAzureEnv_1 = require("./utils/configuredAzureEnv");
19
- const isAuthenticationWWWAuthenticateRequest_1 = require("./utils/isAuthenticationWWWAuthenticateRequest");
19
+ const isAuthenticationWwwAuthenticateRequest_1 = require("./utils/isAuthenticationWwwAuthenticateRequest");
20
20
  function ensureEndingSlash(value) {
21
21
  return value.endsWith('/') ? value : `${value}/`;
22
22
  }
@@ -52,10 +52,10 @@ function getScopes(scopes, tenantId) {
52
52
  * And then returns the proper type to pass directly to vscode.authentication.getSession
53
53
  */
54
54
  function formScopesArg(scopes, tenantId) {
55
- var _a, _b, _c;
56
- const initialScopeList = typeof scopes === 'string' ? [scopes] : Array.isArray(scopes) ? scopes : Array.from((_a = scopes === null || scopes === void 0 ? void 0 : scopes.scopes) !== null && _a !== void 0 ? _a : []);
55
+ var _a, _b, _c, _d;
56
+ const initialScopeList = typeof scopes === 'string' ? [scopes] : Array.isArray(scopes) ? scopes : Array.from((_b = (_a = scopes === null || scopes === void 0 ? void 0 : scopes.fallbackScopes) !== null && _a !== void 0 ? _a : scopes === null || scopes === void 0 ? void 0 : scopes.scopes) !== null && _b !== void 0 ? _b : []);
57
57
  const scopeList = getScopes(initialScopeList, tenantId);
58
- return (0, isAuthenticationWWWAuthenticateRequest_1.isAuthenticationWWWAuthenticateRequest)(scopes) ? { scopes: scopeList, challenge: (_b = scopes.wwwAuthenticate) !== null && _b !== void 0 ? _b : scopes.challenge, wwwAuthenticate: (_c = scopes.wwwAuthenticate) !== null && _c !== void 0 ? _c : scopes.challenge } : scopeList;
58
+ return (0, isAuthenticationWwwAuthenticateRequest_1.isAuthenticationWwwAuthenticateRequest)(scopes) ? { scopes: scopeList, fallbackScopes: scopeList, challenge: (_c = scopes.wwwAuthenticate) !== null && _c !== void 0 ? _c : scopes.challenge, wwwAuthenticate: (_d = scopes.wwwAuthenticate) !== null && _d !== void 0 ? _d : scopes.challenge } : scopeList;
59
59
  }
60
60
  /**
61
61
  * Wraps {@link vscode.authentication.getSession} and handles:
@@ -63,7 +63,7 @@ function formScopesArg(scopes, tenantId) {
63
63
  * * Getting the list of scopes, adding the tenant id to the scope list if needed
64
64
  *
65
65
  * @param scopes - top-level resource scopes (e.g. http://management.azure.com, http://storage.azure.com) or .default scopes. All resources/scopes will be normalized to the `.default` scope for each resource.
66
- * Use `vscode.AuthenticationWWWAuthenticateRequest` if you need to pass in a challenge (WWW-Authenticate header). Note: Use of `vscode.AuthenticationWWWAuthenticateRequest` requires VS Code 1.104 or newer.
66
+ * Use `vscode.AuthenticationWwwAuthenticateRequest` if you need to pass in a challenge (WWW-Authenticate header). Note: Use of `vscode.AuthenticationWwwAuthenticateRequest` requires VS Code 1.104 or newer.
67
67
  * @param tenantId - (Optional) The tenant ID, will be added to the scopes
68
68
  * @param options - see {@link vscode.AuthenticationGetSessionOptions}
69
69
  * @returns An authentication session if available, or undefined if there are no sessions
@@ -0,0 +1,2 @@
1
+ import type * as vscode from "vscode";
2
+ export declare function isAuthenticationWwwAuthenticateRequest(obj: unknown): obj is vscode.AuthenticationWwwAuthenticateRequest;
@@ -4,12 +4,12 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isAuthenticationWWWAuthenticateRequest = isAuthenticationWWWAuthenticateRequest;
8
- // Copied straight from https://github.com/microsoft/vscode/blob/f3be94030f494dea887b53358a5e21ed9b4607e5/src/vs/workbench/services/authentication/common/authentication.ts#L80-L85
9
- function isAuthenticationWWWAuthenticateRequest(obj) {
7
+ exports.isAuthenticationWwwAuthenticateRequest = isAuthenticationWwwAuthenticateRequest;
8
+ // Copied straight from https://github.com/microsoft/vscode/blob/32a309c4eceb1df1252215e36766ffb7e4e5afb3/src/vs/workbench/services/authentication/common/authentication.ts#L80-L85
9
+ function isAuthenticationWwwAuthenticateRequest(obj) {
10
10
  return typeof obj === 'object'
11
11
  && obj !== null
12
12
  && 'wwwAuthenticate' in obj
13
13
  && (typeof obj.wwwAuthenticate === 'string');
14
14
  }
15
- //# sourceMappingURL=isAuthenticationWWWAuthenticateRequest.js.map
15
+ //# sourceMappingURL=isAuthenticationWwwAuthenticateRequest.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/vscode-azext-azureauth",
3
3
  "author": "Microsoft Corporation",
4
- "version": "4.2.1",
4
+ "version": "4.2.2",
5
5
  "description": "Azure authentication helpers for Visual Studio Code",
6
6
  "tags": [
7
7
  "azure",
@@ -1,2 +0,0 @@
1
- import type * as vscode from "vscode";
2
- export declare function isAuthenticationWWWAuthenticateRequest(obj: unknown): obj is vscode.AuthenticationWWWAuthenticateRequest;