Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Navigation
APIs:
* [Authorizations](authorizations.md)
* [Commits](commits.md)
* Current User
* [Deploy keys / Public keys](currentuser/deploykeys.md)
* [Memberships](currentuser/memberships.md)
* [Enterprise](enterprise.md)
* [Gists](gists.md)
* [Comments](gists/comments.md)
Expand Down
36 changes: 36 additions & 0 deletions doc/currentuser/deploykeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Current user / Public Keys API
[Back to the navigation](../README.md)

Wraps [GitHub User Public Keys API](https://developer.github.com/v3/users/keys/#public-keys).

### List your public keys

```php
$keys = $client->user()->keys()->all();
```

Returns a list of public keys for the authenticated user.

### Shows a public key for the authenticated user.

```php
$key = $client->user()->keys()->show(1234);
```

### Add a public key to the authenticated user.

> Requires [authentication](security.md).

```php
$key = $client->user()->keys()->create(array('title' => 'key title', 'key' => 12345));
```

Adds a key with title 'key title' to the authenticated user and returns a the created key for the user.

### Remove a public key from the authenticated user.

> Requires [authentication](security.md).

```php
$client->user()->keys()->remove(12345);
```
8 changes: 4 additions & 4 deletions lib/Github/Api/CurrentUser/DeployKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DeployKeys extends AbstractApi
/**
* List deploy keys for the authenticated user.
*
* @link http://developer.github.com/v3/repos/keys/
* @link https://developer.github.com/v3/users/keys/
*
* @return array
*/
Expand All @@ -26,7 +26,7 @@ public function all()
/**
* Shows deploy key for the authenticated user.
*
* @link http://developer.github.com/v3/repos/keys/
* @link https://developer.github.com/v3/users/keys/
*
* @param string $id
*
Expand All @@ -40,7 +40,7 @@ public function show($id)
/**
* Adds deploy key for the authenticated user.
*
* @link http://developer.github.com/v3/repos/keys/
* @link https://developer.github.com/v3/users/keys/
*
* @param array $params
*
Expand All @@ -60,7 +60,7 @@ public function create(array $params)
/**
* Removes deploy key for the authenticated user.
*
* @link http://developer.github.com/v3/repos/keys/
* @link https://developer.github.com/v3/users/keys/
*
* @param string $id
*
Expand Down