Codespaces 리포지토리 비밀
REST API를 사용하여 사용자가 codespace에서 액세스할 수 있는 리포지토리에 대한 비밀을 관리합니다.
Codespaces 리포지토리 비밀 정보
사용자가 액세스 권한이 있는 리포지토리에 대한 비밀(클라우드 서비스용 액세스 토큰 등)을 만들고 나열하고 삭제할 수 있습니다. 이러한 비밀은 런타임에 codespace에서 사용할 수 있습니다. 자세한 내용은 "codespace에 대한 비밀 관리"을 참조하세요.
List repository secrets
Lists all development environment secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets
repository permission to use this endpoint.
"List repository secrets"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
이름, Type, 설명 |
---|
per_page integer The number of results per page (max 100). 기본값: |
page integer Page number of the results to fetch. 기본값: |
"List repository secrets"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"List repository secrets"에 대한 코드 샘플
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/codespaces/secrets
Response
Get a repository public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have write access to the codespaces_secrets
repository permission to use this endpoint.
"Get a repository public key"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
"Get a repository public key"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"Get a repository public key"에 대한 코드 샘플
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/codespaces/secrets/public-key
Response
Get a repository secret
Gets a single repository development environment secret without revealing its encrypted value. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets
repository permission to use this endpoint.
"Get a repository secret"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
secret_name string RequiredThe name of the secret. |
"Get a repository secret"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
200 | OK |
"Get a repository secret"에 대한 코드 샘플
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/codespaces/secrets/SECRET_NAME
Response
Create or update a repository secret
Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."
You must authenticate using an access
token with the repo
scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets
repository permission to use this endpoint.
"Create or update a repository secret"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
secret_name string RequiredThe name of the secret. |
이름, Type, 설명 |
---|
encrypted_value string Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint. |
key_id string ID of the key you used to encrypt the secret. |
"Create or update a repository secret"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
201 | Response when creating a secret |
204 | Response when updating a secret |
"Create or update a repository secret"에 대한 코드 샘플
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/codespaces/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'
Response when creating a secret
Delete a repository secret
Deletes a development environment secret in a repository using the secret name. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have write access to the codespaces_secrets
repository permission to use this endpoint.
"Delete a repository secret"에 대한 매개 변수
이름, Type, 설명 |
---|
accept string Setting to |
이름, Type, 설명 |
---|
owner string RequiredThe account owner of the repository. The name is not case sensitive. |
repo string RequiredThe name of the repository without the |
secret_name string RequiredThe name of the secret. |
"Delete a repository secret"에 대한 HTTP 응답 상태 코드
상태 코드 | 설명 |
---|---|
204 | No Content |
"Delete a repository secret"에 대한 코드 샘플
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/codespaces/secrets/SECRET_NAME
Response
Status: 204