rm2019

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package rm2019 serves the resource-manager endpoints the Packer CLI uses to resolve which organization and project it is working in.

A third wire vocabulary over the same domain (ADR-0002). Unlike the packer endpoints these carry NO tenant in the path: the caller is asking which tenants it may see at all, so the answer comes from the principal resolved from storage for this request. That makes them the one place where scope is discovered rather than checked (ADR-0016, ADR-0019).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	repository Repository, principals Principals, auth Authenticator, logger *slog.Logger,
) http.Handler

NewHandler serves the resource-manager compatibility endpoints.

Types

type Authenticator

type Authenticator interface {
	Verify(token string) (identity.Verified, error)
}

Authenticator verifies a bearer token and reports who presented it.

type Principals

type Principals interface {
	GetPrincipalByID(ctx context.Context, id string) (*identity.Principal, error)
}

Principals resolves an authenticated caller's authority, per request rather than from the token (ADR-0019).

type Repository

type Repository interface {
	ListOrganizationsForPrincipal(context.Context, *identity.Principal) ([]store.Organization, error)
	ListProjects(context.Context, string) ([]store.Project, error)
	GetProject(context.Context, string, string) (*store.Project, error)
}

Repository reads the tenancy catalog.

Listing is scoped at this layer rather than filtered by the handler, so a caller cannot see tenancies outside its scope by a handler forgetting to filter (ADR-0016). The listing takes the whole principal rather than a bare scope, because Scope's zero value is platform scope — the most privileged input — and a principal cannot be constructed holding it without root (duf-ueq).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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