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

Implement SecretType::into_secret #272

Merged
merged 1 commit into from
May 7, 2024
Merged

Implement SecretType::into_secret #272

merged 1 commit into from
May 7, 2024

Conversation

IvanUkhov
Copy link
Contributor

Closes #271.

#[doc = $secret_doc]
///
/// # Security Warning
///
/// Leaking this value may compromise the security of the OAuth2 flow.
pub fn secret(&self) -> &$type { &self.0 }

#[doc = $secret_doc]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Repeating the same docstring, as it is rather general.

#[test]
fn test_secret_conversion() {
let secret = CsrfToken::new("top_secret".into());
assert_eq!(secret.into_secret().into_boxed_str(), "top_secret".into());
Copy link
Contributor Author

@IvanUkhov IvanUkhov May 7, 2024

Choose a reason for hiding this comment

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

Just to use a method present exclusively in the owned value.

@ramosbugs ramosbugs merged commit daf4db6 into ramosbugs:main May 7, 2024
4 checks passed
@ramosbugs
Copy link
Owner

Thanks!

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.

Implement SecretType::into_secret
2 participants