kube
kube copied to clipboard
Add auth delegation utilities
Motivation
Applications usually perform some authentication & authorization, and for kubernetes-native apps it makes sense to leverage apiserver for that, e.g. this is recommended for the extension API servers.
Solution
This PR adds simple high-level client together with SubjectAccessReview builders.
Additionally, while I was writing an example, I realized that currently it is not possible to create subresources, so I added a method for this in a separate commit.
Codecov Report
Merging #778 (647233e) into master (4d991fe) will decrease coverage by
1.69%. The diff coverage is0.00%.
@@ Coverage Diff @@
## master #778 +/- ##
==========================================
- Coverage 71.99% 70.29% -1.70%
==========================================
Files 54 55 +1
Lines 3631 3720 +89
==========================================
+ Hits 2614 2615 +1
- Misses 1017 1105 +88
| Impacted Files | Coverage Δ | |
|---|---|---|
| kube-client/src/lib.rs | 92.80% <ø> (ø) |
|
| kube-client/src/util/auth.rs | 0.00% <0.00%> (ø) |
|
| kube-core/src/request.rs | 92.16% <0.00%> (-2.84%) |
:arrow_down: |
| kube/src/lib.rs | 87.80% <ø> (ø) |
|
| kube-runtime/src/wait.rs | 70.00% <0.00%> (+2.00%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 4d991fe...647233e. Read the comment docs.
Hey, thanks a lot for all of this! I think this makes sense to include a lot of this in kube, and will come back in a day or two to give this a proper review (the tokenreview stuff is all new to me, so need to read through this properly).
Some quick notes:
- extra subresource
createabsolutely makes sense - authclient and associated enums makes sense
- the builders for subjectaccessreview possibly makes sense - they might clash with https://github.com/kube-rs/k8s-pb/issues/9 down the line though :thinking:
I'm going to close this:
builders, while being useful, are probably out-of-scope for kube-rs, and the rest is already implemented in other PRs