MAQPNADocs

maqpna auth can-i

Ask the API server whether you may do something (SelfSubjectAccessReview)

Configure-o json | yaml

Synopsis#

maqpna auth can-i VERB TYPE[/NAME] [-n NS | -A] [--subresource S] [-q]
maqpna auth can-i --list [-n NS]

Description#

From the help of maqpna auth:

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.

Flags#

FlagTypeDescriptionDefault
-A, --all-namespacesswitchall namespacesnone
--listswitchlist what you may do in the namespace (MAQPNA kinds first)none
-n, --namespacestringnamespacedefault
-q, --quietswitchprint nothing; the exit code is the answernone
--subresourcestringa subresource (exec, log, status, ...)none

The global flags (--context, -o, --no-color, ...) work with every command.

Examples#

maqpna auth can-i create sess -n team-a
maqpna auth can-i create pods --subresource exec -n team-a

What happens when you run it#

  • Prints a table by default; -o json or -o yaml print the data, and --jq EXPR filters the JSON.

Exit codes#

CodeMeaning
0success
1error (the message says what failed, with a hint when there is one)
2usage error: unknown flag, missing argument or bad value; the synopsis is printed
3a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command)