注意:Codespaces 加密密码目前处于测试阶段,可能会更改。
关于 Codespaces 的加密密码
您可以将要在代码空间中使用的加密密码添加到您的用户帐户。 例如,您可能想要存储和访问以下敏感信息作为加密密码。
- 对云服务的个人访问令牌
- 服务主体
- 订阅标识符
您可以选择哪些仓库应有权访问每个密码。 然后,您可以在为有权访问密码的仓库创建的任何代码空间中使用该密码。
添加密码
- 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)。
- In the left sidebar, click Codespaces.
- 在“Codespaces secrets(代码空间密码)”的右侧,单击 New secret(新建密码)。
- 在“Name(名称)”下,输入密码的名称。
- Under "Value", type the value of your secret.
- Select the "Repository access" drop-down menu, then click a repository you want to have access to the secret. Repeat for every repository you want to have access to the secret.
- 单击 Add secret(添加密码)。
编辑密码
您可以更新现有密码的值,也可以更改哪些仓库可以访问密码。
- 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)。
- In the left sidebar, click Codespaces.
- 在“Codespaces secrets(代码空间密码)”下您要编辑的密码右侧,单击 Update(更新)。
- 在“Value(值)”下,单击 enter a new value(输入新值)。
- Under "Value", type the value of your secret.
- Select the "Repository access" drop-down menu, then click a repository you want to have access to the secret. Repeat for every repository you want to have access to the secret.
- (可选)要删除密码对仓库的访问权限,请取消选择仓库。
- 单击 Save changes(保存更改)。
删除密码
- 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)。
- In the left sidebar, click Codespaces.
- 在“Codespaces secrets(代码空间密码)”下您要删除的密码右侧,单击 Delete(删除)。
- 阅读警告,然后单击 OK(确定)。