본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

SCIM 사용자 목록 조회

원문 보기 위키 갱신

SCIM 사용자 목록 조회 (List users)

Docker Hub SCIM 2.0 API에서 조직의 사용자 목록을 페이지 단위로 돌려주는 작업이에요. startIndex와 count 쿼리 파라미터로 페이징하고, 정렬(sortBy/sortOrder)과 필터(filter)도 지원해요.

출처: 문서

본문

GET 요청으로 조직의 사용자 목록을 페이징해서 조회합니다. 이 작업은 scimToken 인증이 필요해요. 조회 결과를 특정 조건으로 좁히거나 정렬할 수 있습니다.

정렬

sortBy와 sortOrder 쿼리 파라미터 조합으로 리소스가 반환되는 순서를 지정할 수 있어요. sortBy는 정렬 기준이 되는 속성, sortOrder는 정렬 방향이며 ascending/descending 값을 허용합니다.

필터링

filter 쿼리 파라미터에 필터 표현식을 넣으면 리소스의 부분집합을 요청할 수 있어요. 필터의 속성 이름과 연산자는 대소문자를 구분하지 않습니다. 지원하는 연산자는 다음과 같아요.

  • eq 같음
  • ne 같지 않음
  • co 포함
  • sw 시작 문자 일치
  • and 논리 "and"
  • or 논리 "or"
  • not "Not" 함수
  • () 우선순위 그룹

파라미터

파라미터 위치 설명
startIndex query 반환할 첫 결과의 1-based 인덱스 (최소 1)
count query 반환할 최대 결과 수 (1~200)
filter query 사용자 선택에 쓰는 SCIM 필터 표현식
attributes query 반환할 속성 지정
sortOrder query 정렬 방향 (ascending/descending)
sortBy query 정렬 기준 속성

응답 200

application/scim+json 타입으로, Resources 배열에 scim_user 항목들과 페이징 정보가 담겨요.

{
  "Resources": [
    {
      "active": true,
      "displayName": "jonsnow",
      "emails": [
        {
          "display": "jon.snow@docker.com",
          "primary": true,
          "value": "jon.snow@docker.com"
        }
      ],
      "groups": [
        {
          "display": "nightswatch",
          "value": "nightswatch"
        }
      ],
      "id": "d80f7c79-7730-49d8-9a41-7c42fb622d9c",
      "meta": {
        "created": "2022-05-20T00:54:18Z",
        "lastModified": "2022-05-20T00:54:18Z",
        "location": "https://hub.docker.com/v2/scim/2.0/Users/d80f7c79-7730-49d8-9a41-7c42fb622d9c",
        "resourceType": "User"
      },
      "name": {
        "familyName": "Snow",
        "givenName": "Jon"
      },
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "userName": "jon.snow@docker.com"
    }
  ],
  "itemsPerPage": 1,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "startIndex": 1,
  "totalResults": 1
}

오류 응답

  • 400: 잘못된 요청
  • 401: 인증 실패
  • 403: 권한 없음
  • 404: 대상을 찾을 수 없음
  • 500: 서버 오류

예시 요청

curl \
  --request GET \
  --header "Authorization: Bearer ***" \
  --header 'Accept: application/scim+json' \
  'https://hub.docker.com/v2/scim/2.0/Users?startIndex=1&count=10&filter=userName+eq+%22jon.snow%40docker.com%22&attributes=userName%2CdisplayName&sortBy=userName'

더 알아보기