라이선스 API
Offering: GitLab.com, Self-managed, GitLab Dedicated
GitLab에는 다양한 오픈 소스 라이선스 템플릿을 처리할 수 있는 API 엔드포인트가 있습니다. 다양한 라이선스의 조건에 대한 자세한 내용은 이 사이트 또는 온라인에서 제공되는 많은 다른 리소스를 참조하세요.
게스트 역할을 가진 사용자는 라이선스 템플릿에 접근할 수 없습니다. 자세한 내용은 프로젝트 및 그룹 가시성을 참조하세요.
라이선스 템플릿 목록
모든 라이선스 템플릿을 가져옵니다.
GET /templates/licenses
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
popular |
boolean | 아니오 | 전달되면 인기 있는 라이선스만 반환 |
curl "https://gitlab.example.com/api/v4/templates/licenses?popular=1"
예시 응답:
[
{
"key": "apache-2.0",
"name": "Apache License 2.0",
"nickname": null,
"featured": true,
"html_url": "http://choosealicense.com/licenses/apache-2.0/",
"source_url": "http://www.apache.org/licenses/LICENSE-2.0.html",
"description": "기여자에서 사용자에게 명백한 특허 권리를 부여하는 허용 라이선스입니다.",
"conditions": [
"include-copyright",
"document-changes"
],
"permissions": [
"commercial-use",
"modifications",
"distribution",
"patent-use",
"private-use"
],
"limitations": [
"trademark-use",
"no-liability"
],
"content": " Apache License\n Version 2.0, January 2004\n [...]"
},
{
"key": "gpl-3.0",
"name": "GNU General Public License v3.0",
"nickname": "GNU GPLv3",
"featured": true,
"html_url": "http://choosealicense.com/licenses/gpl-3.0/",
"source_url": "http://www.gnu.org/licenses/gpl-3.0.txt",
"description": "GNU GPL은 가장 널리 사용되는 자유 소프트웨어 라이선스이며 강력한 카피레프트 요구 사항을 지닙니다. 유도 작업을 배포할 때 작업의 소스 코드는 동일한 라이선스 하에 제공되어야 합니다.",
"conditions": [
"include-copyright",
"document-changes",
"disclose-source",
"same-license"
],
"permissions": [
"commercial-use",
"modifications",
"distribution",
"patent-use",
"private-use"
],
"limitations": [
"no-liability"
],
"content": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n [...]"
},
{
"key": "mit",
"name": "MIT License",
"nickname": null,
"featured": true,
"html_url": "http://choosealicense.com/licenses/mit/",
"source_url": "http://opensource.org/licenses/MIT",
"description": "짧고 간결한 허용 라이선스입니다. 적절한 귀속과 보증 없이 코드에 대해 사람들에게 무엇이든 할 수 있게 해줍니다.",
"conditions": [
"include-copyright"
],
"permissions": [
"commercial-use",
"modifications",
"distribution",
"private-use"
],
"limitations": [
"no-liability"
],
"content": "The MIT License (MIT)\n\nCopyright (c) [year] [fullname]\n [...]"
}
]
단일 라이선스 템플릿
단일 라이선스 템플릿을 가져옵니다. 매개변수를 전달하여 라이선스 자리 표시자를 교체할 수 있습니다.
GET /templates/licenses/:key
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
key |
string | 예 | 라이선스 템플릿의 키 |
project |
string | 아니요 | 저작권이 있는 프로젝트 이름 |
fullname |
string | 아니요 | 저작권 소유자의 전체 이름 |
참고:
fullname
매개변수를 생략하고 요청을 인증하면, 인증된 사용자의 이름이 저작권 소유자 자리 표시자를 대체합니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/templates/licenses/mit?project=My+Cool+Project"
예제 응답:
{
"key": "mit",
"name": "MIT License",
"nickname": null,
"featured": true,
"html_url": "http://choosealicense.com/licenses/mit/",
"source_url": "http://opensource.org/licenses/MIT",
"description": "짧고 간결한 허용 라이선스입니다. 이 라이선스는 적절한 저작권 고지와 함께 코드에 대해 사용자가 원하는 모든 작업을 수행할 수 있도록 허용합니다.",
"conditions": [
"include-copyright"
],
"permissions": [
"commercial-use",
"modifications",
"distribution",
"private-use"
],
"limitations": [
"no-liability"
],
"content": "MIT 라이선스(MIT)\n\nCopyright (c) 2016 John Doe\n [...]"
}