애플리케이션 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

애플리케이션 API는 인스턴스 전체에서 OAuth 애플리케이션을 운영합니다:

애플리케이션 API는 그룹 애플리케이션이나 개인 사용자의 애플리케이션을 관리하는 데 사용할 수 없습니다.

note
오직 관리자 사용자만 애플리케이션 API를 사용할 수 있습니다.

애플리케이션 생성

JSON 페이로드를 POST하여 애플리케이션을 생성합니다.

요청이 성공하면 200을 반환합니다.

POST /applications

지원되는 속성:

속성 유형 필수 설명
name string 애플리케이션의 이름입니다.
redirect_uri string 애플리케이션의 리디렉션 URI입니다.
scopes string 애플리케이션의 스코프입니다. 각 스코프는 공백으로 구분하여 여러 개를 지정할 수 있습니다.
confidential boolean 아니오 클라이언트 비밀을 비공개로 유지할 수 있는 애플리케이션입니다. 네이티브 모바일 앱과 싱글 페이지 앱은 비공식으로 간주됩니다. 제공하지 않을 경우 기본값은 true입니다.

예제 요청:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \  
     --data "name=MyApplication&redirect_uri=http://redirect.uri&scopes=api read_user email" \  
     "https://gitlab.example.com/api/v4/applications"  

예제 응답:

{  
    "id":1,  
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",  
    "application_name": "MyApplication",  
    "secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",  
    "callback_url": "http://redirect.uri",  
    "confidential": true  
}  

모든 애플리케이션 목록

등록된 모든 애플리케이션을 나열합니다.

GET /applications

예제 요청:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/applications"  

예제 응답:

[  
    {  
        "id":1,  
        "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",  
        "application_name": "MyApplication",  
        "callback_url": "http://redirect.uri",  
        "confidential": true  
    }  
]  
note
secret 값은 이 API를 통해 노출되지 않습니다.

애플리케이션 삭제

특정 애플리케이션을 삭제합니다.

요청이 성공하면 204을 반환합니다.

DELETE /applications/:id

지원되는 속성:

속성 유형 필수 설명
id integer 애플리케이션의 ID입니다(‘application_id’가 아님).

예제 요청:

curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/applications/:id"  

애플리케이션 비밀 키 갱신

애플리케이션 비밀 키를 갱신합니다. 요청이 성공하면 200을 반환합니다.

POST /applications/:id/renew-secret

지원되는 속성:

속성 유형 필수 여부 설명
id 정수 애플리케이션의 ID( application_id는 아님).

예제 요청:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/applications/:id/renew-secret"

예제 응답:

{
    "id":1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
    "callback_url": "http://redirect.uri",
    "confidential": true
}