Socket
Socket
Sign inDemoInstall

@azure/msal-node

Package Overview
Dependencies
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-node - npm Package Compare versions

Comparing version 2.8.1 to 2.9.0

9

dist/client/ManagedIdentityApplication.d.ts
import { AuthenticationResult } from "@azure/msal-common";
import { ManagedIdentityConfiguration } from "../config/Configuration";
import { ManagedIdentityRequestParams } from "../request/ManagedIdentityRequestParams";
import { ManagedIdentitySourceNames } from "../utils/Constants";
/**
* Class to initialize a managed identity and identify the service
* @public
*/

@@ -19,7 +21,12 @@ export declare class ManagedIdentityApplication {

* Acquire an access token from the cache or the managed identity
* @param managedIdentityRequest
* @param managedIdentityRequest - the ManagedIdentityRequestParams object passed in by the developer
* @returns the access token
*/
acquireToken(managedIdentityRequestParams: ManagedIdentityRequestParams): Promise<AuthenticationResult>;
/**
* Determine the Managed Identity Source based on available environment variables. This API is consumed by Azure Identity SDK.
* @returns ManagedIdentitySourceNames - The Managed Identity source's name
*/
getManagedIdentitySource(): ManagedIdentitySourceNames;
}
//# sourceMappingURL=ManagedIdentityApplication.d.ts.map

@@ -6,2 +6,3 @@ import { Authority, INetworkModule, Logger, AuthenticationResult } from "@azure/msal-common";

import { NodeStorage } from "../cache/NodeStorage";
import { ManagedIdentitySourceNames } from "../utils/Constants";
export declare class ManagedIdentityClient {

@@ -13,5 +14,12 @@ private logger;

private static identitySource?;
static sourceName?: ManagedIdentitySourceNames;
constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider);
sendManagedIdentityTokenRequest(managedIdentityRequest: ManagedIdentityRequest, managedIdentityId: ManagedIdentityId, fakeAuthority: Authority, refreshAccessToken?: boolean): Promise<AuthenticationResult>;
private allEnvironmentVariablesAreDefined;
/**
* Determine the Managed Identity Source based on available environment variables. This API is consumed by ManagedIdentityApplication's getManagedIdentitySource.
* @returns ManagedIdentitySourceNames - The Managed Identity source's name
*/
getManagedIdentitySource(): ManagedIdentitySourceNames;
/**
* Tries to create a managed identity source for all sources

@@ -18,0 +26,0 @@ * @returns the managed identity Source

@@ -14,2 +14,3 @@ import { INetworkModule, Logger } from "@azure/msal-common";

constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, identityEndpoint: string, identityHeader: string);
static getEnvironmentVariables(): Array<string | undefined>;
static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider): AppService | null;

@@ -16,0 +17,0 @@ createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;

@@ -15,2 +15,3 @@ import { INetworkModule, NetworkResponse, NetworkRequestOptions, Logger, ServerAuthorizationTokenResponse } from "@azure/msal-common";

constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, identityEndpoint: string);
static getEnvironmentVariables(): Array<string | undefined>;
static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, managedIdentityId: ManagedIdentityId): AzureArc | null;

@@ -17,0 +18,0 @@ createRequest(resource: string): ManagedIdentityRequestParameters;

@@ -13,2 +13,3 @@ import { INetworkModule, Logger } from "@azure/msal-common";

constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, msiEndpoint: string);
static getEnvironmentVariables(): Array<string | undefined>;
static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, managedIdentityId: ManagedIdentityId): CloudShell | null;

@@ -15,0 +16,0 @@ createRequest(resource: string): ManagedIdentityRequestParameters;

@@ -14,2 +14,3 @@ import { INetworkModule, Logger } from "@azure/msal-common";

constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, identityEndpoint: string, identityHeader: string);
static getEnvironmentVariables(): Array<string | undefined>;
static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, managedIdentityId: ManagedIdentityId): ServiceFabric | null;

@@ -16,0 +17,0 @@ createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;

@@ -31,2 +31,3 @@ /**

export { DistributedCachePlugin } from "./cache/distributed/DistributedCachePlugin.js";
export { ManagedIdentitySourceNames } from "./utils/Constants.js";
export { CryptoProvider } from "./crypto/CryptoProvider.js";

@@ -33,0 +34,0 @@ export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest.js";

2

dist/packageMetadata.d.ts
export declare const name = "@azure/msal-node";
export declare const version = "2.8.1";
export declare const version = "2.9.0";
//# sourceMappingURL=packageMetadata.d.ts.map

@@ -24,10 +24,16 @@ export declare const AUTHORIZATION_HEADER_NAME: string;

* Managed Identity Source Names
* @public
*/
export declare const ManagedIdentitySourceNames: {
readonly APP_SERVICE: "App Service";
readonly AZURE_ARC: "Azure Arc";
readonly CLOUD_SHELL: "Cloud Shell";
readonly IMDS: "IMDS";
readonly SERVICE_FABRIC: "Service Fabric";
readonly APP_SERVICE: "AppService";
readonly AZURE_ARC: "AzureArc";
readonly CLOUD_SHELL: "CloudShell";
readonly DEFAULT_TO_IMDS: "DefaultToImds";
readonly IMDS: "Imds";
readonly SERVICE_FABRIC: "ServiceFabric";
};
/**
* The ManagedIdentitySourceNames type
* @public
*/
export type ManagedIdentitySourceNames = (typeof ManagedIdentitySourceNames)[keyof typeof ManagedIdentitySourceNames];

@@ -34,0 +40,0 @@ /**

{
"$schema": "https://json.schemastore.org/package.json",
"name": "@azure/msal-node",
"version": "2.8.1",
"version": "2.9.0",
"author": {

@@ -53,3 +53,4 @@ "name": "Microsoft",

"format:check": "prettier --ignore-path .gitignore --check src test",
"format:fix": "prettier --ignore-path .gitignore --write src test"
"format:fix": "prettier --ignore-path .gitignore --write src test",
"apiExtractor": "api-extractor run"
},

@@ -62,3 +63,3 @@ "beachball": {

"devDependencies": {
"@microsoft/api-extractor": "^7.19.4",
"@microsoft/api-extractor": "^7.43.4",
"@rollup/plugin-node-resolve": "^15.0.1",

@@ -65,0 +66,0 @@ "@rollup/plugin-typescript": "^11.0.0",

@@ -34,6 +34,10 @@ /*

import { NodeStorage } from "../cache/NodeStorage";
import { DEFAULT_AUTHORITY_FOR_MANAGED_IDENTITY } from "../utils/Constants";
import {
DEFAULT_AUTHORITY_FOR_MANAGED_IDENTITY,
ManagedIdentitySourceNames,
} from "../utils/Constants";
/**
* Class to initialize a managed identity and identify the service
* @public
*/

@@ -117,3 +121,3 @@ export class ManagedIdentityApplication {

* Acquire an access token from the cache or the managed identity
* @param managedIdentityRequest
* @param managedIdentityRequest - the ManagedIdentityRequestParams object passed in by the developer
* @returns the access token

@@ -188,2 +192,13 @@ */

}
/**
* Determine the Managed Identity Source based on available environment variables. This API is consumed by Azure Identity SDK.
* @returns ManagedIdentitySourceNames - The Managed Identity source's name
*/
public getManagedIdentitySource(): ManagedIdentitySourceNames {
return (
ManagedIdentityClient.sourceName ||
this.managedIdentityClient.getManagedIdentitySource()
);
}
}

@@ -26,2 +26,3 @@ /*

import { BaseManagedIdentitySource } from "./ManagedIdentitySources/BaseManagedIdentitySource";
import { ManagedIdentitySourceNames } from "../utils/Constants";

@@ -39,2 +40,3 @@ /*

private static identitySource?: BaseManagedIdentitySource;
public static sourceName?: ManagedIdentitySourceNames;

@@ -78,3 +80,40 @@ constructor(

private allEnvironmentVariablesAreDefined(
environmentVariables: Array<string | undefined>
): boolean {
return Object.values(environmentVariables).every(
(environmentVariable) => {
return environmentVariable !== undefined;
}
);
}
/**
* Determine the Managed Identity Source based on available environment variables. This API is consumed by ManagedIdentityApplication's getManagedIdentitySource.
* @returns ManagedIdentitySourceNames - The Managed Identity source's name
*/
public getManagedIdentitySource(): ManagedIdentitySourceNames {
ManagedIdentityClient.sourceName =
this.allEnvironmentVariablesAreDefined(
ServiceFabric.getEnvironmentVariables()
)
? ManagedIdentitySourceNames.SERVICE_FABRIC
: this.allEnvironmentVariablesAreDefined(
AppService.getEnvironmentVariables()
)
? ManagedIdentitySourceNames.APP_SERVICE
: this.allEnvironmentVariablesAreDefined(
CloudShell.getEnvironmentVariables()
)
? ManagedIdentitySourceNames.CLOUD_SHELL
: this.allEnvironmentVariablesAreDefined(
AzureArc.getEnvironmentVariables()
)
? ManagedIdentitySourceNames.AZURE_ARC
: ManagedIdentitySourceNames.DEFAULT_TO_IMDS;
return ManagedIdentityClient.sourceName;
}
/**
* Tries to create a managed identity source for all sources

@@ -81,0 +120,0 @@ * @returns the managed identity Source

@@ -46,8 +46,3 @@ /*

public static tryCreate(
logger: Logger,
nodeStorage: NodeStorage,
networkClient: INetworkModule,
cryptoProvider: CryptoProvider
): AppService | null {
public static getEnvironmentVariables(): Array<string | undefined> {
const identityEndpoint: string | undefined =

@@ -62,2 +57,14 @@ process.env[

return [identityEndpoint, identityHeader];
}
public static tryCreate(
logger: Logger,
nodeStorage: NodeStorage,
networkClient: INetworkModule,
cryptoProvider: CryptoProvider
): AppService | null {
const [identityEndpoint, identityHeader] =
AppService.getEnvironmentVariables();
// if either of the identity endpoint or identity header variables are undefined, this MSI provider is unavailable.

@@ -64,0 +71,0 @@ if (!identityEndpoint || !identityHeader) {

@@ -59,2 +59,13 @@ /*

public static getEnvironmentVariables(): Array<string | undefined> {
const identityEndpoint: string | undefined =
process.env[
ManagedIdentityEnvironmentVariableNames.IDENTITY_ENDPOINT
];
const imdsEndpoint: string | undefined =
process.env[ManagedIdentityEnvironmentVariableNames.IMDS_ENDPOINT];
return [identityEndpoint, imdsEndpoint];
}
public static tryCreate(

@@ -67,8 +78,4 @@ logger: Logger,

): AzureArc | null {
const identityEndpoint: string | undefined =
process.env[
ManagedIdentityEnvironmentVariableNames.IDENTITY_ENDPOINT
];
const imdsEndpoint: string | undefined =
process.env[ManagedIdentityEnvironmentVariableNames.IMDS_ENDPOINT];
const [identityEndpoint, imdsEndpoint] =
AzureArc.getEnvironmentVariables();

@@ -75,0 +82,0 @@ // if either of the identity or imds endpoints are undefined, this MSI provider is unavailable.

@@ -43,2 +43,9 @@ /*

public static getEnvironmentVariables(): Array<string | undefined> {
const msiEndpoint: string | undefined =
process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
return [msiEndpoint];
}
public static tryCreate(

@@ -51,4 +58,3 @@ logger: Logger,

): CloudShell | null {
const msiEndpoint: string | undefined =
process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
const [msiEndpoint] = CloudShell.getEnvironmentVariables();

@@ -55,0 +61,0 @@ // if the msi endpoint environment variable is undefined, this MSI provider is unavailable.

@@ -46,9 +46,3 @@ /*

public static tryCreate(
logger: Logger,
nodeStorage: NodeStorage,
networkClient: INetworkModule,
cryptoProvider: CryptoProvider,
managedIdentityId: ManagedIdentityId
): ServiceFabric | null {
public static getEnvironmentVariables(): Array<string | undefined> {
const identityEndpoint: string | undefined =

@@ -68,2 +62,15 @@ process.env[

return [identityEndpoint, identityHeader, identityServerThumbprint];
}
public static tryCreate(
logger: Logger,
nodeStorage: NodeStorage,
networkClient: INetworkModule,
cryptoProvider: CryptoProvider,
managedIdentityId: ManagedIdentityId
): ServiceFabric | null {
const [identityEndpoint, identityHeader, identityServerThumbprint] =
ServiceFabric.getEnvironmentVariables();
/*

@@ -70,0 +77,0 @@ * if either of the identity endpoint, identity header, or identity server thumbprint

@@ -65,2 +65,5 @@ /*

// Constants
export { ManagedIdentitySourceNames } from "./utils/Constants.js";
// Crypto

@@ -67,0 +70,0 @@ export { CryptoProvider } from "./crypto/CryptoProvider.js";

/* eslint-disable header/header */
export const name = "@azure/msal-node";
export const version = "2.8.1";
export const version = "2.9.0";

@@ -35,10 +35,16 @@ /*

* Managed Identity Source Names
* @public
*/
export const ManagedIdentitySourceNames = {
APP_SERVICE: "App Service",
AZURE_ARC: "Azure Arc",
CLOUD_SHELL: "Cloud Shell",
IMDS: "IMDS",
SERVICE_FABRIC: "Service Fabric",
APP_SERVICE: "AppService",
AZURE_ARC: "AzureArc",
CLOUD_SHELL: "CloudShell",
DEFAULT_TO_IMDS: "DefaultToImds",
IMDS: "Imds",
SERVICE_FABRIC: "ServiceFabric",
} as const;
/**
* The ManagedIdentitySourceNames type
* @public
*/
export type ManagedIdentitySourceNames =

@@ -45,0 +51,0 @@ (typeof ManagedIdentitySourceNames)[keyof typeof ManagedIdentitySourceNames];

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc