-
Notifications
You must be signed in to change notification settings - Fork 460
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
Use dnsNamesSubsetValidator for IID provisioners #2044
Conversation
... when disableCustomSANs is set to 'true'. The DNS names in the certificate request must be a subset of the authorized set of DNS names (from the IID token). The previous functionality required that the DNS names in the certificate request exactly matched the authorized DNS names.
allowed := make(map[string]bool) | ||
for _, s := range v { | ||
allowed[s] = true | ||
} | ||
for _, s := range req.DNSNames { | ||
if _, ok := allowed[s]; !ok { |
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.
This can probably become map[string]struct
, and its capacity can be set to len(v), so something like make(map[string]struct, 0, len(v))
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.
Herman's comments make sense, fix them and I'll approve it
Co-authored-by: Herman Slatman <[email protected]>
Co-authored-by: Herman Slatman <[email protected]>
... when disableCustomSANs is set to 'true'.
The DNS names in the certificate request must be a subset of the authorized set of DNS names (from the IID token). The previous functionality required that the DNS names in the certificate request exactly matched the authorized DNS names.