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

UI: pki import issuer #18634

Merged
merged 8 commits into from
Jan 10, 2023
Merged

UI: pki import issuer #18634

merged 8 commits into from
Jan 10, 2023

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Jan 9, 2023

This PR imports the issuer along with adds the serial number data to the certificate parsing helper

import-issuer

} else {
// TODO WIP generate
const type = 'root' || 'generate';
// record.type is internal or exported
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the pattern I used for generating vs importing a pki key here

const { record, adapterOptions } = snapshot;
let url = this.urlForQuery(record.backend);
if (adapterOptions.import) {
url = `${url}/import/bundle`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Docs

issuers/import/bundle accepts both certificate and keys, issuers/import/cert only accepts a certificate and errors if sent a key. After chatting with crypto, confirmed that UI should just use /bundle

Copy link
Collaborator

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Great work, thanks!!

url = `${url}/import/bundle`;
} else {
// TODO WIP generate
const type = 'root' || 'generate';
Copy link
Collaborator

Choose a reason for hiding this comment

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

The type here will never be generate, am I reading that right? If this is still WIP maybe it's best to throw an error or assertion here so we don't forget about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think i mis-typed this and it should be root or intermediate

@@ -43,9 +44,13 @@ export function parseCertificate(certificateContent) {
// field themselves are Time values.
const expiryDate = cert?.notAfter?.value;
const issueDate = cert?.notBefore?.value;
const serialNumber = Convert.ToHex(cert.serialNumber.valueBlock.valueHex)
Copy link
Collaborator

Choose a reason for hiding this comment

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

😵

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah 🥴 this took way longer than I want to admit

@hellobontempo hellobontempo merged commit 6462873 into main Jan 10, 2023
@hellobontempo hellobontempo deleted the ui/VAULT-9262/import-issuer-pki branch January 10, 2023 00:46
joshbrand pushed a commit that referenced this pull request Jan 11, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
AnPucel pushed a commit that referenced this pull request Jan 14, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
dhuckins pushed a commit that referenced this pull request Jan 19, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
dhuckins pushed a commit that referenced this pull request Jan 19, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
AnPucel pushed a commit that referenced this pull request Jan 25, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
AnPucel pushed a commit that referenced this pull request Feb 3, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
jayant07-yb pushed a commit to jayant07-yb/hashicorp-vault-integrations that referenced this pull request Mar 15, 2023
* create pki ca import component

* add serial number to cert parser

* convert to ts

* remove comments

* reset yarn.lock

* fixed yarn lock

* fix comment

* add declaration for base cert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants