액세스 토큰

액세스 토큰 (accessToken)

Docker Hub API가 다루는 개인 액세스 토큰 객체 스키마예요. 토큰의 라벨·권한 범위·생성/만료 시각·토큰 값 등을 담아요. 토큰 값은 생성 시에만 전체가 반환되고 이후 응답에서는 ***로 마스킹돼요.

출처: 문서

본문

이 스키마는 토큰 한 개의 전체 속성을 담은 객체예요. 주요 필드는 다음과 같아요.

  • client_id(예: HUB), uuid: 토큰 식별 정보
  • created_at/expires_at: 생성·만료 시각 (expires_at는 null 가능)
  • creator_ip/creator_ua: 생성자 IP·User-Agent
  • is_active: 활성 여부
  • scopes: 권한 범위 배열 (예: ["repo:read"])
  • token: 실제 토큰 값. 생성 시에만 전체 값이 돌아오고, 이후 응답에서는 ***로 마스킹돼요.
  • token_label: 토큰 설명 라벨

다음은 전체 토큰 객체의 예시예요.

{
  "properties": {
    "client_id": {
      "example": "HUB",
      "type": "string"
    },
    "created_at": {
      "example": "2021-07-20T12:00:00.000000Z",
      "type": "string"
    },
    "creator_ip": {
      "example": "127.0.0.1",
      "type": "string"
    },
    "creator_ua": {
      "example": "some user agent",
      "type": "string"
    },
    "expires_at": {
      "example": "2021-10-28T18:30:19.520861Z",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "generated_by": {
      "example": "manual",
      "type": "string"
    },
    "is_active": {
      "example": true,
      "type": "boolean"
    },
    "last_used": {
      "example": null,
      "type": [
        "string",
        "null"
      ]
    },
    "scopes": {
      "example": [
        "repo:read"
      ],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "token": {
      "description": "Token value returned on creation. Later responses redact the value as ***.",
      "example": "a7a5ef25-8889-43a0-8cc7-f2a94268e861",
      "type": "string"
    },
    "token_label": {
      "example": "My read only token",
      "type": "string"
    },
    "uuid": {
      "example": "b30bbf97-506c-4ecd-aabc-842f3cb484fb",
      "type": "string"
    }
  },
  "type": "object"
}

더 알아보기