-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI: pki import issuer #18634
Conversation
ui/app/adapters/pki/issuer.js
Outdated
} else { | ||
// TODO WIP generate | ||
const type = 'root' || 'generate'; | ||
// record.type is internal or exported |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks!!
ui/app/adapters/pki/issuer.js
Outdated
url = `${url}/import/bundle`; | ||
} else { | ||
// TODO WIP generate | ||
const type = 'root' || 'generate'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😵
There was a problem hiding this comment.
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
* 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
* 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
This PR imports the issuer along with adds the serial number data to the certificate parsing helper