-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
shawn-hurley
commented
Feb 28, 2018
- 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
pkg/broker/logic.go
Outdated
Request *http.Request | ||
Writer http.ResponseWriter | ||
Request *http.Request | ||
Identity Identity |
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.
Note for readers, I'm talking to Shawn in real life, these are notes only.
Take this out for now.
pkg/rest/apisurface.go
Outdated
@@ -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) |
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 part moves to unpack
pkg/rest/apisurface.go
Outdated
c := &broker.RequestContext{ | ||
Writer: w, | ||
Request: r, | ||
Writer: w, |
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.
Populate the originating identity field of the osb.Xrequest
pkg/broker/user_info.go
Outdated
return nil, fmt.Errorf("unable decode identity value") | ||
} | ||
switch strings.ToLower(platform) { | ||
case "kubernetes": |
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.
Make these (in a separate PR, if you please) methods that give you back the right formulation
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. |
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.
Just a couple nits, otherwise LGTM. Fix these and I will merge.
pkg/rest/apisurface.go
Outdated
return osbRequest, nil | ||
} | ||
|
||
func retrieveOriginatingIdentity(r *http.Request) (*osb.OriginatingIdentity, 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.
Will you add a godoc comment to this method?
pkg/server/deprovision_test.go
Outdated
@@ -74,6 +75,20 @@ func TestDeprovision(t *testing.T) { | |||
Async: true, | |||
}, | |||
}, | |||
{ | |||
name: "deprovision passes originating origin idenity is passed", |
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.
name sounds a little off
LGTM, thanks @shawn-hurley |
add travis badge