-
Notifications
You must be signed in to change notification settings - Fork 2
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
S2a options set default LocalIdentity for ClientOptions #61
Conversation
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @davisgu and @matthewstevenson88)
security/s2a/s2a_options.go, line 95 at r1 (raw file):
return &s2apb.Identity{IdentityOneof: &s2apb.Identity_Hostname{Hostname: id.Name()}}, nil default: return nil, errors.New("unrecognized identity type")
I was thinking that instead of returning something in the default case, we should check at the very beginning of this function if the identity passed is nil
and return return nil, nil
in that case. WDYT?
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @matthewstevenson88 and @Ryanfsdf)
security/s2a/s2a_options.go, line 95 at r1 (raw file):
Previously, Ryanfsdf (Ryan Kim) wrote…
I was thinking that instead of returning something in the default case, we should check at the very beginning of this function if the identity passed is
nil
and returnreturn nil, nil
in that case. WDYT?
+1.
We still want the error case when the type is unrecognized.
Also, please add a unit test that checks whatever code path we add.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Ryanfsdf)
security/s2a/s2a_options.go, line 95 at r1 (raw file):
Previously, matthewstevenson88 wrote…
+1.
We still want the error case when the type is unrecognized.
Also, please add a unit test that checks whatever code path we add.
That makes sense abt the unrecognized type, but if the identity passed is nil
, shouldn't we then return the default?
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @Ryanfsdf)
security/s2a/s2a_options.go, line 95 at r1 (raw file):
Previously, davisgu wrote…
That makes sense abt the unrecognized type, but if the identity passed is
nil
, shouldn't we then return the default?
Done.
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @Ryanfsdf)
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.
Reviewable status: 0 of 2 files reviewed, all discussions resolved
This change is