-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI.html
More file actions
554 lines (523 loc) · 91.5 KB
/
API.html
File metadata and controls
554 lines (523 loc) · 91.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Secrets Service API</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><style>@import url('https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200');@import url('https://fonts.googleapis.com/css?family=Roboto:100,400,700|Source+Code+Pro');.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.right .hljs-comment{color:#969896}.right .css .hljs-class,.right .css .hljs-id,.right .css .hljs-pseudo,.right .hljs-attribute,.right .hljs-regexp,.right .hljs-tag,.right .hljs-variable,.right .html .hljs-doctype,.right .ruby .hljs-constant,.right .xml .hljs-doctype,.right .xml .hljs-pi,.right .xml .hljs-tag .hljs-title{color:#c66}.right .hljs-built_in,.right .hljs-constant,.right .hljs-literal,.right .hljs-number,.right .hljs-params,.right .hljs-pragma,.right .hljs-preprocessor{color:#de935f}.right .css .hljs-rule .hljs-attribute,.right .ruby .hljs-class .hljs-title{color:#f0c674}.right .hljs-header,.right .hljs-inheritance,.right .hljs-name,.right .hljs-string,.right .hljs-value,.right .ruby .hljs-symbol,.right .xml .hljs-cdata{color:#b5bd68}.right .css .hljs-hexcolor,.right .hljs-title{color:#8abeb7}.right .coffeescript .hljs-title,.right .hljs-function,.right .javascript .hljs-title,.right .perl .hljs-sub,.right .python .hljs-decorator,.right .python .hljs-title,.right .ruby .hljs-function .hljs-title,.right .ruby .hljs-title .hljs-keyword{color:#81a2be}.right .hljs-keyword,.right .javascript .hljs-function{color:#b294bb}.right .hljs{display:block;overflow-x:auto;background:#1d1f21;color:#c5c8c6;padding:.5em;-webkit-text-size-adjust:none}.right .coffeescript .javascript,.right .javascript .xml,.right .tex .hljs-formula,.right .xml .css,.right .xml .hljs-cdata,.right .xml .javascript,.right .xml .vbscript{opacity:.5}.hljs-comment{color:#969896}.css .hljs-class,.css .hljs-id,.css .hljs-pseudo,.hljs-attribute,.hljs-regexp,.hljs-tag,.hljs-variable,.html .hljs-doctype,.ruby .hljs-constant,.xml .hljs-doctype,.xml .hljs-pi,.xml .hljs-tag .hljs-title{color:#77A619}.hljs-literal{color:#A69819}.hljs-built_in,.hljs-constant,.hljs-number,.hljs-params,.hljs-pragma,.hljs-preprocessor{color:#1B88B3}.css .hljs-rule .hljs-attribute,.ruby .hljs-class .hljs-title{color:#A37518}.hljs-header,.hljs-inheritance,.hljs-name,.hljs-string,.hljs-value,.ruby .hljs-symbol,.xml .hljs-cdata{color:inherit}.coffeescript .hljs-title,.css .hljs-hexcolor,.hljs-function,.hljs-title,.javascript .hljs-title,.perl .hljs-sub,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword{color:#A63A4A}.hljs-keyword,.javascript .hljs-function{color:#A69819}.hljs{display:block;overflow-x:auto;background:#1d1f21;color:#c5c8c6;padding:.5em;-webkit-text-size-adjust:none}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .css,.xml .hljs-cdata,.xml .javascript,.xml .vbscript{opacity:.5}.right .hljs-comment{color:#969896}.right .css .hljs-class,.right .css .hljs-id,.right .css .hljs-pseudo,.right .hljs-attribute,.right .hljs-regexp,.right .hljs-tag,.right .hljs-variable,.right .html .hljs-doctype,.right .ruby .hljs-constant,.right .xml .hljs-doctype,.right .xml .hljs-pi,.right .xml .hljs-tag .hljs-title{color:#C1EF65}.right .hljs-literal{color:#EBDE68}.right .hljs-built_in,.right .hljs-constant,.right .hljs-number,.right .hljs-params,.right .hljs-pragma,.right .hljs-preprocessor{color:#77BCD7}.right .css .hljs-rule .hljs-attribute,.right .ruby .hljs-class .hljs-title{color:#f0c674}.right .hljs-header,.right .hljs-inheritance,.right .hljs-name,.right .hljs-string,.right .hljs-value,.right .ruby .hljs-symbol,.right .xml .hljs-cdata{color:inherit}.right .coffeescript .hljs-title,.right .css .hljs-hexcolor,.right .hljs-function,.right .hljs-title,.right .javascript .hljs-title,.right .perl .hljs-sub,.right .python .hljs-decorator,.right .python .hljs-title,.right .ruby .hljs-function .hljs-title,.right .ruby .hljs-title .hljs-keyword{color:#f099a6}.right .hljs-keyword,.right .javascript .hljs-function{color:#EBDE68}.right .hljs{display:block;overflow-x:auto;background:#1d1f21;color:#c5c8c6;padding:.5em;-webkit-text-size-adjust:none}.right .coffeescript .javascript,.right .javascript .xml,.right .tex .hljs-formula,.right .xml .css,.right .xml .hljs-cdata,.right .xml .javascript,.right .xml .vbscript{opacity:.5}body{color:#4c555a;background:white;font:400 14px / 1.42 'Roboto',Helvetica,sans-serif}header{border-bottom:1px solid transparent;margin-bottom:12px}h1,h2,h3,h4,h5{color:#292e31;margin:12px 0}h1 .permalink,h2 .permalink,h3 .permalink,h4 .permalink,h5 .permalink{margin-left:0;opacity:0;transition:opacity .25s ease}h1:hover .permalink,h2:hover .permalink,h3:hover .permalink,h4:hover .permalink,h5:hover .permalink{opacity:1}.triple h1 .permalink,.triple h2 .permalink,.triple h3 .permalink,.triple h4 .permalink,.triple h5 .permalink{opacity:.15}.triple h1:hover .permalink,.triple h2:hover .permalink,.triple h3:hover .permalink,.triple h4:hover .permalink,.triple h5:hover .permalink{opacity:.15}h1{font:100 36px 'Roboto',Helvetica,sans-serif;font-size:36px}h2{font:100 36px 'Roboto',Helvetica,sans-serif;font-size:30px}h3{font-size:100%;text-transform:uppercase}h5{font-size:100%;font-weight:normal}p{margin:0 0 10px}p.choices{line-height:1.6}a{color:#0099e5;text-decoration:none}li p{margin:0}hr.split{border:0;height:1px;width:100%;padding-left:6px;margin:12px auto;background-image:linear-gradient(to right, rgba(76,85,90,0) 20%, rgba(76,85,90,0.2) 48%, rgba(221,228,232,0.2) 48%, rgba(221,228,232,0) 80%)}dl dt{float:left;width:130px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}dl dd{margin-left:150px}blockquote{color:rgba(76,85,90,0.5);font-size:15.5px;padding:10px 20px;margin:12px 0;border-left:5px solid #e8e8e8}blockquote p:last-child{margin-bottom:0}pre{background-color:#f5f5f5;padding:12px;border:1px solid #cfcfcf;border-radius:3px;overflow:auto}pre code{color:#4c555a;background-color:transparent;padding:0;border:none}code{color:#b93d6a;background-color:#f5f5f5;font:13px / 19.5px 'Source Code Pro',Menlo,monospace;padding:1px 4px;border:1px solid #cfcfcf;border-radius:3px}ul,ol{padding-left:2em}table{border-collapse:collapse;border-spacing:0;margin-bottom:12px}table tr:nth-child(2n){background-color:#fafafa}table th,table td{padding:6px 12px;border:1px solid #e6e6e6}.text-muted{opacity:.5}.note,.warning{padding:.3em 1em;margin:1em 0;border-radius:2px;font-size:90%}.note h1,.warning h1,.note h2,.warning h2,.note h3,.warning h3,.note h4,.warning h4,.note h5,.warning h5,.note h6,.warning h6{font-family:100 36px 'Roboto',Helvetica,sans-serif;font-size:135%;font-weight:500}.note p,.warning p{margin:.5em 0}.note{color:#4c555a;background-color:#ebf7fd;border-left:4px solid #0099e5}.note h1,.note h2,.note h3,.note h4,.note h5,.note h6{color:#0099e5}.warning{color:#4c555a;background-color:#faf0f4;border-left:4px solid #B82E5F}.warning h1,.warning h2,.warning h3,.warning h4,.warning h5,.warning h6{color:#B82E5F}header{margin-top:24px}nav{position:fixed;top:24px;bottom:0;overflow-y:auto}nav .resource-group{padding:0}nav .resource-group .heading{position:relative}nav .resource-group .heading .chevron{position:absolute;top:12px;right:12px;opacity:.5}nav .resource-group .heading a{display:block;color:#4c555a;opacity:.7;border-left:2px solid transparent;margin:0}nav .resource-group .heading a:hover{text-decoration:underline;background-color:transparent;border-left:2px solid transparent}nav ul{list-style-type:none;padding-left:0}nav ul a{display:block;font-size:13px;color:rgba(76,85,90,0.7);padding:8px 12px;border-top:1px solid transparent;border-left:2px solid transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nav ul a:hover{text-decoration:underline;background-color:transparent;border-left:2px solid transparent}nav ul>li{margin:0}nav ul>li:first-child{margin-top:-12px}nav ul>li:last-child{margin-bottom:-12px}nav ul ul a{padding-left:24px}nav ul ul li{margin:0}nav ul ul li:first-child{margin-top:0}nav ul ul li:last-child{margin-bottom:0}nav>div>div>ul>li:first-child>a{border-top:none}.preload *{transition:none !important}.pull-left{float:left}.pull-right{float:right}.badge{display:inline-block;float:right;min-width:10px;min-height:14px;padding:3px 7px;font-size:12px;color:black;background-color:transparent;border-radius:10px;margin:-2px -8px -2px 0}.badge.get{color:#fff;background-color:#ddf1fc}.badge.head{color:#fff;background-color:#ddf1fc}.badge.options{color:#fff;background-color:#ddf1fc}.badge.put{color:#fff;background-color:#f7f2c3}.badge.patch{color:#fff;background-color:#f7f2c3}.badge.post{color:#fff;background-color:#e4f2c8}.badge.delete{color:#fff;background-color:#f2d8e1}.collapse-button{float:right}.collapse-button .close{display:none;color:#0099e5;cursor:pointer}.collapse-button .open{color:#0099e5;cursor:pointer}.collapse-button.show .close{display:inline}.collapse-button.show .open{display:none}.collapse-content{max-height:0;overflow:hidden;transition:max-height .3s ease-in-out}nav{width:220px}.container{max-width:940px;margin-left:auto;margin-right:auto}.container .row .content{margin-left:244px;width:696px}.container .row:after{content:'';display:block;clear:both}.container-fluid nav{width:22%}.container-fluid .row .content{margin-left:24%}.container-fluid.triple nav{width:15%;padding-right:1px}.container-fluid.triple .row .content{position:relative;margin-left:15%;padding-left:24px}.middle:before,.middle:after{content:'';display:table}.middle:after{clear:both}.middle{box-sizing:border-box;width:48%;padding-right:12px}.right{box-sizing:border-box;float:right;width:52%;padding-left:12px}.right a{color:#0099e5}.right h1,.right h2,.right h3,.right h4,.right h5,.right p,.right div{color:#dde4e8}.right pre{background-color:#272B2D;border:1px solid #272B2D}.right pre code{color:#D0D0D0}.right .description{margin-top:12px}.triple .resource-heading{font-size:125%}.definition{margin-top:12px;margin-bottom:12px}.definition .method{font-weight:bold}.definition .method.get{color:#2e8ab8}.definition .method.head{color:#2e8ab8}.definition .method.options{color:#2e8ab8}.definition .method.post{color:#8ab82e}.definition .method.put{color:#b8aa2e}.definition .method.patch{color:#b8aa2e}.definition .method.delete{color:#b82e5f}.definition .uri{word-break:break-all;word-wrap:break-word}.definition .hostname{opacity:.5}.example-names{background-color:#eee;padding:12px;border-radius:3px}.example-names .tab-button{cursor:pointer;color:#4c555a;border:1px solid #ddd;padding:6px;margin-left:12px}.example-names .tab-button.active{background-color:#d5d5d5}.right .example-names{background-color:#424648}.right .example-names .tab-button{color:#dde4e8;border:1px solid #6C6F71;border-radius:3px}.right .example-names .tab-button.active{background-color:#5a6063}#nav-background{position:fixed;left:0;top:0;bottom:0;width:15%;padding-right:14.4px;background-color:#fafcfc;border-right:1px solid #f0f4f7;z-index:-1}#right-panel-background{position:absolute;right:-12px;top:-12px;bottom:-12px;width:52%;background-color:#2d3134;z-index:-1}@media (max-width:1200px){nav{width:198px}.container{max-width:840px}.container .row .content{margin-left:224px;width:606px}}@media (max-width:992px){nav{width:169.4px}.container{max-width:720px}.container .row .content{margin-left:194px;width:526px}}@media (max-width:768px){nav{display:none}.container{width:95%;max-width:none}.container .row .content,.container-fluid .row .content,.container-fluid.triple .row .content{margin-left:auto;margin-right:auto;width:95%}#nav-background{display:none}#right-panel-background{width:52%}}.back-to-top{position:fixed;z-index:1;bottom:0;right:24px;padding:4px 8px;color:rgba(76,85,90,0.5);background-color:transparent;text-decoration:none !important;border-top:1px solid transparent;border-left:1px solid transparent;border-right:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.resource-group{padding:12px 12px 12px 0;margin-bottom:12px;background-color:transparent;border:1px solid transparent;border-radius:3px}.resource-group h2.group-heading,.resource-group .heading a{padding:12px 12px 12px 0;margin:0 0 12px 0;background-color:transparent;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.triple .content .resource-group{padding:0;border:none}.triple .content .resource-group h2.group-heading,.triple .content .resource-group .heading a{margin:0 0 12px 0;border:1px solid transparent}nav .resource-group .heading a{padding:12px;margin-bottom:0}nav .resource-group .collapse-content{padding:0}.action{margin-bottom:12px;padding:12px 12px 0 12px;overflow:hidden;border:1px solid transparent;border-radius:3px}.action h4.action-heading{padding:6px 12px;margin:-12px -12px 12px -12px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px;overflow:hidden}.action h4.action-heading .name{float:right;font-weight:normal;padding:6px 0}.action h4.action-heading .method{padding:6px 12px;margin-right:12px;border-radius:2px;display:inline-block}.action h4.action-heading .method.get{color:#fff;background-color:#0099e5}.action h4.action-heading .method.head{color:#fff;background-color:#0099e5}.action h4.action-heading .method.options{color:#fff;background-color:#0099e5}.action h4.action-heading .method.put{color:#fff;background-color:#b1a74e}.action h4.action-heading .method.patch{color:#fff;background-color:#b1a74e}.action h4.action-heading .method.post{color:#fff;background-color:#85a546}.action h4.action-heading .method.delete{color:#fff;background-color:#c14a74}.action h4.action-heading code{color:#444;background-color:#f5f5f5;border-color:#cfcfcf;font-weight:normal;word-break:break-all;display:inline-block;margin-top:2px}.action dl.inner{padding-bottom:2px}.action .title{border-bottom:1px solid transparent;margin:0 -12px -1px -12px;padding:12px}.action.get{border-color:#ddf1fc}.action.get h4.action-heading{color:#0099e5;background:#ddf1fc;border-bottom-color:#ddf1fc}.action.head{border-color:#ddf1fc}.action.head h4.action-heading{color:#0099e5;background:#ddf1fc;border-bottom-color:#ddf1fc}.action.options{border-color:#ddf1fc}.action.options h4.action-heading{color:#0099e5;background:#ddf1fc;border-bottom-color:#ddf1fc}.action.post{border-color:#e4f2c8}.action.post h4.action-heading{color:#85a546;background:#e4f2c8;border-bottom-color:#e4f2c8}.action.put{border-color:#f7f2c3}.action.put h4.action-heading{color:#b1a74e;background:#f7f2c3;border-bottom-color:#f7f2c3}.action.patch{border-color:#f7f2c3}.action.patch h4.action-heading{color:#b1a74e;background:#f7f2c3;border-bottom-color:#f7f2c3}.action.delete{border-color:#f2d8e1}.action.delete h4.action-heading{color:#c14a74;background:#f2d8e1;border-bottom-color:#f2d8e1}</style></head><body class="preload"><div id="nav-background"></div><div class="container-fluid triple"><div class="row"><nav><div class="resource-group"><div class="heading"><div class="chevron"><i class="open fa fa-angle-down"></i></div><a href="#">Resource Group</a></div><div class="collapse-content"><ul><li><a href="#secret">Secret</a><ul><li><a href="#secret-get"><span class="badge get"><i class="fa fa-arrow-down"></i></span>Retrieve Secret</a></li><li><a href="#secret-post"><span class="badge post"><i class="fa fa-plus"></i></span>Retrieve Cloud Account Session</a></li><li><a href="#secret-post-1"><span class="badge post"><i class="fa fa-plus"></i></span>Retrieve Cloud Account Session via intermediary</a></li><li><a href="#secret-post-2"><span class="badge post"><i class="fa fa-plus"></i></span>Create Secret</a></li><li><a href="#secret-post-3"><span class="badge post"><i class="fa fa-plus"></i></span>Create Secret by example</a></li><li><a href="#secret-put"><span class="badge put"><i class="fa fa-pencil"></i></span>Update Secret</a></li><li><a href="#secret-delete"><span class="badge delete"><i class="fa fa-times"></i></span>Delete Secret</a></li><li><a href="#secret-delete-1"><span class="badge delete"><i class="fa fa-times"></i></span>Delete all Entity Secrets</a></li></ul></li><li><a href="#user">User</a><ul><li><a href="#user-put"><span class="badge put"><i class="fa fa-pencil"></i></span>Create User</a></li><li><a href="#user-delete"><span class="badge delete"><i class="fa fa-times"></i></span>Delete User</a></li><li><a href="#user-put-1"><span class="badge put"><i class="fa fa-pencil"></i></span>Update User access to secrets</a></li><li><a href="#user-post"><span class="badge post"><i class="fa fa-plus"></i></span>Login User to obtain Secrets Token</a></li></ul></li><li><a href="#apps-post"><span class="badge post"><i class="fa fa-plus"></i></span>Login App to obtain Secrets Token</a></li><li><a href="#token">Token</a><ul><li><a href="#token-post"><span class="badge post"><i class="fa fa-plus"></i></span>Renew Token</a></li><li><a href="#token-post-1"><span class="badge post"><i class="fa fa-plus"></i></span>Revoke Token</a></li></ul></li></ul></div></div><p style="text-align: center; word-wrap: break-word;"><a href="http://secrets.agilestacks.com/api/v1">http://secrets.agilestacks.com/api/v1</a></p></nav><div class="content"><div id="right-panel-background"></div><div class="middle"><header><h1 id="top">Secrets Service API</h1></header></div><div class="right"><h5>API Endpoint</h5><a href="http://secrets.agilestacks.com/api/v1">http://secrets.agilestacks.com/api/v1</a></div><div class="middle"><p>Secrets Service has protected HTTP API to provide access to all it’s functions, such as:</p>
<ul>
<li>
<p>saving and retrieving secrets;</p>
</li>
<li>
<p>obtaining expiring tokens to access cloud accounts;</p>
</li>
<li>
<p>manage secrets permissions.</p>
</li>
</ul>
<p>Please read <a href="https://github.com/agilestacks/secrets-service/blob/master/README.md">design</a> first.</p>
<p>There are several types of supported entities: <code>cloud-accounts</code>, <code>environments</code>, <code>templates</code>, <code>instances</code>,
<code>applications</code>, <code>licenses</code>, and <code>service-accounts</code>.</p>
<p>Supported types of <code>kind</code> field in secret object are: <code>password</code>, <code>cloudAccount</code>, <code>cloudAccessKeys</code>,
<code>privateKey</code>, <code>certificate</code>, <code>sshKey</code>, <code>usernamePassword</code>, <code>text</code>, <code>license</code>,
<code>token</code>, <code>bearerToken</code>, <code>accessToken</code>, <code>refreshToken</code>, and <code>loginToken</code>.</p>
<p>For <code>kind = 'cloudAccount'</code>, Secrets Service will check secret object <code>cloud</code> field is one of:
<code>aws</code>, <code>azure</code>, <code>gcp</code>.</p>
<p>For <code>cloud = 'aws'</code> Secret Service additionally accept <code>region</code> and <code>sts</code> AWS endpoint in
<code>https://sts(.region).amazonaws.com</code> format.</p>
</div><div class="middle"><section id="" class="resource-group"><h2 class="group-heading">Resource Group <a href="#" class="permalink">¶</a></h2></section></div><div class="middle"><div id="secret" class="resource"><h3 class="resource-heading">Secret <a href="#secret" class="permalink">¶</a></h3></div></div><div class="right"><div class="definition"><span class="method get">GET</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">environments</span>/<span class="hljs-attribute" title="entityId">123</span>/<span class="hljs-attribute" title="secretId">02a669c0-543b-432f-a11d-fb21f29c7200</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"02a669c0-543b-432f-a11d-fb21f29c7200"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"component.postgresql.password"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"password"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"automation-hub"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"jai0eite3X"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-get" class="action get"><h4 class="action-heading"><div class="name">Retrieve Secret</div><a href="#secret-get" class="method get">GET</a><code class="uri">/secrets/{entityKind}/{entityId}/{secretId}</code></h4><p>Reading cloud account entity returns original security-sensitive information masked.
The only way to use cloud account is to request session keys via <code>/session-keys</code>.</p>
<p>Password:</p>
<pre><code class="language-json">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"02a669c0-543b-432f-a11d-fb21f29c7200"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"component.postgresql.password"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"usernamePassword"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"automation-hub"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"jai0eite3X"</span>
</span>}</code></pre>
<p>Cloud account entity:</p>
<pre><code class="language-json">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"4ae21e5e-c49f-4222-b164-ffb03d8448dd"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"My AWS"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"cloudAccount"</span></span>,
"<span class="hljs-attribute">cloud</span>": <span class="hljs-value"><span class="hljs-string">"aws"</span></span>,
"<span class="hljs-attribute">accessKey</span>": <span class="hljs-value"><span class="hljs-string">"AKIA****************"</span></span>,
"<span class="hljs-attribute">secretKey</span>": <span class="hljs-value"><span class="hljs-string">"IqCFm0**********************************"</span>
</span>}</code></pre>
<pre><code class="language-json">{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"4ae21e5e-c49f-4222-b164-ffb03d8448dd"</span></span>,
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"My AWS"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"cloudAccount"</span></span>,
"<span class="hljs-attribute">cloud</span>": <span class="hljs-value"><span class="hljs-string">"aws"</span></span>,
"<span class="hljs-attribute">roleArn</span>": <span class="hljs-value"><span class="hljs-string">"arn:aws:iam::973998981304:role/xaccount-*********************"</span></span>,
"<span class="hljs-attribute">externalId</span>": <span class="hljs-value"><span class="hljs-string">"4f60642506******************************"</span></span>,
"<span class="hljs-attribute">duration</span>": <span class="hljs-value"><span class="hljs-number">7200</span>
</span>}</code></pre>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>environments</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd><dt>secretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>02a669c0-543b-432f-a11d-fb21f29c7200</span></span><p>ID of the Secret</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/cloud-accounts/<span class="hljs-attribute" title="cloudAccountId">123</span>/<span class="hljs-attribute" title="secretId">02a669c0-543b-432f-a11d-fb21f29c7200</span>/session-keys</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">purpose</span>": <span class="hljs-value"><span class="hljs-string">"stack-k8s-aws deployment"</span></span>,
"<span class="hljs-attribute">duration</span>": <span class="hljs-value"><span class="hljs-number">4800</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">405</span><span class="tab-button">504</span><span class="tab-button">502</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">cloud</span>": <span class="hljs-value"><span class="hljs-string">"aws"</span></span>,
"<span class="hljs-attribute">accessKey</span>": <span class="hljs-value"><span class="hljs-string">"AKIA****************"</span></span>,
"<span class="hljs-attribute">secretKey</span>": <span class="hljs-value"><span class="hljs-string">"IqCFm0**********************************"</span></span>,
"<span class="hljs-attribute">sessionToken</span>": <span class="hljs-value"><span class="hljs-string">"..."</span></span>,
"<span class="hljs-attribute">ttl</span>": <span class="hljs-value"><span class="hljs-number">7200</span></span>,
"<span class="hljs-attribute">_env</span>": <span class="hljs-value">{
"<span class="hljs-attribute">AWS_ACCESS_KEY_ID</span>": <span class="hljs-value"><span class="hljs-string">"..."</span></span>,
"<span class="hljs-attribute">AWS_SECRET_ACCESS_KEY</span>": <span class="hljs-value"><span class="hljs-string">"..."</span></span>,
"<span class="hljs-attribute">AWS_SESSION_TOKEN</span>": <span class="hljs-value"><span class="hljs-string">"..."</span>
</span>}
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"The requested secret is not `cloudAccount` kind"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"The requested secret is not `cloudAccount` kind"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: The requested secret is not `cloudAccount` kind...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"serverError"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"AWS STS error: ..."</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"serverError"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"AWS STS error: ..."</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: AWS STS error: ......js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-post" class="action post"><h4 class="action-heading"><div class="name">Retrieve Cloud Account Session</div><a href="#secret-post" class="method post">POST</a><code class="uri">/secrets/cloud-accounts/{cloudAccountId}/{secretId}/session-keys</code></h4><p>Post to cloud account session endpoint returns cloud-specific credentials to access cloud account.</p>
<p>For AWS a set of temporary security credentials are issued. The keys are valid for <code>duration</code> of the request
or of the secret, or the STS default of 1 hour.
Optionally, send <code>purpose</code> to be included as part of <em>role session name</em> sent to STS.
Optionally, set <code>region</code> and <code>sts</code> (endpoint).</p>
<p>For Azure and GCP as set of static credentials are returned.</p>
<p>If AWS cloud account credentials are <code>accessKey</code> and <code>secretKey</code> pair, then is must be keys either of account
root user or IAM user with MFA <strong>disabled</strong>. The session keys obtained cannot call IAM API due to
restriction imposed by AWS, from <a href="http://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html">STS GetSessionToken</a>:</p>
<blockquote>
<p>The temporary security credentials created by GetSessionToken can be used to make API calls to any AWS service with the following exceptions:</p>
<ul>
<li>You cannot call any IAM APIs unless MFA authentication information is included in the request.</li>
<li>You cannot call any STS API except AssumeRole or GetCallerIdentity.</li>
</ul>
</blockquote>
<p>Response object <code>_env: {}</code> field includes cloud-specific set of OS environment variable that should be exported
to get cloud CLIs and SDKs working with the cloud account. Additionally, <code>_envAsFiles: []</code> array indicates
which <code>_env</code> keys cannot be presented inline, but must be saved into file for native auth mechanism to pick-up
the settings, for example <code>"_envAsFiles": ["GOOGLE_APPLICATION_CREDENTIALS"]</code>, <code>"_envAsFiles": ["AZURE_CERTIFICATE_PATH"]</code>.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>cloudAccountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Cloud Account</p>
</dd><dt>secretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>02a669c0-543b-432f-a11d-fb21f29c7200</span></span><p>ID of the Secret</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/cloud-accounts/<span class="hljs-attribute" title="cloudAccountId">123</span>/<span class="hljs-attribute" title="secretId">02a669c0-543b-432f-a11d-fb21f29c7200</span>/session-keys/via/cloud-accounts/<span class="hljs-attribute" title="viaCloudAccountId">456</span>/<span class="hljs-attribute" title="viaSecretId">4676a1a6-dd9c-4f86-b4fc-9c049c0674e7</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span><br><span class="hljs-attribute">X-Via-Secrets-Token</span>: <span class="hljs-string">via-user-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{}</code></pre><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-post-1" class="action post"><h4 class="action-heading"><div class="name">Retrieve Cloud Account Session via intermediary</div><a href="#secret-post-1" class="method post">POST</a><code class="uri">/secrets/cloud-accounts/{cloudAccountId}/{secretId}/session-keys/via/cloud-accounts/{viaCloudAccountId}/{viaSecretId}</code></h4><p>First retrieve <code>viaSecretId</code> session, then retreve and return <code>secretId</code> session using that.
This works for AWS only. <code>X-Via-Secrets-Token</code> is used to fetch Via Secret from Vault.</p>
<p>The use case is to have a set of static credentials to assume (cross-account) role.
This allows (1) Secrets Service on-prem - without instance profile - to work with multiple AWS accounts;
(2) Secrets Service in public cloud to issue GovCloud session and vice versa.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>cloudAccountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Cloud Account</p>
</dd><dt>secretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>02a669c0-543b-432f-a11d-fb21f29c7200</span></span><p>ID of the Secret</p>
</dd><dt>viaCloudAccountId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>456</span></span><p>ID of the Via Cloud Account</p>
</dd><dt>viaSecretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>4676a1a6-dd9c-4f86-b4fc-9c049c0674e7</span></span><p>ID of the Via Secret</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">environments</span>/<span class="hljs-attribute" title="entityId">123</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"component.postgresql.password"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"usernamePassword"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"automation-hub"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"jai0eite3X"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">403</span><span class="tab-button">400</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">Location</span>: <span class="hljs-string">/api/v1/environments/123/secrets/02a669c0-543b-432f-a11d-fb21f29c7200</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"02a669c0-543b-432f-a11d-fb21f29c7200"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"Error parse JSON input"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"Error parse JSON input"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: Error parse JSON input...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-post-2" class="action post"><h4 class="action-heading"><div class="name">Create Secret</div><a href="#secret-post-2" class="method post">POST</a><code class="uri">/secrets/{entityKind}/{entityId}</code></h4><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>environments</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">instances</span>/<span class="hljs-attribute" title="entityId">123</span>/copy/<span class="hljs-attribute" title="fromEntityKind">instances</span>/<span class="hljs-attribute" title="fromEntityId">102</span>/<span class="hljs-attribute" title="fromId">4b71b933-f1e0-4a63-a113-6fb813cfb4a7</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"privateKey"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">403</span><span class="tab-button">409</span><span class="tab-button">400</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">Location</span>: <span class="hljs-string">/api/v1/instances/123/secrets/02a669c0-543b-432f-a11d-fb21f29c7200</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">id</span>": <span class="hljs-value"><span class="hljs-string">"02a669c0-543b-432f-a11d-fb21f29c7200"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"Error parse JSON input"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"Error parse JSON input"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: Error parse JSON input...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-post-3" class="action post"><h4 class="action-heading"><div class="name">Create Secret by example</div><a href="#secret-post-3" class="method post">POST</a><code class="uri">/secrets/{entityKind}/{entityId}/copy/{fromEntityKind}/{fromEntityId}/{fromId}</code></h4><p>Create a new secret by copying existing secret, optionally changing or adding secret’s fields.</p>
<p>If supplied, <code>kind</code> must match source secret <code>kind</code>. If <code>kind = 'cloudAccount'</code> is presented in the body, then
<code>cloud</code> must be specified and must match source secret <code>cloud</code>.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>instances</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd><dt>fromEntityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>instances</span></span><p>Source Entity type identifier</p>
</dd><dt>fromEntityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>102</span></span><p>Source ID of the Entity</p>
</dd><dt>fromId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>4b71b933-f1e0-4a63-a113-6fb813cfb4a7</span></span><p>Source Secret ID</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method put">PUT</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">environments</span>/<span class="hljs-attribute" title="entityId">123</span>/<span class="hljs-attribute" title="secretId">02a669c0-543b-432f-a11d-fb21f29c7200</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">name</span>": <span class="hljs-value"><span class="hljs-string">"component.postgresql.password"</span></span>,
"<span class="hljs-attribute">kind</span>": <span class="hljs-value"><span class="hljs-string">"password"</span></span>,
"<span class="hljs-attribute">username</span>": <span class="hljs-value"><span class="hljs-string">"automation-hub"</span></span>,
"<span class="hljs-attribute">password</span>": <span class="hljs-value"><span class="hljs-string">"jai0eite3X"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">400</span><span class="tab-button">409</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`password` field is not set"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`password` field is not set"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: `password` field is not set...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`kind` doesn't match"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`kind` doesn't match"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: `kind` doesn't match...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-put" class="action put"><h4 class="action-heading"><div class="name">Update Secret</div><a href="#secret-put" class="method put">PUT</a><code class="uri">/secrets/{entityKind}/{entityId}/{secretId}</code></h4><p>The secret <code>kind</code> must match otherwise <code>409 Conflict</code> will be returned.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>environments</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd><dt>secretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>02a669c0-543b-432f-a11d-fb21f29c7200</span></span><p>ID of the Secret</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">environments</span>/<span class="hljs-attribute" title="entityId">123</span>/<span class="hljs-attribute" title="secretId">02a669c0-543b-432f-a11d-fb21f29c7200</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete Secret</div><a href="#secret-delete" class="method delete">DELETE</a><code class="uri">/secrets/{entityKind}/{entityId}/{secretId}</code></h4><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>environments</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd><dt>secretId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>02a669c0-543b-432f-a11d-fb21f29c7200</span></span><p>ID of the Secret</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/secrets/<span class="hljs-attribute" title="entityKind">instances</span>/<span class="hljs-attribute" title="entityId">123</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">user-token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="secret-delete-1" class="action delete"><h4 class="action-heading"><div class="name">Delete all Entity Secrets</div><a href="#secret-delete-1" class="method delete">DELETE</a><code class="uri">/secrets/{entityKind}/{entityId}</code></h4><p>Recursively delete all secrets under specific path.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>instances</span></span><p>Entity type identifier</p>
</dd><dt>entityId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>123</span></span><p>ID of the Entity</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><div id="user" class="resource"><h3 class="resource-heading">User <a href="#user" class="permalink">¶</a></h3><p>User is currently an Okta user and is addressed by Okta user Id with prefix <code>okta-</code>, e.g. <code>okta-00ub0oNGTSWTBKOLGLNR</code>.</p>
</div></div><div class="right"><div class="definition"><span class="method put">PUT</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/users/<span class="hljs-attribute" title="userId">okta-00ub0oNGTSWTBKOLGLNR</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">high-privilege-auth-service-token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">201</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">roleId</span>": <span class="hljs-value"><span class="hljs-string">"f2db06c7-1b3c-9262-1116-fa1842a5c567"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="user-put" class="action put"><h4 class="action-heading"><div class="name">Create User</div><a href="#user-put" class="method put">PUT</a><code class="uri">/users/{userId}</code></h4><p>Returned <code>roleId</code> must be saved by calling service for use with <code>/login</code>. This method is idempotent and it will reset the
policies associated with the role in case role already exist. (Policies controls access to Environment, Cloud
Account, etc. secrets)</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>userId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>okta-00ub0oNGTSWTBKOLGLNR</span></span><p>ID of the User</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method delete">DELETE</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/users/<span class="hljs-attribute" title="userId">okta-00ub0oNGTSWTBKOLGLNR</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">high-privilege-auth-service-token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="user-delete" class="action delete"><h4 class="action-heading"><div class="name">Delete User</div><a href="#user-delete" class="method delete">DELETE</a><code class="uri">/users/{userId}</code></h4><div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>userId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>okta-00ub0oNGTSWTBKOLGLNR</span></span><p>ID of the User</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method put">PUT</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/users/<span class="hljs-attribute" title="userId">okta-00ub0oNGTSWTBKOLGLNR</span>/<span class="hljs-attribute" title="entityKind">environments</span></span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">high-privilege-automation-hub-token | high-privilege-auth-service-token?</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">environments</span>": <span class="hljs-value">[
<span class="hljs-string">"env id 1"</span>,
<span class="hljs-string">"env id 2"</span>
]</span>,
"<span class="hljs-attribute">cloudAccounts</span>": <span class="hljs-value">[
<span class="hljs-string">"cloud account id 1"</span>,
<span class="hljs-string">"cloud account id 2"</span>
]</span>,
"<span class="hljs-attribute">etc.</span>": <span class="hljs-value">[]
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">400</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code><span class="hljs-string">"errors"</span>: [
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`environments` field is not set"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"errors"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"badRequest"</span>,
<span class="hljs-string">"detail"</span>: <span class="hljs-string">"`environments` field is not set"</span>,
<span class="hljs-string">"meta"</span>: {
<span class="hljs-string">"stack"</span>:<span class="hljs-string">"Error: `environments` field is not set...js:76:19)"</span>
}
}
}
}
]
}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="user-put-1" class="action put"><h4 class="action-heading"><div class="name">Update User access to secrets</div><a href="#user-put-1" class="method put">PUT</a><code class="uri">/users/{userId}/{entityKind}</code></h4><p>Put a list of <code>entityKind</code> <code>Id</code>-s the user has access to.
Only one corresponding key must be specified in request body.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>userId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>okta-00ub0oNGTSWTBKOLGLNR</span></span><p>ID of the User</p>
</dd><dt>entityKind</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>environments</span></span><p>Entity type identifier</p>
</dd></dl></div></div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/users/<span class="hljs-attribute" title="userId">okta-00ub0oNGTSWTBKOLGLNR</span>/login</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span><br><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">low-privilege-auth-service-token</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">roleId</span>": <span class="hljs-value"><span class="hljs-string">"0dcc3856-c11b-9673-bd30-b083cbae4987"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">400</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">token</span>": <span class="hljs-value"><span class="hljs-string">"c9086cfc-c1a4-4609-546d-1f9d860c8ac3"</span></span>,
"<span class="hljs-attribute">ttl</span>": <span class="hljs-value"><span class="hljs-number">3600</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">errors</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"badRequest"</span></span>,
"<span class="hljs-attribute">detail</span>": <span class="hljs-value"><span class="hljs-string">"Either `highPrivRoleId` or `lowPrivRoleId` field is not set"</span></span>,
"<span class="hljs-attribute">meta</span>": <span class="hljs-value">{
"<span class="hljs-attribute">errors</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"badRequest"</span></span>,
"<span class="hljs-attribute">detail</span>": <span class="hljs-value"><span class="hljs-string">"Either `highPrivRoleId` or `lowPrivRoleId` field is not set"</span></span>,
"<span class="hljs-attribute">meta</span>": <span class="hljs-value">{
"<span class="hljs-attribute">stack</span>": <span class="hljs-value"><span class="hljs-string">"Error: Either `highPrivRoleId` or `lowPrivRoleId`...js:76:19)"</span>
</span>}
</span>}
</span>}
</span>}
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="user-post" class="action post"><h4 class="action-heading"><div class="name">Login User to obtain Secrets Token</div><a href="#user-post" class="method post">POST</a><code class="uri">/users/{userId}/login</code></h4><p>Login to obtain <code>user-token</code>.</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>userId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>okta-00ub0oNGTSWTBKOLGLNR</span></span><p>ID of the User</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><div id="apps" class="resource"><h3 class="resource-heading">Apps <a href="#apps" class="permalink">¶</a></h3><p>Currently recognised apps are:</p>
<ul>
<li>
<p>Authentication Service with Id <code>authentication-service</code>;</p>
</li>
<li>
<p>Automation Hub with Id <code>automation-hub</code>.</p>
</li>
</ul>
<p>Request source IP CIDR will be checked too.</p>
</div></div><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/apps/<span class="hljs-attribute" title="appId">authentication-service</span>/login</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">highPrivRoleId</span>": <span class="hljs-value"><span class="hljs-string">"f696ed85-eab6-484f-8f1b-adac94cffc08"</span></span>,
"<span class="hljs-attribute">lowPrivRoleId</span>": <span class="hljs-value"><span class="hljs-string">"41bc5ff3-077c-4613-9419-77fe89267113"</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">404</span><span class="tab-button">403</span><span class="tab-button">400</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">highPrivToken</span>": <span class="hljs-value"><span class="hljs-string">"89b144e3-d785-46b4-ac3f-5cc504bfc624"</span></span>,
"<span class="hljs-attribute">lowPrivToken</span>": <span class="hljs-value"><span class="hljs-string">"4f5b5510-a6ac-41e1-b4bc-bcff4f522769"</span></span>,
"<span class="hljs-attribute">ttl</span>": <span class="hljs-value"><span class="hljs-number">3600</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json; charset=utf-8</span></code></pre><div style="height: 1px;"></div><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">errors</span>": <span class="hljs-value">[
{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"badRequest"</span></span>,
"<span class="hljs-attribute">detail</span>": <span class="hljs-value"><span class="hljs-string">"`highPrivRoleId` field is not set"</span></span>,
"<span class="hljs-attribute">meta</span>": <span class="hljs-value">{
"<span class="hljs-attribute">errors</span>": <span class="hljs-value">{
"<span class="hljs-attribute">type</span>": <span class="hljs-value"><span class="hljs-string">"badRequest"</span></span>,
"<span class="hljs-attribute">detail</span>": <span class="hljs-value"><span class="hljs-string">"`highPrivRoleId` field is not set"</span></span>,
"<span class="hljs-attribute">meta</span>": <span class="hljs-value">{
"<span class="hljs-attribute">stack</span>": <span class="hljs-value"><span class="hljs-string">"Error: `highPrivRoleId` field is not set...js:76:19)"</span>
</span>}
</span>}
</span>}
</span>}
]
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="apps-post" class="action post"><h4 class="action-heading"><div class="name">Login App to obtain Secrets Token</div><a href="#apps-post" class="method post">POST</a><code class="uri">/apps/{appId}/login</code></h4><p>Login to obtain <code>high</code> and <code>low-privilege-auth-service-token</code>-s .</p>
<div class="title"><strong>URI Parameters</strong><div class="collapse-button show"><span class="close">Hide</span><span class="open">Show</span></div></div><div class="collapse-content"><dl class="inner"><dt>appId</dt><dd><code>string</code> <span class="required">(required)</span> <span class="text-muted example"><strong>Example: </strong><span>authentication-service</span></span><p>ID of the Service / App</p>
</dd></dl></div></div></div><hr class="split"><div class="middle"><div id="token" class="resource"><h3 class="resource-heading">Token <a href="#token" class="permalink">¶</a></h3></div></div><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/tokens/renew</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">200</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><h5>Body</h5><pre><code>{
"<span class="hljs-attribute">ttl</span>": <span class="hljs-value"><span class="hljs-number">3600</span>
</span>}</code></pre><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="token-post" class="action post"><h4 class="action-heading"><div class="name">Renew Token</div><a href="#token-post" class="method post">POST</a><code class="uri">/tokens/renew</code></h4><p><code>X-Secrets-Token</code> is the token to operate on.</p>
</div></div><hr class="split"><div class="right"><div class="definition"><span class="method post">POST</span> <span class="uri"><span class="hostname">http://secrets.agilestacks.com/api/v1</span>/tokens/revoke</span></div><div class="tabs"><div class="example-names"><span>Requests</span><span class="tab-button">example 1</span></div><div class="tab"><div><div class="inner"><h5>Headers</h5><pre><code><span class="hljs-attribute">X-Secrets-Token</span>: <span class="hljs-string">token</span></code></pre><div style="height: 1px;"></div></div></div><div class="tabs"><div class="example-names"><span>Responses</span><span class="tab-button">204</span><span class="tab-button">403</span><span class="tab-button">502</span><span class="tab-button">504</span></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div><div class="tab"><div><div class="inner"><div class="description text-muted">This response has no content.</div><div style="height: 1px;"></div></div></div></div></div></div></div></div><div class="middle"><div id="token-post-1" class="action post"><h4 class="action-heading"><div class="name">Revoke Token</div><a href="#token-post-1" class="method post">POST</a><code class="uri">/tokens/revoke</code></h4><p>Authentication Service should revoke user token on user logout.</p>
<p><code>X-Secrets-Token</code> is the token to operate on.</p>
</div></div><hr class="split"><div class="middle"><p style="text-align: center;" class="text-muted">Generated by <a href="https://github.com/danielgtaylor/aglio" class="aglio">aglio</a> on 02 May 2020</p></div></div></div></div><script>/* eslint-env browser */
/* eslint quotes: [2, "single"] */
'use strict';
/*
Determine if a string ends with another string.
*/
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
/*
Get a list of direct child elements by class name.
*/
function childrenByClass(element, name) {
var filtered = [];
for (var i = 0; i < element.children.length; i++) {
var child = element.children[i];
var classNames = child.className.split(' ');
if (classNames.indexOf(name) !== -1) {
filtered.push(child);
}
}
return filtered;
}
/*
Get an array [width, height] of the window.
*/
function getWindowDimensions() {
var w = window,
d = document,
e = d.documentElement,
g = d.body,
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight || e.clientHeight || g.clientHeight;
return [x, y];
}
/*
Collapse or show a request/response example.
*/
function toggleCollapseButton(event) {
var button = event.target.parentNode;
var content = button.parentNode.nextSibling;
var inner = content.children[0];
if (button.className.indexOf('collapse-button') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it
button.className = 'collapse-button';
content.style.maxHeight = '0px';
} else {
// Currently hidden, so let's show it
button.className = 'collapse-button show';
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
function toggleTabButton(event) {
var i, index;
var button = event.target;
// Get index of the current button.
var buttons = childrenByClass(button.parentNode, 'tab-button');
for (i = 0; i < buttons.length; i++) {
if (buttons[i] === button) {
index = i;
button.className = 'tab-button active';
} else {
buttons[i].className = 'tab-button';
}
}
// Hide other tabs and show this one.
var tabs = childrenByClass(button.parentNode.parentNode, 'tab');
for (i = 0; i < tabs.length; i++) {
if (i === index) {
tabs[i].style.display = 'block';
} else {
tabs[i].style.display = 'none';
}
}
}
/*
Collapse or show a navigation menu. It will not be hidden unless it
is currently selected or `force` has been passed.
*/
function toggleCollapseNav(event, force) {
var heading = event.target.parentNode;
var content = heading.nextSibling;
var inner = content.children[0];
if (heading.className.indexOf('heading') === -1) {
// Clicked without hitting the right element?
return;
}
if (content.style.maxHeight && content.style.maxHeight !== '0px') {
// Currently showing, so let's hide it, but only if this nav item
// is already selected. This prevents newly selected items from
// collapsing in an annoying fashion.
if (force || window.location.hash && endsWith(event.target.href, window.location.hash)) {
content.style.maxHeight = '0px';
}
} else {
// Currently hidden, so let's show it
content.style.maxHeight = inner.offsetHeight + 12 + 'px';
}
}
/*
Refresh the page after a live update from the server. This only
works in live preview mode (using the `--server` parameter).
*/
function refresh(body) {
document.querySelector('body').className = 'preload';
document.body.innerHTML = body;
// Re-initialize the page
init();
autoCollapse();
document.querySelector('body').className = '';
}
/*
Determine which navigation items should be auto-collapsed to show as many
as possible on the screen, based on the current window height. This also
collapses them.
*/
function autoCollapse() {
var windowHeight = getWindowDimensions()[1];
var itemsHeight = 64; /* Account for some padding */
var itemsArray = Array.prototype.slice.call(
document.querySelectorAll('nav .resource-group .heading'));
// Get the total height of the navigation items
itemsArray.forEach(function (item) {
itemsHeight += item.parentNode.offsetHeight;
});
// Should we auto-collapse any nav items? Try to find the smallest item
// that can be collapsed to show all items on the screen. If not possible,
// then collapse the largest item and do it again. First, sort the items
// by height from smallest to largest.
var sortedItems = itemsArray.sort(function (a, b) {
return a.parentNode.offsetHeight - b.parentNode.offsetHeight;
});
while (sortedItems.length && itemsHeight > windowHeight) {
for (var i = 0; i < sortedItems.length; i++) {
// Will collapsing this item help?
var itemHeight = sortedItems[i].nextSibling.offsetHeight;
if ((itemsHeight - itemHeight <= windowHeight) || i === sortedItems.length - 1) {
// It will, so let's collapse it, remove its content height from
// our total and then remove it from our list of candidates
// that can be collapsed.
itemsHeight -= itemHeight;
toggleCollapseNav({target: sortedItems[i].children[0]}, true);
sortedItems.splice(i, 1);
break;
}
}
}
}
/*
Initialize the interactive functionality of the page.
*/
function init() {
var i, j;
// Make collapse buttons clickable
var buttons = document.querySelectorAll('.collapse-button');
for (i = 0; i < buttons.length; i++) {
buttons[i].onclick = toggleCollapseButton;
// Show by default? Then toggle now.
if (buttons[i].className.indexOf('show') !== -1) {
toggleCollapseButton({target: buttons[i].children[0]});
}
}
var responseCodes = document.querySelectorAll('.example-names');
for (i = 0; i < responseCodes.length; i++) {
var tabButtons = childrenByClass(responseCodes[i], 'tab-button');
for (j = 0; j < tabButtons.length; j++) {
tabButtons[j].onclick = toggleTabButton;
// Show by default?
if (j === 0) {
toggleTabButton({target: tabButtons[j]});
}
}
}
// Make nav items clickable to collapse/expand their content.
var navItems = document.querySelectorAll('nav .resource-group .heading');
for (i = 0; i < navItems.length; i++) {
navItems[i].onclick = toggleCollapseNav;
// Show all by default
toggleCollapseNav({target: navItems[i].children[0]});
}
}
// Initial call to set up buttons
init();
window.onload = function () {
autoCollapse();
// Remove the `preload` class to enable animations
document.querySelector('body').className = '';
};
</script></body></html>