chore: merge authorization contexts (#12816)

* chore: merge authorization contexts

Instead of 2 auth contexts from apikey and dbauthz, merge them to
just use dbauthz. It is annoying to have two.

* fixup authorization reference
This commit is contained in:
Steven Masley
2024-03-29 10:14:27 -05:00
committed by GitHub
parent 8e2d026d99
commit eeb3d63be6
16 changed files with 68 additions and 99 deletions
+8 -4
View File
@@ -155,7 +155,8 @@ func ActorFromContext(ctx context.Context) (rbac.Subject, bool) {
var (
subjectProvisionerd = rbac.Subject{
ID: uuid.Nil.String(),
FriendlyName: "Provisioner Daemon",
ID: uuid.Nil.String(),
Roles: rbac.Roles([]rbac.Role{
{
Name: "provisionerd",
@@ -182,7 +183,8 @@ var (
}.WithCachedASTValue()
subjectAutostart = rbac.Subject{
ID: uuid.Nil.String(),
FriendlyName: "Autostart",
ID: uuid.Nil.String(),
Roles: rbac.Roles([]rbac.Role{
{
Name: "autostart",
@@ -203,7 +205,8 @@ var (
// See unhanger package.
subjectHangDetector = rbac.Subject{
ID: uuid.Nil.String(),
FriendlyName: "Hang Detector",
ID: uuid.Nil.String(),
Roles: rbac.Roles([]rbac.Role{
{
Name: "hangdetector",
@@ -221,7 +224,8 @@ var (
}.WithCachedASTValue()
subjectSystemRestricted = rbac.Subject{
ID: uuid.Nil.String(),
FriendlyName: "System",
ID: uuid.Nil.String(),
Roles: rbac.Roles([]rbac.Role{
{
Name: "system",