armpit
Version:
Another resource manager programming interface toolkit.
38 lines • 1.54 kB
TypeScript
import type { TokenCredential } from "@azure/core-auth";
import { type TenantId, type SubscriptionId, type SubscriptionIdOrName } from "./azureUtils.js";
import { type AzCliInvoker } from "./azCliInvoker.js";
export interface ArmpitCredentialOptions {
tenantId?: TenantId;
subscription?: SubscriptionIdOrName;
}
export interface ArmpitTokenContext {
tenantId?: TenantId;
subscriptionId?: SubscriptionId;
}
/**
* Provides access tokens from the current Azure CLI invoker.
* @remarks
* This class is intended to be instantiated internally and exposed as a TokenCredential.
* The implementation is similar to AzureCliCredential but using an armpit invoker.
*/
export interface ArmpitCredential extends TokenCredential {
getLastTokenContext(): ArmpitTokenContext | null;
}
export declare function buildCliCredential(invoker: AzCliInvoker, options?: ArmpitCredentialOptions): ArmpitCredential;
/**
* Provides a token credential associated with the context of the provider.
*/
export interface ArmpitCredentialProvider {
/**
* Get a token credential associated within the context it is retrieved from.
*
* @param options Override how tokens are generated.
*/
getCredential(options?: ArmpitCredentialOptions): ArmpitCredential;
}
export declare class ArmpitCliCredentialFactory {
#private;
constructor(defaultInvoker?: AzCliInvoker);
getCredential(options?: ArmpitCredentialOptions, invokerOverride?: AzCliInvoker): ArmpitCredential;
}
//# sourceMappingURL=armpitCredential.d.ts.map