Commit e53aa938 authored by CJ Cullen's avatar CJ Cullen

Add Subresource & Name to webhook authorizer.

parent 4638f2f3
...@@ -154,7 +154,10 @@ func (w *WebhookAuthorizer) Authorize(attr authorizer.Attributes) (err error) { ...@@ -154,7 +154,10 @@ func (w *WebhookAuthorizer) Authorize(attr authorizer.Attributes) (err error) {
Namespace: attr.GetNamespace(), Namespace: attr.GetNamespace(),
Verb: attr.GetVerb(), Verb: attr.GetVerb(),
Group: attr.GetAPIGroup(), Group: attr.GetAPIGroup(),
Version: attr.GetAPIVersion(),
Resource: attr.GetResource(), Resource: attr.GetResource(),
Subresource: attr.GetSubresource(),
Name: attr.GetName(),
} }
} else { } else {
r.Spec.NonResourceAttributes = &v1beta1.NonResourceAttributes{ r.Spec.NonResourceAttributes = &v1beta1.NonResourceAttributes{
......
...@@ -435,7 +435,10 @@ func TestWebhook(t *testing.T) { ...@@ -435,7 +435,10 @@ func TestWebhook(t *testing.T) {
Verb: "GET", Verb: "GET",
Namespace: "kittensandponies", Namespace: "kittensandponies",
APIGroup: "group3", APIGroup: "group3",
APIVersion: "v7beta3",
Resource: "pods", Resource: "pods",
Subresource: "proxy",
Name: "my-pod",
ResourceRequest: true, ResourceRequest: true,
Path: "/foo", Path: "/foo",
}, },
...@@ -448,7 +451,10 @@ func TestWebhook(t *testing.T) { ...@@ -448,7 +451,10 @@ func TestWebhook(t *testing.T) {
Verb: "GET", Verb: "GET",
Namespace: "kittensandponies", Namespace: "kittensandponies",
Group: "group3", Group: "group3",
Version: "v7beta3",
Resource: "pods", Resource: "pods",
Subresource: "proxy",
Name: "my-pod",
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment