Skip to content

Commit

Permalink
Merge pull request #25 from shawn-hurley/optional-originating-identity
Browse files Browse the repository at this point in the history
making originating origin header optional in unpack request functions
  • Loading branch information
lilic authored Mar 10, 2018
2 parents 3b20fe8 + 47b5054 commit 34c1336
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pkg/rest/apisurface.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ func unpackProvisionRequest(r *http.Request) (*osb.ProvisionRequest, error) {
osbRequest.AcceptsIncomplete = true
}
identity, err := retrieveOriginatingIdentity(r)
// This could be not found because platforms may support the feature
// but are not guaranteed to.
if err != nil {
return nil, err
glog.Infof("Unable to retrieve originating identity - %v", err)
}

osbRequest.OriginatingIdentity = identity

return osbRequest, nil
Expand Down Expand Up @@ -180,8 +183,10 @@ func unpackDeprovisionRequest(r *http.Request) (*osb.DeprovisionRequest, error)
osbRequest.AcceptsIncomplete = true
}
identity, err := retrieveOriginatingIdentity(r)
// This could be not found because platforms may support the feature
// but are not guaranteed to.
if err != nil {
return nil, err
glog.Infof("Unable to retrieve originating identity - %v", err)
}
osbRequest.OriginatingIdentity = identity

Expand Down Expand Up @@ -291,8 +296,10 @@ func unpackBindRequest(r *http.Request) (*osb.BindRequest, error) {
osbRequest.InstanceID = vars[osb.VarKeyInstanceID]
osbRequest.BindingID = vars[osb.VarKeyBindingID]
identity, err := retrieveOriginatingIdentity(r)
// This could be not found because platforms may support the feature
// but are not guaranteed to.
if err != nil {
return nil, err
glog.Infof("Unable to retrieve originating identity - %v", err)
}

osbRequest.OriginatingIdentity = identity
Expand Down Expand Up @@ -341,8 +348,10 @@ func unpackUnbindRequest(r *http.Request) (*osb.UnbindRequest, error) {
osbRequest.BindingID = vars[osb.VarKeyBindingID]

identity, err := retrieveOriginatingIdentity(r)
// This could be not found because platforms may support the feature
// but are not guaranteed to.
if err != nil {
return nil, err
glog.Infof("Unable to retrieve originating identity - %v", err)
}
osbRequest.OriginatingIdentity = identity

Expand Down Expand Up @@ -399,8 +408,10 @@ func unpackUpdateRequest(r *http.Request) (*osb.UpdateInstanceRequest, error) {
}

identity, err := retrieveOriginatingIdentity(r)
// This could be not found because platforms may support the feature
// but are not guaranteed to.
if err != nil {
return nil, err
glog.Infof("Unable to retrieve originating identity - %v", err)
}
osbRequest.OriginatingIdentity = identity

Expand Down

0 comments on commit 34c1336

Please sign in to comment.