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

Various cherry picks from v2 onto v3 #286

Merged
merged 5 commits into from
Jan 11, 2021

Conversation

ericchiang
Copy link
Collaborator

Includes #266, #261, #255, #254

Copy link
Collaborator

@mikedanese mikedanese left a comment

Choose a reason for hiding this comment

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

Spot checked for anything that looked breaking. LGTM.

oidc/oidc.go Outdated
Comment on lines 399 to 417
func (sb *stringAsBool) UnmarshalJSON(b []byte) error {
var result bool
err := json.Unmarshal(b, &result)
if err == nil {
*sb = stringAsBool(result)
return nil
}
var s string
err = json.Unmarshal(b, &s)
if err != nil {
return err
}
result, err = strconv.ParseBool(s)
if err != nil {
return err
}
*sb = stringAsBool(result)
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.

This might be simpler:

func (sb *stringAsBool) UnmarshalJSON(b []byte) error {
	switch string(b) {
	case "true", `"true"`:
		*sb = stringAsBool(true)
	case "false", `"false"`:
		*sb = stringAsBool(false)
	default:
		return errors.New("wat")
	}
	return nil
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea. Added as a separate commit to preserve commit history.

@ericchiang ericchiang merged commit fbec1bd into coreos:v3 Jan 11, 2021
@ericchiang ericchiang deleted the v3-cherry-picks branch January 11, 2021 17:51
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.

5 participants