admin

package
v3.15.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package admin holds the primitives specific to the reva Admin API: the audit helper and the service identity (AsService). The invocation framework lives in pkg/invoke.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsService added in v3.14.0

func AsService(ctx context.Context, name string) (context.Context, error)

AsService returns ctx acting as the internal service name on the Admin API: its outgoing token is replaced by an admin-scoped one for a service identity. The name is for the audit log only: any holder of the shared JWT secret can claim any name.

func Audit

func Audit(ctx context.Context, ev AuditEvent)

Audit emits a structured audit event (audit=true) on the context logger. Denials and failures are logged at error level, successes at info.

Types

type AuditEvent

type AuditEvent struct {
	// Action is the operation, e.g. "request_admin", "invoke".
	Action string
	// Actor is the username of the caller.
	Actor string
	// Target is the affected user/service/node, when there is one.
	Target string
	// Kind is the invocation kind or an action sub-class, when relevant.
	Kind string
	// Granted records the outcome of a gate decision.
	Granted bool
	// Err is set when the action failed or was denied.
	Err error
	// Fields carries any extra structured context.
	Fields map[string]string
}

AuditEvent is one admin action worth recording: who did what, against what, and how it turned out.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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