Skip to content

Commit 42ee4e6

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 8f0913a commit 42ee4e6

File tree

2 files changed

+136
-0
lines changed

2 files changed

+136
-0
lines changed
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.

src/data/endpoints/managed.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,104 @@ endpoints:
176176
curl: |
177177
curl -H "Authorization: Bearer $TOKEN" \
178178
https://$api_root/$version/managed/services/$service_id
179+
/managed/credentials:
180+
group: Credentials
181+
type: resource
182+
description: >
183+
Manage your managed service credentials list.
184+
methods:
185+
GET:
186+
response: ManagedCredential
187+
description: >
188+
Returns your credentials list.
189+
examples:
190+
curl: |
191+
curl https://$api_root/$version/managed/credentials
192+
POST:
193+
description: >
194+
Registers a new credential.
195+
params:
196+
label:
197+
type: String
198+
limit: 2-75 characters
199+
description: >
200+
A unique label describing the credential being added.
201+
username:
202+
type: String
203+
description: >
204+
An optional login username.
205+
password:
206+
type: String
207+
description: >
208+
A password or passphrase that provides access.
209+
examples:
210+
curl: |
211+
curl -H "Content-Type: application/json" \
212+
-H "Authorization: Bearer $TOKEN" \
213+
-X POST -d '{
214+
"label": "MyCredential",
215+
"username": "myusername",
216+
"pasword": "mypassword",
217+
}' \
218+
https://$api_root/$version/managed/credentials
219+
/managed/credentials/$id:
220+
group: Credentials
221+
type: resource
222+
authenticated: true
223+
description: >
224+
Manage a particular Managed service credential your account may access.
225+
methods:
226+
GET:
227+
response: ManagedCredential
228+
description: >
229+
Returns information about this credential.
230+
examples:
231+
curl: |
232+
curl -H "Authorization: Bearer $TOKEN" \
233+
https://$api_root/$version/managed/credential/$credential_id
234+
PUT:
235+
description: >
236+
Edits this credential.
237+
examples:
238+
curl: |
239+
curl -H "Content-Type: application/json" \
240+
-H "Authorization: Bearer $TOKEN" \
241+
-X PUT -d '{
242+
"label": "MyNewCredential",
243+
"username": "myusername2",
244+
}' \
245+
https://$api_root/$version/managed/credentials/$credential_id
246+
/managed/credentials/$id/password:
247+
group: Credentials
248+
type: resource
249+
authenticated: true
250+
description: >
251+
Change the password for a credential.
252+
methods:
253+
POST:
254+
response: ManagedCredential
255+
description: >
256+
Changes the password for a credential.
257+
examples:
258+
curl: |
259+
curl -H "Content-Type: application/json" \
260+
-H "Authorization: Bearer $TOKEN" \
261+
-X POST -d '{
262+
"pasword": "mypassword",
263+
}' \
264+
https://$api_root/$version/managed/credentials/$credential_id/password
265+
/managed/credentials/$id/revoke:
266+
group: Credentials
267+
type: resource
268+
authenticated: true
269+
description: >
270+
Revokes a credential.
271+
methods:
272+
POST:
273+
description: >
274+
Revokes a credential.
275+
examples:
276+
curl: |
277+
curl -H "Content-Type: application/json" \
278+
-H "Authorization: Bearer $TOKEN" \
279+
https://$api_root/$version/managed/credentials/$credential_id/revoke

0 commit comments

Comments
 (0)