Skip to content

Add an authorizing proxy for a backing Kube - #839

Merged
openshift-bot merged 4 commits into
openshift:masterfrom
smarterclayton:add_auth_proxy
Feb 3, 2015
Merged

openshift-bot merged 4 commits into
openshift:masterfrom
smarterclayton:add_auth_proxy

Conversation

@smarterclayton

Copy link
Copy Markdown
Contributor

Need to set our credentials onto the underlying request still.

@smarterclayton

Copy link
Copy Markdown
Contributor Author

This needs an upstream change to split our registration into two restful.Containers, one for secured and one for not.

@smarterclayton

Copy link
Copy Markdown
Contributor Author

[test] @liggitt @deads2k review

@smarterclayton smarterclayton changed the title WIP - Add an authorizing proxy for a backing Kube Add an authorizing proxy for a backing Kube Feb 3, 2015
@openshift-bot

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks a little weird. Is this restricting me to only being able to do a get for my own user? I would have expected that requesting a different user's information would be restricted by some special policy handler, not via url rewriting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is adding a filter in front of getting any user that looks for ~ and transforms it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not seeing it. Is currentUserContextFilter supposed to be checking for a '~' before doing a replacement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, copy and paste fail.

----- Original Message -----

for _, svc := range container.RegisteredWebServices() {
    switch svc.RootPath() {
    case "/":
        root = svc
    case OpenShiftAPIPrefixV1Beta1:
        svc.Doc("OpenShift REST API, version v1beta1").ApiVersion("v1beta1")
  •       // add the current user filter
    
  •       // TODO: factor this better
    
  •       filter := currentUserContextFilter(c.getRequestsToUsers())
    
  •       routes := svc.Routes()
    
  •       for i := range routes {
    
  •           route := &routes[i]
    
  •           if route.Method == "GET" && (route.Path ==
    
    OpenShiftAPIPrefixV1Beta1+"/ns/{namespace}/users/{name}" || route.Path ==
    OpenShiftAPIPrefixV1Beta1+"/users/{name}") {

I'm not seeing it. Is currentUserContextFilter supposed to be checking for a
'~' before doing a replacement?


Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/839/files#r24010928

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which highlights how abysmal our tests of auth and the master are right now. Follow up item we need to come back to is that test-cmd needs to be validating auth, test-integration needs to be reusing the master code (not inventing its own), and this stuff needs to be unit tested more effectively.

----- Original Message -----

Good catch, copy and paste fail.

----- Original Message -----

for _, svc := range container.RegisteredWebServices() {
switch svc.RootPath() {
case "/":
root = svc
case OpenShiftAPIPrefixV1Beta1:
svc.Doc("OpenShift REST API, version v1beta1").ApiVersion("v1beta1")
+

  •     // add the current user filter
    
  •     // TODO: factor this better
    
  •     filter := currentUserContextFilter(c.getRequestsToUsers())
    
  •     routes := svc.Routes()
    
  •     for i := range routes {
    
  •         route := &routes[i]
    
  •         if route.Method == "GET" && (route.Path ==
    
    OpenShiftAPIPrefixV1Beta1+"/ns/{namespace}/users/{name}" || route.Path ==
    OpenShiftAPIPrefixV1Beta1+"/users/{name}") {

I'm not seeing it. Is currentUserContextFilter supposed to be checking for
a
'~' before doing a replacement?


Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/839/files#r24010928

@smarterclayton

Copy link
Copy Markdown
Contributor Author

Did you have other comments?

@liggitt / @deads2k we need to do this to the rest of the registries
Fixed broken behavior in our authorizer when dealing with unrecognized
paths. We need to separate the upstream more clearly into protected
and unprotected paths.
Performs authentication and authorization in the OpenShift filters,
then connects to the backend as the OpenShift core user. In the
future, we will want to enforce a delegation pattern so the
underlying Kube is aware of the identity of the user as well.
@deads2k

deads2k commented Feb 3, 2015

Copy link
Copy Markdown
Contributor

lgtm

@smarterclayton

Copy link
Copy Markdown
Contributor Author

[merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/787/) (Image: devenv-fedora_671)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin up to b21d54d

openshift-bot pushed a commit that referenced this pull request Feb 3, 2015
@openshift-bot
openshift-bot merged commit 3836fb8 into openshift:master Feb 3, 2015
@smarterclayton
smarterclayton deleted the add_auth_proxy branch May 18, 2015 02:16
jpeeler pushed a commit to jpeeler/origin that referenced this pull request Feb 1, 2018
* first pass

* generated code

* update docs for osbguid to externalid
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.

3 participants