You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take the example `APIExport` from above and add permission claims for `ConfigMaps` and `Things`:
185
187
186
188
```yaml
@@ -211,10 +213,18 @@ spec:
211
213
4. `"*"` is a special "verb" that matches any possible verb
212
214
213
215
This is essentially a request from the API provider, asking each consumer to grant permission for the claimed
214
-
resources. If the consumer does not accept a permission claim, the API provider is not allowed to access the claimed
215
-
resources. Consumer acceptance of permission claims is part of the `APIBinding` spec. The operations allowed on the
216
-
resource are the intersection of the verbs defined in the `APIExport` and the verbs accepted in the appropriate
217
-
`APIBinding`. For more details, see the section on [APIBindings](#apibinding).
216
+
resources. The consumer can, via `APIBinding`, accept or reject the service provider's request to access these
217
+
resources, i.e. accept or reject PermissionClaims.
218
+
219
+
Additionally, the consumer can choose between giving access to all instances (objects) of a claimed resource
220
+
and giving access only to a subset of instances. In the latter case, the consumer can specify labels when accepting
221
+
the PermissionClaim, so the service provider can only access instances which have these specified labels
222
+
(this is also known as a label selector).
223
+
224
+
The set of operations that the service provider can perform on the claimed resource is the intersection of the verbs
225
+
defined in the `APIExport` and the verbs accepted in the appropriate `APIBinding`.
226
+
227
+
For more details, see the section on [APIBindings](#apibinding).
218
228
219
229
### Maximal Permission Policy
220
230
@@ -420,8 +430,13 @@ spec:
420
430
421
431
#### Permission Claims
422
432
423
-
Furthermore, `APIBindings` provide the `APIExport` owner access to additional resources defined in an `APIExport`'s permission claims list. Permission claims must be accepted by the user explicitly, before this access is granted. The resources can be builtin Kubernetes resources or resources from other `APIExports`.
424
-
When an `APIExport` is changed after workspaces have bound to it, new or changed APIs are automatically propagated to all `APIBindings`. New permission claims on the other hand are NOT automatically accepted.
433
+
Furthermore, `APIBindings` provide the `APIExport` owner access to additional resources defined in an `APIExport`'s
434
+
permission claims list. Permission claims must be accepted by the user explicitly, before this access is granted.
435
+
The resources can be builtin Kubernetes resources or resources bound with other `APIBindings`.
436
+
437
+
!!! information
438
+
When an `APIExport` is changed after workspaces have bound to it, new or changed APIs are automatically propagated
439
+
to all `APIBindings`. New permission claims on the other hand are NOT automatically accepted.
425
440
426
441
Returning to our example, we can grant the requested permissions in the `APIBinding`:
427
442
@@ -450,7 +465,8 @@ spec:
450
465
matchAll: true
451
466
```
452
467
453
-
It should be noted that `APIBindings` do not create `CRDs` or `APIResourceSchemas`in the workspace. Instead APIs are directly bound using Kubernetes' internal binding mechanism behind the scenes.
468
+
It should be noted that `APIBindings` do not create `CRDs` or `APIResourceSchemas` in the workspace.
469
+
Instead APIs are directly bound using Kubernetes' internal binding mechanism behind the scenes.
454
470
455
471
##### Verbs
456
472
@@ -459,10 +475,51 @@ the verbs in the APIBinding and the verbs in the appropriate APIExport.
459
475
460
476
##### Selector
461
477
462
-
`APIBindings`allow API consumers to scope an API provider's access to claimed resources via the `selector` field on a permission claim. This means that providers will only be able to see and access those objects matched by the `selector`.
478
+
`APIBindings`allow API consumers to scope an API provider's access to claimed resources via the `selector` field on
479
+
a permission claim. This means that providers will only be able to see and access those objects matched by
480
+
the `selector`.
481
+
482
+
There are two types of selectors at the moment:
483
+
484
+
- `matchAll`: gives the service provider access to all objects of a claimed resource
485
+
- label selector: gives the service provider access only to objects which are satisfying the given label selector
486
+
487
+
The `matchAll` selector is shown in the example above.
488
+
489
+
A label selector can be defined using `matchLabels` or `matchExpressions`:
490
+
491
+
- `matchLabels`specifies a set of labels (key-value pairs). For the selector to match, **all** of the listed labels
492
+
must be present on the object.
493
+
- `matchExpressions`specifies a set of expressions that are evaluated against object’s labels. If multiple expressions
494
+
are specified, **all must evaluate to `true`** for the selector to match.
Currently, only `selector.matchAll=true` is supported, giving the provider that owns the `APIExport` full access to all objects of a claimed resource. Additional selectors are planned for upcoming releases.
519
+
Special attention is needed by the service provider when creating or updating an object via the APIExport Virtual
520
+
Workspace. If `matchLabels` is used, the specified labels will be automatically applied to the object that's being
521
+
applied even if not specified by the service provider. However, that's not the case for `matchExpressions`,
522
+
in which case the service provider needs to explicitly specify labels upon applying the object.
Copy file name to clipboardExpand all lines: docs/content/concepts/quickstart-tenancy-and-apis.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -365,6 +365,8 @@ spec:
365
365
366
366
Operations allowed on the resources for which permission claim is accepted is defined as the intersection of the verbs in the `APIBinding` and the verbs in the `APIExport`. Verbs in this case are matching the verbs used by the [Kubernetes API](https://kubernetes.io/docs/reference/using-api/api-concepts/#api-verbs). There is the possibility to further limit the access claim to single resources.
367
367
368
+
PermissionClaims allows for additional selectors, for more details, check out the [APIBindings documentation](./apis/exporting-apis.md#apibinding).
0 commit comments