k3s/api/swagger-spec
Kubernetes Submit Queue 16454277aa Merge pull request #29930 from ericchiang/rbac-validation-dont-mix-non-resource-urls-and-resources
Automatic merge from submit-queue

rbac validation: rules can't combine non-resource URLs and regular resources

This PR updates the validation used for RBAC to prevent rules from mixing non-resource URLs and regular resources.

For example the following is no longer valid

```yml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: admins
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
    nonResourceURLs: ["*"]
```

And must be rewritten as so.

```yml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: admins
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
  - nonResourceURLs: ["*"]
    verbs: ["*"]
``` 

It also:
* Mandates non-zero length arrays for required resources.
* Mandates non-resource URLs only be used for ClusterRoles (not namespaced Roles).
* Updates the swagger validation so `verbs` are the only required field in a rule. Further validation is done by the server.

Also, do we need to bump the API version?

Discussed by @erictune and @liggitt  in #28304

Updates kubernetes/features#2

cc @kubernetes/sig-auth 

Edit:
* Need to update the RBAC docs if this change goes in.
2016-08-04 04:52:51 -07:00
..
api.json Running hack/update-swagger-spec.sh 2016-06-03 11:21:29 -07:00
apis.json Fixed several typos 2016-07-13 15:06:24 +01:00
apps.json Fixed several typos 2016-07-13 15:06:24 +01:00
apps_v1alpha1.json Consolidated examples into storage/ and volume/ folders 2016-07-08 13:34:32 -07:00
authentication.k8s.io.json generated code changes 2016-08-03 08:37:45 -04:00
authentication.k8s.io_v1.json generated code changes 2016-08-03 08:37:45 -04:00
authentication.k8s.io_v1beta1.json generated code changes 2016-08-03 08:37:45 -04:00
autoscaling.json Fixed several typos 2016-07-13 15:06:24 +01:00
autoscaling_v1.json Represent unversioned.Time correctly in swagger spec 2016-07-01 23:23:19 -07:00
batch.json Fixed several typos 2016-07-13 15:06:24 +01:00
batch_v1.json Consolidated examples into storage/ and volume/ folders 2016-07-08 13:34:32 -07:00
batch_v2alpha1.json Running hack/update-swagger-spec.sh 2016-06-03 11:21:29 -07:00
certificates.json Update swagger spec with changes.. 2016-07-13 15:16:32 +01:00
certificates_v1alpha1.json make CertificateSigningRequestList.Items a required field 2016-07-22 13:19:48 -07:00
extensions.json Fixed several typos 2016-07-13 15:06:24 +01:00
extensions_v1beta1.json API Changes for StorageClass 2016-07-28 19:01:01 -04:00
policy.json Fixed several typos 2016-07-13 15:06:24 +01:00
policy_v1alpha1.json Represent unversioned.Time correctly in swagger spec 2016-07-01 23:23:19 -07:00
rbac.authorization.k8s.io.json Fixed several typos 2016-07-13 15:06:24 +01:00
rbac.authorization.k8s.io_v1alpha1.json *: regenerate all 2016-08-02 13:33:34 -07:00
resourceListing.json generated code changes 2016-08-03 08:37:45 -04:00
v1.json Consolidated examples into storage/ and volume/ folders 2016-07-08 13:34:32 -07:00
version.json Merge pull request #25731 from Pensu/master 2016-06-06 12:06:32 -07:00