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

Streamline signing API #233

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Streamline signing API #233

merged 2 commits into from
Mar 14, 2024

Conversation

djc
Copy link
Member

@djc djc commented Feb 29, 2024

IMO this is a more idiomatic API. I don't love the sign_self() name but haven't come up with anything better.

Alternatives:

  • Change the names to be more passive voice (signed_by()?), since conceptually the params are what's being signed
  • Move these methods to KeyPair instead -- this avoids the active/passive confusion but seems conceptually weird

@djc djc requested review from cpu and est31 February 29, 2024 12:42
@djc djc force-pushed the sign-api branch 2 times, most recently from 80fbb90 to 59c7fb3 Compare February 29, 2024 15:32
Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

Change the names to be more passive voice (signed_by()?), since conceptually the params are what's being signed

I don't find the approach in this branch too awkward, but this option sounds a little bit better. Was there a reason you hesitated to select it up-front? I suppose it's more common for this sort of function to be named in an active tense?

rcgen/src/lib.rs Outdated Show resolved Hide resolved
rcgen/src/lib.rs Outdated Show resolved Hide resolved
@djc
Copy link
Member Author

djc commented Mar 11, 2024

Used self_signed() and signed_by() -- what do you think?

@djc djc force-pushed the sign-api branch 3 times, most recently from d2a5e0d to 9ef10af Compare March 11, 2024 15:40
Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

I like the names you landed on 👍

Copy link
Member

@est31 est31 left a comment

Choose a reason for hiding this comment

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

self_signed and signed_by are good names!

@djc djc added this pull request to the merge queue Mar 14, 2024
@djc djc removed this pull request from the merge queue due to a manual request Mar 14, 2024
@djc djc added this pull request to the merge queue Mar 14, 2024
Merged via the queue into main with commit 89e13be Mar 14, 2024
42 checks passed
@djc djc deleted the sign-api branch March 14, 2024 06:22
@djc djc mentioned this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants