-
Notifications
You must be signed in to change notification settings - Fork 475
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
Allow for use of privateKey instead of privateCert #488
Conversation
Minimize mentions of `privateCert` to minimize confusion.
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 has code/docs/tests and is backward compatible. It looks good to me. I updated the docs to further simplify them and focus on the clearer privateKey
name instead of the less clear "private cert".
Assigning to @cjbarth for a second look.
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 just have one suggestion, but I don't think it should block this merge.
@@ -15,15 +16,15 @@ interface SignSamlPostOptions { | |||
export function signSamlPost(samlMessage: string, xpath: string, options: SignSamlPostOptions) { | |||
if (!samlMessage) throw new Error('samlMessage is required'); | |||
if (!xpath) throw new Error('xpath is required'); | |||
if (!options || !options.privateCert) throw new Error('options.privateCert is required'); | |||
if (!options || (!options.privateCert && !options.privateKey)) throw new Error('options.privateCert or options.privateKey is required'); |
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.
What do you think of issuing a deprecation warning if someone is using privateCert
? This way, we can remove this extra code with a future semver-major release.
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.
@cjbarth That's OK if you want to add the warning.
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.
👋 Thank you Alon! I hope you are doing well :)
I'm going to go ahead and merge this. We can add a deprecation warning in a future release. It will clean up the code to eventually not support both names. |
An updated PR to address the conversation here: #387