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

S2a options set default LocalIdentity for ClientOptions #61

Merged
merged 4 commits into from
Jul 29, 2020

Conversation

davisgu
Copy link
Collaborator

@davisgu davisgu commented Jul 29, 2020

This change is Reviewable

Copy link
Collaborator

@Ryanfsdf Ryanfsdf left a 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?

Copy link
Owner

@matthewstevenson88 matthewstevenson88 left a 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 return return 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.

Copy link
Collaborator Author

@davisgu davisgu left a 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?

Copy link
Collaborator Author

@davisgu davisgu left a 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.

Copy link
Owner

@matthewstevenson88 matthewstevenson88 left a 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)

Copy link
Collaborator

@Ryanfsdf Ryanfsdf left a 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

@davisgu davisgu merged commit 9226b66 into master Jul 29, 2020
@davisgu davisgu deleted the s2a-options-fix branch July 29, 2020 23:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants