-
Notifications
You must be signed in to change notification settings - Fork 0
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
add global jwt_issuer_format option #52
base: main
Are you sure you want to change the base?
Conversation
internal/provider/convert.go
Outdated
// ToIssuerFormat converts a JWT issuer format string into a protobuf enum. | ||
func ToIssuerFormat(src types.String) *pb.IssuerFormat { | ||
switch src.ValueString() { | ||
case "host_only", "hostOnly": // the Core YAML config expects 'hostOnly' |
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.
I don't think you can do alternative names with just a String base type - that would require a custom type - otherwise i.e. if you use hostOnly
originally in your .tf file, next time the configuration is read, the FromIssuerFormat
would return host_only
value and terraform would think configuration was changed.
for simplicity we need to use just one variant.
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.
OK, removed "hostOnly".
case "uri": | ||
return pb.IssuerFormat_IssuerURI.Enum() | ||
default: | ||
return nil |
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.
I think we need to differentiate between a nil or unknown string (results in a nil
) and a value that we did not recognize (results in an error)
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.
OK, how does this look?
Related issue: https://linear.app/pomerium/issue/ENG-2072/config-jwt-issuer-format-should-also-be-support-at-the-global-level