1<PageHeader as |p|>
2  <p.top>
3    <KmipBreadcrumb @scope={{this.scope}} @role={{this.role}}/>
4  </p.top>
5  <p.levelLeft>
6    <h1 class="title is-3">
7      Credentials
8    </h1>
9  </p.levelLeft>
10</PageHeader>
11<Toolbar>
12  <ToolbarActions>
13    <ToolbarLink
14      @params={{array "credentials.index" this.scope this.role}}
15      data-test-kmip-link-back-to-role
16    >
17      Back to role
18    </ToolbarLink>
19    {{#if model.deletePath.canDelete}}
20      <ModelWrap as |m|>
21        <ConfirmAction
22          @buttonClasses="toolbar-link"
23          @onConfirmAction={{action
24            (perform
25              m.callMethod
26              "destroyRecord"
27              model
28              "Successfully revoked credentials"
29              "There was an error revoking credentials"
30              (transition-to "vault.cluster.secrets.backend.kmip.credentials.index" this.scope this.role)
31            )
32          }}
33          @confirmTitle="Revoke this?"
34          @confirmMessage="Any client using these credentials will no longer be able to."
35          @cancelButtonText="Cancel"
36          @confirmButtonText="Revoke"
37          >
38            Revoke credentials
39        </ConfirmAction>
40      </ModelWrap>
41    {{/if}}
42    <CopyButton
43      class="toolbar-link"
44      @clipboardText={{model.certificate}}
45      @success={{action (set-flash-message "Certificate Copied!")}}
46      data-test-copy-button
47    >
48      Copy certificate
49      <Chevron />
50    </CopyButton>
51  </ToolbarActions>
52</Toolbar>
53<div class="box is-shadowless is-fullwidth is-sideless">
54  <InfoTableRow
55    @label="Serial number"
56    @value={{model.id}}
57  />
58  <InfoTableRow
59    @label="Private key"
60    @value={{model.privateKey}}
61  >
62    <div class="is-block">
63    <AlertBanner
64      @type="warning"
65      @message="You will not be able to access the private key later, so please copy the information below."
66      data-test-warning
67    />
68    <MaskedInput
69      @value={{model.privateKey}}
70      @name="Private key"
71      @allowCopy={{true}}
72      @displayOnly={{true}}
73      class="is-block"
74    />
75    </div>
76  </InfoTableRow>
77  <InfoTableRow
78    @label="Certificate"
79    @value={{model.certificate}}
80  />
81  <InfoTableRow
82    @label="CA Chain"
83    @value={{model.caChain}}
84  >
85    <div class="is-block">
86      {{#each model.caChain as |chain|}}
87        <code class="is-block is-word-break has-text-black">{{chain}}</code>
88      {{/each}}
89    </div>
90  </InfoTableRow>
91</div>
92