The authorization reef¶
Every command of the first slice: Users, teams, roles and bindings, and who may do what.
Commands¶
nereus reef apply authorization
The authorization reef brings roles and bindingsnereus profile apply internal-developer-platform
openfga answers who may do whatnereus user create ana
A person is one User, whatever the loginnereus user list
Every User, and how many identities each hasnereus authorization role list
One built-in role, three examples to editnereus authorization role get team-lead
A role is a list of rules: reef, kinds, verbsnereus authorization role create release-manager
A new role takes the words the CLI already usesnereus authorization role delete administrator
The administrator role cannot be deletednereus authorization binding create payments-developers
A binding gives a role to a team on a nodenereus authorization binding create payments-leads
A position narrows the binding to the tech leadnereus authorization binding list
Every binding of a node, and who it reachesnereus authorization can-i create environment/environments
Ana asks, and the answer names the bindingnereus authorization can-i create environment/environments
Bruno may not, and the answer says whynereus can-i create build/builds
The shortcut asks the same questionnereus authorization can-i drive presentations/sessions/platform-day
Presenting is a right: a Session's speakers drive itnereus authorization can-i assist presentations/sessions/platform-day
The staff assists a Session, and never drives itnereus environment create staging
Bruno's environment is refused, politelynereus environment create staging
Ana's environment is creatednereus teams member delete anaplanned #1307
Leaving the team removes the accessnereus environment list
Without openfga, everything closes
Examples¶
reef-apply¶
The kinds of the reef.
nereus reef apply authorization
✓ core/reefs/authorization created (authorization.getnereus.dev/v1alpha1: bindings, roles)
Next steps:
nereus nereid apply openfga --reef authorization
nereid-apply¶
The profile installs the Nereid and its default Mandate (an excerpt).
nereus profile apply internal-developer-platform
✓ networkpolicy openfga 0.0s networkpolicies/openfga applied (only nereus-api and vmagent-nereus reach openfga)
✓ nereid openfga 1m19s core/nereids/openfga created, Ready
✓ mandate openfga 7.0s core/mandates/openfga created (reef: authorization, nereid: openfga, default)
user-create¶
The tech lead.
nereus user create ana \
--email ana@example.com
✓ core/users/ana created
user-list¶
The people of this instance.
nereus user list
NAME EMAIL IDENTITIES AGE
ana ana@example.com 1 2m
bruno bruno@example.com 0 1m
role-list¶
The roles of this instance.
nereus authorization role list
NAME RULES BUILT IN
administrator *:*:* yes
developer *:*:list,get and 3 more -
team-lead *:*:list,get and 5 more -
viewer *:*:list,get -
role-get¶
What a team lead may do.
nereus authorization role get team-lead
team-lead: 6 rules
REEF KINDS VERBS
* * list,get
build builds create,apply,delete
delivery deliveries create,apply,delete
environment environments create,delete
release releases create,apply,delete
teams members create,delete
role-create¶
A role of this instance's own.
nereus authorization role create release-manager \
--rule release:releases:create,apply,delete
✓ authorization/roles/release-manager created
Next steps:
nereus authorization binding create <name> --role release-manager --team <team> --owner project/<project>
role-delete¶
No one locks the instance out.
nereus authorization role delete administrator
✗ authorization/roles/administrator is built in: it cannot be changed or deleted. To see who holds it, run:
nereus authorization binding list --role administrator
Nothing was changed.
binding-team¶
Everyone in the team is a developer of the Project.
nereus authorization binding create payments-developers \
--role developer \
--team payments \
--owner project/payments
✓ authorization/bindings/payments-developers created
Next steps:
nereus authorization binding list --owner project/payments
binding-position¶
Only who holds the position.
nereus authorization binding create payments-leads \
--role team-lead \
--team payments \
--position tech-lead \
--owner project/payments
✓ authorization/bindings/payments-leads created
Next steps:
nereus authorization binding list --owner project/payments
binding-list¶
Who may do what on the Project.
nereus authorization binding list \
--owner project/payments
NAME SUBJECT ROLE OWNER
payments-developers team/payments developer project/payments
payments-leads team/payments/tech-lead team-lead project/payments
can-i-yes¶
Signed in as ana: with no --user, the question is about the caller.
nereus authorization can-i create environment/environments \
--owner project/payments
yes: authorization/bindings/payments-leads gives team-lead to team/payments/tech-lead at project/payments
can-i-no¶
About someone else.
nereus authorization can-i create environment/environments \
--owner project/payments \
--user bruno
no: no binding gives bruno create on environment/environments at project/payments
Next steps:
nereus authorization binding list --owner project/payments
can-i-shortcut¶
Signed in as bruno: a developer creates builds.
nereus can-i create build/builds \
--owner project/payments
yes: authorization/bindings/payments-developers gives developer to team/payments at project/payments
can-i-drive¶
Ana is a speaker of platform-day.
nereus authorization can-i drive presentations/sessions/platform-day \
--user ana
yes: ana is a speaker of platform-day
can-i-assist¶
Carla is on the staff team of platform-day.
nereus authorization can-i assist presentations/sessions/platform-day \
--user carla
yes: carla is on the staff of platform-day (team stage-2-staff)
enforce-denied¶
Signed in as bruno.
nereus environment create staging \
--owner project/payments
✗ environment/environments/staging: bruno may not create environment/environments at project/payments. To see who may, run:
nereus authorization binding list --owner project/payments
Nothing was changed.
enforce-allowed¶
Signed in as ana, the tech lead.
nereus environment create staging \
--owner project/payments
✓ environment/environments/staging created (mandate: vcluster, nereid: vcluster)
Next steps:
nereus environment get staging --watch
leave-team¶
Ana leaves the team.
nereus teams member delete ana \
--team payments
✓ teams/teams/payments/members/ana deleted
fail-closed¶
A read while the Nereid does not answer.
nereus environment list
✗ authorization does not answer (nereid: openfga): nothing is allowed until it is back. To see what is down, run:
nereus doctor
Nothing was changed.