Documentation
¶
Overview ¶
Package rbac answers what this reader may do, per context.
Every control kubeside disables is disabled because the cluster said so, not because a role name looked wrong. The question goes to the apiserver as a SelfSubjectAccessReview, which is the only authority on the answer.
The product rule this serves is "disable, never hide". A control that vanishes teaches nothing and leaves somebody wondering whether the feature exists; one that is visible, disabled, and says "needs create on pods/exec in team-a" tells them exactly what to ask for. So every denial carries the verb.
Answers resolve per context. The same control on the same screen is enabled in qa and disabled in prod within one session, because permissions are a property of the cluster and not of the tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Verb string
Resource string
Subresource string
Name string
Namespace string
Group string
}
Action is one question: may I do this verb, to this resource, here.
type KubeReviewer ¶
type KubeReviewer struct {
// ClientFor returns the client for one context. A context with no client is
// one kubeside has not connected, and an unconnected cluster cannot grant
// anything.
ClientFor func(contextName string) (kubernetes.Interface, bool)
}
KubeReviewer asks the apiserver, which is the only authority on what this reader may do.
type Permission ¶
Permission is the answer, with the reason a denial happened.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver caches answers for the session.
func (*Resolver) CanAll ¶
func (r *Resolver) CanAll(ctx context.Context, contextName string, actions []Action) map[string]Permission
CanAll answers several questions, which is what a screen actually asks.