在文档中找不到它。 enableBasicAuth参数将设置为true,将basicAuthCredentials'string'设置为什么?已经尝试使用“用户名|密码”和“用户名:密码”。
response = client.create_branch(
appId='string',
branchName='string',
description='string',
stage='PRODUCTION'|'BETA'|'DEVELOPMENT'|'EXPERIMENTAL'|'PULL_REQUEST',
framework='string',
enableNotification=True|False,
enableAutoBuild=True|False,
environmentVariables={
'string': 'string'
},
basicAuthCredentials='string',
enableBasicAuth=True|False,
tags={
'string': 'string'
},
buildSpec='string',
ttl='string',
displayName='string',
enablePullRequestPreview=True|False,
pullRequestEnvironmentName='string',
backendEnvironmentArn='string'
)
已解决,解释here。
代码如下:
creds = "username:password"
creds_ascii = creds.encode("ascii")
creds_base64_bytes = base64.b64encode(creds_ascii)
creds_base64_utf8 = creds_base64_bytes.decode("utf-8")
...
basicAuthCredentials=creds_base64_utf8,
...