Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
fcc2c43e
Commit
fcc2c43e
authored
Aug 18, 2016
by
Ali Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added can_push attribute to deploy keys and update docs for API
parent
2b73aaa1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
doc/api/deploy_keys.md
doc/api/deploy_keys.md
+13
-6
lib/api/entities.rb
lib/api/entities.rb
+1
-1
No files found.
doc/api/deploy_keys.md
View file @
fcc2c43e
...
@@ -20,12 +20,14 @@ Example response:
...
@@ -20,12 +20,14 @@ Example response:
"id"
:
1
,
"id"
:
1
,
"title"
:
"Public key"
,
"title"
:
"Public key"
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"can_push"
:
false
,
"created_at"
:
"2013-10-02T10:12:29Z"
"created_at"
:
"2013-10-02T10:12:29Z"
},
},
{
{
"id"
:
3
,
"id"
:
3
,
"title"
:
"Another Public key"
,
"title"
:
"Another Public key"
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"can_push"
:
true
,
"created_at"
:
"2013-10-02T11:12:29Z"
"created_at"
:
"2013-10-02T11:12:29Z"
}
}
]
]
...
@@ -55,12 +57,14 @@ Example response:
...
@@ -55,12 +57,14 @@ Example response:
"id"
:
1
,
"id"
:
1
,
"title"
:
"Public key"
,
"title"
:
"Public key"
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"can_push"
:
false
,
"created_at"
:
"2013-10-02T10:12:29Z"
"created_at"
:
"2013-10-02T10:12:29Z"
},
},
{
{
"id"
:
3
,
"id"
:
3
,
"title"
:
"Another Public key"
,
"title"
:
"Another Public key"
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"can_push"
:
false
,
"created_at"
:
"2013-10-02T11:12:29Z"
"created_at"
:
"2013-10-02T11:12:29Z"
}
}
]
]
...
@@ -92,6 +96,7 @@ Example response:
...
@@ -92,6 +96,7 @@ Example response:
"id"
:
1
,
"id"
:
1
,
"title"
:
"Public key"
,
"title"
:
"Public key"
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"key"
:
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
,
"can_push"
:
false
,
"created_at"
:
"2013-10-02T10:12:29Z"
"created_at"
:
"2013-10-02T10:12:29Z"
}
}
```
```
...
@@ -112,9 +117,10 @@ POST /projects/:id/deploy_keys
...
@@ -112,9 +117,10 @@ POST /projects/:id/deploy_keys
|
`id`
| integer | yes | The ID of the project |
|
`id`
| integer | yes | The ID of the project |
|
`title`
| string | yes | New deploy key's title |
|
`title`
| string | yes | New deploy key's title |
|
`key`
| string | yes | New deploy key |
|
`key`
| string | yes | New deploy key |
|
`can_push`
| boolean | no | Can deploy key push to the project's repository |
```
bash
```
bash
curl
--request
POST
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
--header
"Content-Type: application/json"
--data
'{"title": "My deploy key", "key": "ssh-rsa AAAA..."}'
"https://gitlab.example.com/api/v3/projects/5/deploy_keys/"
curl
--request
POST
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
--header
"Content-Type: application/json"
--data
'{"title": "My deploy key", "key": "ssh-rsa AAAA..."
, "can_push": "true"
}'
"https://gitlab.example.com/api/v3/projects/5/deploy_keys/"
```
```
Example response:
Example response:
...
@@ -124,6 +130,7 @@ Example response:
...
@@ -124,6 +130,7 @@ Example response:
"key"
:
"ssh-rsa AAAA..."
,
"key"
:
"ssh-rsa AAAA..."
,
"id"
:
12
,
"id"
:
12
,
"title"
:
"My deploy key"
,
"title"
:
"My deploy key"
,
"can_push"
:
true
,
"created_at"
:
"2015-08-29T12:44:31.550Z"
"created_at"
:
"2015-08-29T12:44:31.550Z"
}
}
```
```
...
...
lib/api/entities.rb
View file @
fcc2c43e
...
@@ -234,7 +234,7 @@ module API
...
@@ -234,7 +234,7 @@ module API
end
end
class
SSHKey
<
Grape
::
Entity
class
SSHKey
<
Grape
::
Entity
expose
:id
,
:title
,
:key
,
:created_at
expose
:id
,
:title
,
:key
,
:created_at
,
:can_push
end
end
class
SSHKeyWithUser
<
SSHKey
class
SSHKeyWithUser
<
SSHKey
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment