Skip to content

Commit 49d425c

Browse files
Josh SagerDorthu
authored andcommitted
Added object and endpoints for managed credentials
GET all credentials and specific credentials by ID POST to create a new credential PUT to update an existing credential POST to password to change an existing credential's password POST to revoke to remove a credential
1 parent cd199f5 commit 49d425c

File tree

2 files changed

+136
-0
lines changed

2 files changed

+136
-0
lines changed

docs/src/data/endpoints/managed.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,104 @@ endpoints:
175175
curl: |
176176
curl -H "Authorization: Bearer $TOKEN" \
177177
https://$api_root/$version/managed/services/$service_id
178+
/managed/credentials:
179+
group: Credentials
180+
type: resource
181+
description: >
182+
Manage your managed service credentials list.
183+
methods:
184+
GET:
185+
response: ManagedCredential
186+
description: >
187+
Returns your credentials list.
188+
examples:
189+
curl: |
190+
curl https://$api_root/$version/managed/credentials
191+
POST:
192+
description: >
193+
Registers a new credential.
194+
params:
195+
label:
196+
type: String
197+
limit: 2-75 characters
198+
description: >
199+
A unique label describing the credential being added.
200+
username:
201+
type: String
202+
description: >
203+
An optional login username.
204+
password:
205+
type: String
206+
description: >
207+
A password or passphrase that provides access.
208+
examples:
209+
curl: |
210+
curl -H "Content-Type: application/json" \
211+
-H "Authorization: Bearer $TOKEN" \
212+
-X POST -d '{
213+
"label": "MyCredential",
214+
"username": "myusername",
215+
"pasword": "mypassword",
216+
}' \
217+
https://$api_root/$version/managed/credentials
218+
/managed/credentials/$id:
219+
group: Credentials
220+
type: resource
221+
authenticated: true
222+
description: >
223+
Manage a particular Managed service credential your account may access.
224+
methods:
225+
GET:
226+
response: ManagedCredential
227+
description: >
228+
Returns information about this credential.
229+
examples:
230+
curl: |
231+
curl -H "Authorization: Bearer $TOKEN" \
232+
https://$api_root/$version/managed/credential/$credential_id
233+
PUT:
234+
description: >
235+
Edits this credential.
236+
examples:
237+
curl: |
238+
curl -H "Content-Type: application/json" \
239+
-H "Authorization: Bearer $TOKEN" \
240+
-X PUT -d '{
241+
"label": "MyNewCredential",
242+
"username": "myusername2",
243+
}' \
244+
https://$api_root/$version/managed/credentials/$credential_id
245+
/managed/credentials/$id/password:
246+
group: Credentials
247+
type: resource
248+
authenticated: true
249+
description: >
250+
Change the password for a credential.
251+
methods:
252+
POST:
253+
response: ManagedCredential
254+
description: >
255+
Changes the password for a credential.
256+
examples:
257+
curl: |
258+
curl -H "Content-Type: application/json" \
259+
-H "Authorization: Bearer $TOKEN" \
260+
-X POST -d '{
261+
"pasword": "mypassword",
262+
}' \
263+
https://$api_root/$version/managed/credentials/$credential_id/password
264+
/managed/credentials/$id/revoke:
265+
group: Credentials
266+
type: resource
267+
authenticated: true
268+
description: >
269+
Revokes a credential.
270+
methods:
271+
POST:
272+
description: >
273+
Revokes a credential.
274+
examples:
275+
curl: |
276+
curl -H "Content-Type: application/json" \
277+
-H "Authorization: Bearer $TOKEN" \
278+
https://$api_root/$version/managed/credentials/$credential_id/revoke
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# vim: set et ts=2 sw=2 tw=80 :
2+
name: ManagedCredential
3+
prefix: managed/credentials
4+
description: >
5+
Managed Service credential objects describe monitoring service credentials associated with a service.
6+
schema:
7+
id:
8+
type: Integer
9+
value: 123
10+
description: >
11+
This credential's ID.
12+
label:
13+
type: String
14+
value: CredentialLabel
15+
description: >
16+
A unique Label describing the credential.
17+
username:
18+
type: String
19+
value: myusername
20+
description: >
21+
An optional login username.
22+
last_decryption:
23+
type: Object
24+
description: >
25+
The username and datetime of the last successful login using this credential.
26+
who:
27+
type: String
28+
value: myusername
29+
description: >
30+
The username of the last successful login.
31+
when:
32+
type: Datetime
33+
value: 2017-10-31T11:12:21
34+
description: >
35+
The datetime of the last successful login.

0 commit comments

Comments
 (0)