Skip to content

Commit b65b3b4

Browse files
committed
Merge pull request #12 from swordofpain/master
Add support for project deploy keys
2 parents 2214986 + 48a81c2 commit b65b3b4

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Parameters:
255255
- public (optional) - if true same as setting visibility_level = 20
256256
- visibility_level (optional)
257257

258-
On success, method returns 200 with the updated project. If parameters are invalid, 400 is returned.
258+
On success, method returns 200 with the updated project. If parameters are invalid, 400 is returned.
259259

260260
#### client.projects.remove({id})
261261

@@ -477,6 +477,58 @@ This method is idempotent and can be called multiple times with the same paramet
477477

478478
---
479479

480+
### Deploy Keys
481+
482+
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/deploy_keys.md
483+
484+
#### client.deployKeys.list({id})
485+
486+
Get a list of a project's deploy keys.
487+
488+
Parameters:
489+
490+
* `{String}` `id` (required) - The ID or NAMESPACE/PROJECT_NAME of a project
491+
492+
493+
#### client.deployKeys.get({id, key_id})
494+
495+
Gets a project deploy key.
496+
497+
Parameters:
498+
499+
* `{String}` `id` (required) - The ID or NAMESPACE/PROJECT_NAME of a project
500+
* `{String}` `key_id` (required) - The ID of a key
501+
502+
```json
503+
{
504+
"id": 1,
505+
"title": "Public key",
506+
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
507+
"created_at": "2013-10-02T10:12:29Z"
508+
}
509+
```
510+
511+
#### client.deployKey.create({id, title, key})
512+
513+
Creates a new deploy key for a project. If deploy key already exists in another project - it will be joined to project but only if original one was is accessible by same user
514+
515+
Parameters:
516+
517+
* `{String}` `id` (required) - The ID or NAMESPACE/PROJECT_NAME of a project
518+
* `{String}` `title` (required) - New deploy key's title
519+
* `{String}` `key` (required) - New deploy key
520+
521+
#### client.deployKeys.remove({id, key_id})
522+
523+
Delete a deploy key from a project.
524+
525+
Parameters:
526+
527+
* `{String}` `id` (required) - The ID or NAMESPACE/PROJECT_NAME of a project
528+
* `{String}` `key_id` (required) - The ID of the deploy key
529+
530+
---
531+
480532
### Repository Branches
481533

482534
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#branches

lib/properties.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var properties = {
5252
'fork',
5353
'search',
5454
],
55+
deployKeys: [],
5556
projectMembers: [],
5657
groups: [
5758
'transferProject'

lib/resources/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ module.exports = {
6060
resourcePath: '/groups/:id/members',
6161
idName: 'user_id',
6262
},
63+
64+
deployKeys: {
65+
resourcePath: '/projects/:id/keys',
66+
idName: 'key_id',
67+
},
6368
};

0 commit comments

Comments
 (0)