-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix SAMLForceAuthn
marshalling
#48098
Conversation
api/types/mfa.go
Outdated
@@ -173,3 +175,113 @@ func (d *MFADevice) UnmarshalJSON(buf []byte) error { | |||
err := unmarshaler.Unmarshal(bytes.NewReader(buf), d) | |||
return trace.Wrap(err) | |||
} | |||
|
|||
// MarshalJSON marshals SAMLForceAuthn to string. | |||
func (s *SAMLForceAuthn) MarshalYAML() (interface{}, 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.
Here and everywhere else prefer using any over interface{}
func (s *SAMLForceAuthn) MarshalYAML() (interface{}, error) { | |
func (s *SAMLForceAuthn) MarshalYAML() (any, 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.
This actually need to be interface{}
for this to implement yaml.Marshaler
, apparently interface{}
isn't treated exactly like any
. Changed it where I could though.
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.
Can you add some test coverage?
2d272f0
to
fc9990f
Compare
fc9990f
to
e3b49d2
Compare
Follow up to #46703 to fix json/yaml marshalling to/from string/bool. This way, you can set it like: