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

add global jwt_issuer_format option #52

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

@kenjenkins kenjenkins requested a review from wasaga March 13, 2025 22:37
@kenjenkins kenjenkins requested a review from a team as a code owner March 13, 2025 22:37
// 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'
Copy link
Collaborator

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.

Copy link
Author

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
Copy link
Collaborator

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)

Copy link
Author

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?

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.

2 participants