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

implement originating origin identity #2

Merged
merged 3 commits into from
Mar 3, 2018

Conversation

shawn-hurley
Copy link
Contributor

  • added a interface to the context
  • Exposing the concrete classes for casting if wanted

* added a interface to the context
* Exposing the concrete classes for casting if wanted
Request *http.Request
Writer http.ResponseWriter
Request *http.Request
Identity Identity
Copy link
Owner

Choose a reason for hiding this comment

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

Note for readers, I'm talking to Shawn in real life, these are notes only.

Take this out for now.

@@ -79,9 +80,16 @@ func (s *APISurface) ProvisionHandler(w http.ResponseWriter, r *http.Request) {

glog.Infof("Received ProvisionRequest for instanceID %q", request.InstanceID)

identity, err := retrieveOriginatingIdentity(r)
Copy link
Owner

Choose a reason for hiding this comment

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

This part moves to unpack

c := &broker.RequestContext{
Writer: w,
Request: r,
Writer: w,
Copy link
Owner

Choose a reason for hiding this comment

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

Populate the originating identity field of the osb.Xrequest

return nil, fmt.Errorf("unable decode identity value")
}
switch strings.ToLower(platform) {
case "kubernetes":
Copy link
Owner

Choose a reason for hiding this comment

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

Make these (in a separate PR, if you please) methods that give you back the right formulation

@shawn-hurley
Copy link
Contributor Author

I updated based on the comments and I also took a stab at adding a test case for making sure the Originating Origin Identity is being set.

Copy link
Owner

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

Just a couple nits, otherwise LGTM. Fix these and I will merge.

return osbRequest, nil
}

func retrieveOriginatingIdentity(r *http.Request) (*osb.OriginatingIdentity, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

Will you add a godoc comment to this method?

@@ -74,6 +75,20 @@ func TestDeprovision(t *testing.T) {
Async: true,
},
},
{
name: "deprovision passes originating origin idenity is passed",
Copy link
Owner

Choose a reason for hiding this comment

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

name sounds a little off

@pmorie
Copy link
Owner

pmorie commented Mar 3, 2018

LGTM, thanks @shawn-hurley

@pmorie pmorie merged commit 09f9a56 into pmorie:master Mar 3, 2018
jboyd01 pushed a commit to jboyd01/osb-broker-lib that referenced this pull request Apr 17, 2018
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