-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ext authz: add dns san support for ext authz service #7948
Changes from 1 commit
a7cbf3d
465a783
3da1534
98a9866
7899e4f
06f669a
d552c3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -45,14 +45,24 @@ void CheckRequestUtils::setAttrContextPeer(envoy::service::auth::v2::AttributeCo | |||||||
if (local) { | ||||||||
const auto uriSans = ssl->uriSanLocalCertificate(); | ||||||||
if (uriSans.empty()) { | ||||||||
peer.set_principal(ssl->subjectLocalCertificate()); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you update the comment on
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the comment. |
||||||||
const auto dnsSans = ssl->dnsSansLocalCertificate(); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||||||||
if (dnsSans.empty()) { | ||||||||
peer.set_principal(ssl->subjectLocalCertificate()); | ||||||||
} else { | ||||||||
peer.set_principal(dnsSans[0]); | ||||||||
} | ||||||||
} else { | ||||||||
peer.set_principal(uriSans[0]); | ||||||||
} | ||||||||
} else { | ||||||||
const auto uriSans = ssl->uriSanPeerCertificate(); | ||||||||
if (uriSans.empty()) { | ||||||||
peer.set_principal(ssl->subjectPeerCertificate()); | ||||||||
const auto dnsSans = ssl->dnsSansPeerCertificate(); | ||||||||
if (dnsSans.empty()) { | ||||||||
peer.set_principal(ssl->subjectPeerCertificate()); | ||||||||
} else { | ||||||||
peer.set_principal(dnsSans[0]); | ||||||||
} | ||||||||
} else { | ||||||||
peer.set_principal(uriSans[0]); | ||||||||
} | ||||||||
|
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.
Nit: already there, but
uri_sans