rbactest

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rbactest holds the ui.oidc shapes every RBAC reporter is tested against (Task 20395): `cloop hub doctor`, the Settings panel, /api/me and the startup log each have to give authz.Enforced's answer for the same five blocks, and leave :8888's access exactly as it was.

Test-only (tests/arch/testonly_test.go): it imports "testing".

Index

Constants

View Source
const Hub8888Admin = "microsoft@blechschmidt.saarland"

Hub8888Admin is the address :8888's policy makes an administrator.

View Source
const Hub8888Port = 8081

Hub8888Port is the --port :8888's hub runs with, which names its overlay.

View Source
const Issuer = "https://idp.example.com/realms/main"

Issuer is the identity provider every Matrix case signs in through.

Variables

This section is empty.

Functions

func Hub8888

func Hub8888(t testing.TB) config.OIDCConfig

Hub8888 decodes that section the way config.Load decodes the live file.

func Hub8888Overlay

func Hub8888Overlay() []byte

Hub8888Overlay is a copy of :8888's per-port overlay reduced to its ui.oidc section — no secret, it has none.

func WriteHub8888

func WriteHub8888(t testing.TB, dir string)

WriteHub8888 lays the copy down as dir's overlay for Hub8888Port, beside a config.yaml with no ui.oidc — the arrangement :8888 runs from — so a test can load it through config.LoadUIInstance as the hub does.

Types

type Case

type Case struct {
	Name string
	OIDC config.OIDCConfig
	// Enforced is whether RBAC is in force for a hub running this block.
	Enforced bool
}

Case is one ui.oidc block and authz.Enforced's verdict on it.

func Matrix

func Matrix() []Case

Matrix returns the five blocks the task names, in its order: single sign-on off, SSO alone, SSO with admin_emails (the Task 20317 hub's shape), SSO with a default_role, and SSO with role mappings. Only the last two write a policy.

Jump to

Keyboard shortcuts

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