pub struct KubernetesVerifier { /* private fields */ }Available on crate feature
kubernetes-auth only.Expand description
The reviewer: where the API server is, how this server authenticates to it, and who is granted what.
Implementations§
Source§impl KubernetesVerifier
impl KubernetesVerifier
Sourcepub fn in_cluster(
audience: Option<String>,
grants: Vec<(String, Principal)>,
) -> Result<Self, String>
pub fn in_cluster( audience: Option<String>, grants: Vec<(String, Principal)>, ) -> Result<Self, String>
The in-cluster reviewer: API server address from the environment Kubernetes injects, trust from the mounted cluster CA, identity from the mounted service-account token.
§Errors
Outside a cluster (no KUBERNETES_SERVICE_HOST, no mounted CA) —
at startup, where the refusal names what is missing, not at the
first request.
Sourcepub fn verify(&self, presented: &str) -> Option<Principal>
pub fn verify(&self, presented: &str) -> Option<Principal>
Who presented is, if the API server vouches for it AND a grant
names it. None is both “not a valid token” and “valid but not
granted” — the caller’s error stays 401 either way, and the
distinction lives in this server’s log, not the response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for KubernetesVerifier
impl !RefUnwindSafe for KubernetesVerifier
impl !UnwindSafe for KubernetesVerifier
impl Send for KubernetesVerifier
impl Sync for KubernetesVerifier
impl Unpin for KubernetesVerifier
impl UnsafeUnpin for KubernetesVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more