Skip to content

Fixing build break in using client_certificate credentials #1018

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

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

msabansal
Copy link
Contributor

@msabansal msabansal commented Aug 16, 2022

The identity SDK doesn't build anymore when trying to build with feature client_certificate. This PR addresses the issue.

Also added a full build on the SDK

@rylev
Copy link
Contributor

rylev commented Aug 17, 2022

@msabansal I'm not sure exactly what this fix does. Can you please include a detailed description of the bug being fixed?

@@ -130,16 +135,17 @@ struct AadTokenResponse {
access_token: String,
}

fn get_encoded_cert(cert: &X509) -> Result<String, ClientCertificateCredentialError> {
fn get_encoded_cert(cert: &X509) -> Result<String, azure_core::error::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fn get_encoded_cert(cert: &X509) -> Result<String, azure_core::error::Error> {
fn get_encoded_cert(cert: &X509) -> azure_core::Result<String> {

@msabansal
Copy link
Contributor Author

@rylev Added the description. I am not sure why the build is passing.

If someone can point me to how i can fix the test for this i am happy to do that

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

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

I'm going to merge this since things are broken on master, but if you have time to do a follow up addressing the comments here, that would be amazing.

@@ -174,7 +180,7 @@ impl TokenCredential for ClientCertificateCredential {
let chain = chain
.into_iter()
.map(|x| get_encoded_cert(&x))
.collect::<Result<Vec<String>, ClientCertificateCredentialError>>()?
.collect::<Result<Vec<String>, azure_core::error::Error>>()?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.collect::<Result<Vec<String>, azure_core::error::Error>>()?
.collect::<azure_core::Result<Vec<String>>>()?

Comment on lines +145 to +147
fn openssl_error() -> azure_core::error::Error {
Error::message(ErrorKind::Credential, "Openssl decode error")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to use the same error message for all of these errors. It makes it hard to tell what actually went wrong.

@rylev rylev merged commit 87d99e2 into Azure:main Aug 18, 2022
@cataggar cataggar added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants