permissions

package
v0.229.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package permissions owns a per-audience map of permission strings. When the authapi package mints an access token, it consults this store to inject the matching audience's permissions as a "permissions" claim on the JWT.

Tests use PUT /admin0/permissions/{audience} (and friends) to shape RBAC at runtime without restarting the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds permissions keyed by audience. Safe for concurrent use.

func NewStore

func NewStore() *Store

NewStore returns an empty Store.

func (*Store) All

func (s *Store) All() map[string][]string

All returns a snapshot of every audience and its permissions.

func (*Store) Clear

func (s *Store) Clear()

Clear removes permissions for every audience.

func (*Store) Delete

func (s *Store) Delete(audience string)

Delete removes any permissions registered for an audience.

func (*Store) Get

func (s *Store) Get(audience string) []string

Get returns a copy of the permissions for an audience, or nil if none are registered.

func (*Store) Set

func (s *Store) Set(audience string, perms []string)

Set replaces the permissions for an audience with the given list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL