File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/managedcleanroom/azext_managedcleanroom Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,21 @@ def get_frontend_token(cmd):
2424 :return: Tuple of (access_token, subscription, tenant)
2525 :raises: CLIError if token cannot be obtained
2626 """
27+ import os
2728 from ._msal_auth import get_msal_token , get_auth_scope
2829
2930 profile = Profile (cli_ctx = cmd .cli_ctx )
3031 subscription = get_subscription_id (cmd .cli_ctx )
32+
33+ # Priority 0: explicit token via environment variable (for local/test envs only)
34+ env_token = os .environ .get ('MANAGEDCLEANROOM_ACCESS_TOKEN' )
35+ if env_token :
36+ logger .warning ("Using token from MANAGEDCLEANROOM_ACCESS_TOKEN env var FOR TESTING PURPOSES ONLY" )
37+ from collections import namedtuple
38+ AccessToken = namedtuple ('AccessToken' , ['token' , 'expires_on' ])
39+ token_obj = AccessToken (token = env_token , expires_on = 0 )
40+ return (token_obj , subscription , None )
41+
3142 auth_scope = get_auth_scope (cmd )
3243
3344 logger .debug ("Using auth scope: %s" , auth_scope )
You can’t perform that action at this time.
0 commit comments