Skip to content

Commit 8e7aa82

Browse files
committed
Adding in commands for managing ssh keys
1 parent 45677db commit 8e7aa82

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/bitbucket_rest_api/users/account.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ def followers(accountname)
2828
def events(accountname)
2929
response = get_request("/users/#{accountname}/events")
3030
end
31-
31+
32+
#GET the keys
33+
def keys(accountname)
34+
response = get_request("/users/#{accountname}/ssh-keys")
35+
end
36+
37+
#POST a new key
38+
# params should be in format {key: "", label:""}
39+
def new_key(accountname, params)
40+
response = post_request("/users/#{accountname}/ssh-keys/", params)
41+
end
42+
43+
#DELETE a key
44+
def delete_key(accountname, key_id)
45+
response = delete_request("/users/#{accountname}/ssh-keys/#{key_id}")
46+
end
3247
end # Users::Account
3348
end # BitBucket

0 commit comments

Comments
 (0)