apprhttp

package
v1.162.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package apprhttp serves the Approvals queue on the portal (#2437, #2494): a person's own requests, every request for an administrator, filing one and deciding one, through the service manage_approval uses and under its rules. Every write is audited as a manage_approval call from the portal.

Index

Constants

View Source
const Prefix = "/api/v1/portal/approvals"

Prefix opens every route.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes behind wrap, the portal's authentication.

Types

type Config

type Config struct {
	Service *approval.Service
	// Actor is who made a request, nil for none.
	Actor func(r *http.Request) *approval.Actor
	Audit middleware.AuditLogger
	// Recent reads a call request's requester's recent calls of its
	// operation (#2437); nil answers none.
	Recent func(ctx context.Context, r *approval.Request) ([]RecentCall, error)
}

Config is what the routes use.

type RecentCall added in v1.161.0

type RecentCall struct {
	At      time.Time `json:"at"`
	Items   int       `json:"items" example:"5"`
	Outcome string    `json:"outcome" example:"held"`
}

RecentCall is one of a requester's calls of a held call's operation in the last day: when, how many items, and what came of it, never its arguments.

type RecentCallList added in v1.161.0

type RecentCallList struct {
	Data []RecentCall `json:"data"`
}

RecentCallList is the requester's recent calls, newest first.

Jump to

Keyboard shortcuts

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