File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ def parse_args() -> argparse.Namespace:
230230 required = False ,
231231 help = 'Security schemes for authentication. '
232232 'Sample: "AADToken" for AAD credential for OAuth 2.0 authentication; '
233- '"AzureKey" for Azure key credential; "[AADToken,AzureKey]" for both ' ,
233+ '"AzureKey" for Azure key credential' ,
234234 )
235235 parser .add_argument (
236236 '--security-scopes' ,
@@ -283,6 +283,15 @@ def main():
283283 base_dir = os .path .abspath (os .path .dirname (sys .argv [0 ]))
284284 sdk_root = os .path .abspath (os .path .join (base_dir , SDK_ROOT ))
285285
286+ # convert credential-types/credential-scopes to security/security-scopes for backward-compatibility
287+ if not args ['security' ] and args ['credential_types' ]:
288+ if args ['credential_types' ] == 'tokencredential' :
289+ args ['security' ] = 'AADToken'
290+ elif args ['credential_types' ] == 'azurekeycredential' :
291+ args ['security' ] = 'AzureKey'
292+ if not args ['security_scopes' ] and args ['credential_scopes' ]:
293+ args ['security_scopes' ] = args ['credential_scopes' ]
294+
286295 succeeded = generate (sdk_root , ** args )
287296 if succeeded :
288297 succeeded = compile_package (sdk_root , GROUP_ID , args ['module' ])
You can’t perform that action at this time.
0 commit comments