-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
generate-credentials-database.hbs
103 lines (102 loc) · 3.11 KB
/
generate-credentials-database.hbs
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
<PageHeader as |p|>
<p.top>
<nav class="breadcrumb">
<ul>
<li>
<span class="sep">/</span>
<LinkTo @route="vault.cluster.secrets.backend.overview" @model={{@backendPath}}>
{{@backendPath}}
</LinkTo>
</li>
</ul>
</nav>
</p.top>
<p.levelLeft>
<h1 data-test-title class="title is-3">
{{@roleName}}
</h1>
</p.levelLeft>
</PageHeader>
<div class={{if @roleType "box is-fullwidth is-sideless is-marginless"}}>
{{!-- If no role type, that means both static and dynamic requests returned an error --}}
{{#unless @roleType }}
<EmptyState
@title={{errorTitle}}
@subTitle="Error {{@model.errorHttpStatus}}"
@icon="alert-circle-outline"
@bottomBorder={{true}}
@message={{@model.errorMessage}}
>
<nav class="breadcrumb">
<ul class="is-grouped-split">
<li>
{{!-- Empty because they can't go "back" anywhere --}}
</li>
<li>
<LearnLink @path="/vault/database-secrets" @class="has-text-grey">
Need help?
</LearnLink>
</li>
</ul>
</nav>
</EmptyState>
{{/unless}}
{{#if (and (not @model.errorMessage) (eq @roleType 'dynamic'))}}
<AlertBanner
@type="warning"
@message="You will not be able to access these credentials later, so please copy them now."
data-test-warning
/>
{{/if}}
{{!-- DYNAMIC ROLE --}}
{{#if (and (eq @roleType 'dynamic') @model.username)}}
<InfoTableRow @label="Username" @value={{@model.username}}>
<MaskedInput
@value={{@model.username}}
@name="Username"
@displayOnly={{true}}
@allowCopy={{true}}
/>
</InfoTableRow>
<InfoTableRow @label="Password" @value={{@model.password}}>
<MaskedInput
@value={{@model.password}}
@name="Password"
@displayOnly={{true}}
@allowCopy={{true}}
/>
</InfoTableRow>
<InfoTableRow @label="Lease ID" @value={{@model.leaseId}} />
<InfoTableRow @label="Lease Duration" @value={{format-duration @model.leaseDuration }} />
{{/if}}
{{!-- STATIC ROLE --}}
{{#if (and (eq @roleType 'static') @model.username)}}
<InfoTableRow
@label="Last Vault rotation"
@value={{date-format @model.lastVaultRotation 'MMMM d yyyy, h:mm:ss a'}}
@tooltipText={{@model.lastVaultRotation}}
@isTooltipCopyable={{true}}
/>
<InfoTableRow @label="Password" @value={{@model.password}}>
<MaskedInput
@value={{@model.password}}
@name="Password"
@displayOnly={{true}}
@allowCopy={{true}}
/>
</InfoTableRow>
<InfoTableRow @label="Username" @value={{@model.username}} />
<InfoTableRow @label="Rotation Period" @value={{format-duration @model.rotationPeriod}} />
<InfoTableRow @label="Time Remaining" @value={{format-duration @model.ttl}} />
{{/if}}
</div>
<div class="has-top-bottom-margin">
<button
type="button"
onclick={{action "redirectPreviousPage"}}
class="button is-primary"
data-test-secret-generate-back="true"
>
Back
</button>
</div>