Files
cloud-code/claude-code-source/node_modules/@azure/identity/dist/esm/plugins/consumer.js
janlaywss a192e187e8 fix: keep only source-map extracted node_modules, exclude pnpm artifacts
Restore node_modules to exact state from cli.js.map extraction:
- Move .ignored/ and .ignored_* files back to original package paths
- Remove pnpm symlinks (replaced by real source-map directories)
- Update .gitignore: only exclude /dist/, .pnpm/, .bin/, .ignored* dirs
- All package dist/ folders are now preserved as part of source-map files

After clone, run `pnpm install` to get pnpm-managed symlinks for building.
The committed node_modules contains the original TypeScript/JS source files
as bundled in cli.js.
2026-03-31 21:09:32 +08:00

43 lines
1.5 KiB
JavaScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { msalNodeFlowCacheControl, msalNodeFlowNativeBrokerControl, } from "../msal/nodeFlows/msalPlugins.js";
import { vsCodeCredentialControl } from "../credentials/visualStudioCodeCredential.js";
/**
* The context passed to an Identity plugin. This contains objects that
* plugins can use to set backend implementations.
* @internal
*/
const pluginContext = {
cachePluginControl: msalNodeFlowCacheControl,
nativeBrokerPluginControl: msalNodeFlowNativeBrokerControl,
vsCodeCredentialControl: vsCodeCredentialControl,
};
/**
* Extend Azure Identity with additional functionality. Pass a plugin from
* a plugin package, such as:
*
* - `@azure/identity-cache-persistence`: provides persistent token caching
* - `@azure/identity-vscode`: provides the dependencies of
* `VisualStudioCodeCredential` and enables it
*
* Example:
*
* ```ts snippet:consumer_example
* import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
*
* useIdentityPlugin(cachePersistencePlugin);
* // The plugin has the capability to extend `DeviceCodeCredential` and to
* // add middleware to the underlying credentials, such as persistence.
* const credential = new DeviceCodeCredential({
* tokenCachePersistenceOptions: {
* enabled: true,
* },
* });
* ```
*
* @param plugin - the plugin to register
*/
export function useIdentityPlugin(plugin) {
plugin(pluginContext);
}
//# sourceMappingURL=consumer.js.map