조직 액세스 토큰 수정
조직 액세스 토큰 수정 (Update access token)
Docker Hub API에서 조직 액세스 토큰(organization access token, OAT) 하나를 수정하는 작업이에요. 토큰의 라벨·활성 여부·리소스 접근 범위를 갱신할 수 있어요.
출처: 문서
본문
PATCH 요청으로 조직의 특정 액세스 토큰을 수정합니다. bearerAuth 인증이 필요해요.
파라미터
| 파라미터 | 위치 | 설명 |
|---|---|---|
org_name |
path (필수) | 조직 이름 |
access_token_id |
path (필수) | 수정할 토큰의 ID |
요청 본문
updateOrgAccessTokenRequest 스키마예요. 예를 들면 이렇게 생겼어요.
{
"description": "Token for CI/CD pipeline",
"is_active": true,
"label": "My organization token",
"resources": [
{
"path": "myorg/myrepo",
"scopes": [
"scope-image-pull"
],
"type": "TYPE_REPO"
}
]
}
응답 200
수정된 토큰이 updateOrgAccessTokenResponse로 돌아와요.
{
"created_at": "2022-05-20T00:54:18Z",
"created_by": "johndoe",
"expires_at": "2023-05-20T00:54:18Z",
"id": "a7a5ef25-8889-43a0-8cc7-f2a94268e861",
"is_active": true,
"label": "My organization token",
"last_used_at": "2022-06-15T12:30:45Z",
"resources": [
{
"path": "myorg/myrepo",
"scopes": [
"scope-image-pull"
],
"type": "TYPE_REPO"
}
]
}
오류 응답
401: 인증 실패 (unauthorized)403: 권한 없음 (permission denied)404: 토큰을 찾을 수 없음 (not found)
예시 요청
curl \
--request PATCH \
--header "Authorization: Bearer ***" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Token for CI/CD pipeline",
"is_active": true,
"label": "My organization token",
"resources": [
{
"path": "myorg/myrepo",
"scopes": [
"scope-image-pull"
],
"type": "TYPE_REPO"
}
]
}' \
'https://hub.docker.com/v2/orgs/myorganization/access-tokens/a7a5ef25-8889-43a0-8cc7-f2a94268e861'
더 알아보기
- 조직 토큰 수정 요청 (updateOrgAccessTokenRequest): 요청 본문 구조를 확인해요.
- 조직 토큰 수정 응답 (updateOrgAccessTokenResponse): 응답 구조를 살펴봐요.