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

Get Role Mappings API

원문 보기 위키 갱신

출처: 문서

본문

역할 매핑 조회 API

1.0에 도입 {: .label .label-purple }

역할 매핑을 조회합니다. 역할 이름을 지정하면 해당 역할의 매핑을 조회하고, 역할 이름을 생략하면 모든 역할 매핑을 조회합니다.

엔드포인트

GET /_plugins/_security/api/rolesmapping
GET /_plugins/_security/api/rolesmapping/{role}

경로 파라미터

다음 표에서는 사용할 수 있는 경로 파라미터를 보여 줍니다.

파라미터 데이터 타입 필수 여부 설명
role String 아니요 매핑을 조회하려는 역할의 이름입니다. 생략하면 모든 역할 매핑이 반환됩니다.

요청 예제

다음 요청은 모든 역할 매핑을 조회합니다:

GET _plugins/_security/api/rolesmapping

{% include copy-curl.html security=true %}

다음 요청은 role_starfleet 역할의 매핑을 조회합니다:

GET _plugins/_security/api/rolesmapping/role_starfleet

{% include copy-curl.html security=true %}

응답 예제

여기서는 응답이 축약되어 있습니다:

{
  "manage_snapshots": {
    "and_backend_roles": [],
    "backend_roles": [
      "snapshotrestore"
    ],
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  "logstash": {
    "and_backend_roles": [],
    "backend_roles": [
      "logstash"
    ],
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  "kibana_user": {
    "and_backend_roles": [],
    "backend_roles": [
      "kibanauser"
    ],
    "description": "Maps kibanauser to kibana_user",
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  ...
}

역할 매핑 하나를 요청했을 때의 응답에는 해당 매핑만 포함됩니다:

{
  "role_starfleet": {
    "and_backend_roles": [],
    "backend_roles": [
      "starfleet",
      "captains",
      "defectors",
      "cn=ldaprole,ou=groups,dc=example,dc=com"
    ],
    "hidden": false,
    "hosts": [
      "*.starfleetintranet.com"
    ],
    "reserved": false,
    "users": [
      "worf"
    ]
  }
}

더 알아보기 (Learn more)