Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display CertificateCard instead of MaskedInput for certificates in PKI #22160

Merged

Conversation

malinac02
Copy link
Contributor

@malinac02 malinac02 commented Aug 1, 2023

Description:
In the PKI secrets engine, the <MaskedInput> component is for several attributes: Certificate, CA Chain, Issuing CA, CSR, and Private Key. This PR changes this so that now these attributes are shown using the <CertificateCard> component instead. (For reference, <CertificateCard> is also used in the Kubernetes secret engine, on the configuration page)

Unlike with the <MaskedInput>, the data now shown with the <CertificateCard> is...

  • Not masked
  • Truncated
  • Shown beneath the format of that data (PEM Format or DER Format)
    • (Note: sometimes the format shown isn't the format that the user chose. This discrepancy is on the backend. The UI just looks at the data, determines what format it is in, and renders the format type in the card)

Reproduction steps:
The <CertificateCard> shows up in many places. Three examples are when you configure the PKI engine, generate a new Issuer, or view a certificate in the certificates tab. <CertificateCard> shows up for the attributes Certificate, CA Chain, Issuing CA, CSR, and Private Key.

Before:
PKI Before

After:
PKI After
DER Format example

@malinac02 malinac02 added ui hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed labels Aug 1, 2023
@malinac02 malinac02 added this to the 1.15 milestone Aug 1, 2023
…more inclusive of different uses of CertificateCard (i.e when used for a private key, not a certificate). add description to certificate-card.js
…reflect the change from MaskedInput to CertificateCard
@malinac02 malinac02 marked this pull request as ready for review August 10, 2023 00:34
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I left some comments but nothing blocking from my perspective 🎉

ui/app/models/pki/action.js Outdated Show resolved Hide resolved
…onent CertificateCard. edit pki-certificate-details.hbs to get rid of extraneous code
@malinac02 malinac02 merged commit bfe89a4 into main Aug 10, 2023
@malinac02 malinac02 deleted the ui/VAULT-18490/display-CertificateCard-for-certificates-in-PKI branch August 10, 2023 23:48
hellobontempo pushed a commit that referenced this pull request Aug 18, 2023
#22160)

* replaced each instance of MaskedInput in PKI with CertificateCard

* modify tests for pki-generate-csr

* add test for pki-issuer-details. modify test for pki-certificate-details

* added test for pki-key-details. modified test for pki-sign-intermediate-form

* update 2 test helper files and modify test for pki-issuer-rotate-root

* update test for certificate-card-test.js, update test for the kubernetes configuration-test.js

* modify pki-action-forms-test.js to no longer look for masked input. expand test for pki-issuer-details-test.js to check for all issuer details

* change CertificateCard to show different format types (PEM, DER, nothing) depending on the value provided. update 2 test files to account for this.

* change CertificateCard arg name from @certficateValue to @DaTa to be more inclusive of different uses of CertificateCard (i.e when used for a private key, not a certificate). add description to certificate-card.js

* change naming for attr.options.masked to attr.options.displayCard to reflect the change from MaskedInput to CertificateCard

* add changelog

* change attribute to isCertificate to better fit the title of the component CertificateCard. edit pki-certificate-details.hbs to get rid of extraneous code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants