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

Allow to clone a Identity #1334

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Allow to clone a Identity #1334

merged 1 commit into from
Sep 29, 2021

Conversation

silvioprog
Copy link
Contributor

For example, it can be useful when we need to store an Identity in a hash map. (I'm facing exactly this problem in a small project I'm developing)

@silvioprog
Copy link
Contributor Author

Hey guys, what do you think about this PR? Any questions/changes?! 🙂

Copy link
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Seems find to me! The only concern would be if at some future point, we added support for a certificate type that couldn't be clone. Does that seem likely? That is probably why I didn't have that implementation in the first place, and I couldn't think of a time you'd want to construct an Identity and then clone it. I don't have a strong opinion. If you have thought about that point, I'd welcome hearing.

I'm fine merging as long we make sure to have thought about any potential consequences :)

@silvioprog
Copy link
Contributor Author

Seems find to me! The only concern would be if at some future point, we added support for a certificate type that couldn't be clone. Does that seem likely? That is probably why I didn't have that implementation in the first place, and I couldn't think of a time you'd want to construct an Identity and then clone it. I don't have a strong opinion. If you have thought about that point, I'd welcome hearing.

I'm not sure if I'll help, but I'll comment based on my experience in the last companies I worked for. Many applications keep certificates in files or in a database. Depending on the certificate type, it demands a lot of processing to be loaded at run time, this way, we [pre]load it to a temporary list, in general, a hashed list using the user Unique Identifier as key and filled by demand. This is one of the reasons why a clonable Identity could help a lot. But there are many other situations that a clonable structure can help, even in situations with a single certificate file involved. For example, when the user needs to serve some web service through TLS authentication handled by a Warp filter or an Axum extension (I'm facing this second situation, but handling a lot of certificates).

I'm fine merging as long we make sure to have thought about any potential consequences :)

It would be really appreciated. I'm not so experienced with Rust, but a type that allows to be used inside lists is very required in many cases.

@seanmonstar seanmonstar merged commit cf87893 into seanmonstar:master Sep 29, 2021
@silvioprog
Copy link
Contributor Author

Thanks a lot for applying!

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

2 participants