Skip to content

Commit 5a55b02

Browse files
authored
Merge pull request KnpLabs#478 from acrobat/user-publickeys-docs
Added missing docs for currentuser public keys
2 parents e9f8707 + 789fe80 commit 5a55b02

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

doc/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Navigation
44
APIs:
55
* [Authorizations](authorizations.md)
66
* [Commits](commits.md)
7+
* Current User
8+
* [Deploy keys / Public keys](currentuser/deploykeys.md)
9+
* [Memberships](currentuser/memberships.md)
710
* [Enterprise](enterprise.md)
811
* [Gists](gists.md)
912
* [Comments](gists/comments.md)

doc/currentuser/deploykeys.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Current user / Public Keys API
2+
[Back to the navigation](../README.md)
3+
4+
Wraps [GitHub User Public Keys API](https://developer.github.com/v3/users/keys/#public-keys).
5+
6+
### List your public keys
7+
8+
```php
9+
$keys = $client->user()->keys()->all();
10+
```
11+
12+
Returns a list of public keys for the authenticated user.
13+
14+
### Shows a public key for the authenticated user.
15+
16+
```php
17+
$key = $client->user()->keys()->show(1234);
18+
```
19+
20+
### Add a public key to the authenticated user.
21+
22+
> Requires [authentication](security.md).
23+
24+
```php
25+
$key = $client->user()->keys()->create(array('title' => 'key title', 'key' => 12345));
26+
```
27+
28+
Adds a key with title 'key title' to the authenticated user and returns a the created key for the user.
29+
30+
### Remove a public key from the authenticated user.
31+
32+
> Requires [authentication](security.md).
33+
34+
```php
35+
$client->user()->keys()->remove(12345);
36+
```

lib/Github/Api/CurrentUser/DeployKeys.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DeployKeys extends AbstractApi
1414
/**
1515
* List deploy keys for the authenticated user.
1616
*
17-
* @link http://developer.github.com/v3/repos/keys/
17+
* @link https://developer.github.com/v3/users/keys/
1818
*
1919
* @return array
2020
*/
@@ -26,7 +26,7 @@ public function all()
2626
/**
2727
* Shows deploy key for the authenticated user.
2828
*
29-
* @link http://developer.github.com/v3/repos/keys/
29+
* @link https://developer.github.com/v3/users/keys/
3030
*
3131
* @param string $id
3232
*
@@ -40,7 +40,7 @@ public function show($id)
4040
/**
4141
* Adds deploy key for the authenticated user.
4242
*
43-
* @link http://developer.github.com/v3/repos/keys/
43+
* @link https://developer.github.com/v3/users/keys/
4444
*
4545
* @param array $params
4646
*
@@ -60,7 +60,7 @@ public function create(array $params)
6060
/**
6161
* Removes deploy key for the authenticated user.
6262
*
63-
* @link http://developer.github.com/v3/repos/keys/
63+
* @link https://developer.github.com/v3/users/keys/
6464
*
6565
* @param string $id
6666
*

0 commit comments

Comments
 (0)