maqpna auth
Check your permissions and identity (kubectl auth can-i / whoami)
Synopsis#
maqpna auth can-i VERB TYPE[/NAME] [-n NS | -A] [--subresource S] [-q]
maqpna auth can-i --list [-n NS]
maqpna auth whoami [--gateway URL] [-o json|yaml]Description#
can-i asks the API server whether you may VERB the type (MAQPNA names and short names work: maqpna auth can-i create sess; any other resource is passed through: maqpna auth can-i create pods/exec). It prints yes or no and exits 0 or 1. The gateway's runtime kinds are authorized by the gateway's admin roles, which auth whoami lists.
Subcommands#
maqpna auth can-iAsk the API server whether you may do something (SelfSubjectAccessReview)
maqpna auth whoamiShow your Kubernetes user and the gateway's view of your login
Examples#
maqpna auth can-i create sess -n team-a
maqpna auth can-i create pods --subresource exec -n team-a
maqpna auth whoamiWhat happens when you run it#
- Prints a table by default;
-o jsonor-o yamlprint the data, and--jq EXPRfilters the JSON.
Exit codes#
| Code | Meaning |
|---|---|
0 | success |
1 | error (the message says what failed, with a hint when there is one) |
2 | usage error: unknown flag, missing argument or bad value; the synopsis is printed |
3 | a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command) |