formpublishwire

package
v1.157.0 Latest Latest
Warning

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

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

Documentation

Overview

Package formpublishwire mounts what a form's owner publishes it with (#2494): the preview the script page opens, and the Approvals queue (#2437) a public form's version is approved through, with the emails each request and decision sends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actor

func Actor(isAdmin func([]string) bool, personaOf func([]string) string) func(r *http.Request) *approval.Actor

Actor is the portal caller as an approval actor, nil when signed out.

func Approvers

func Approvers(users Users, isAdmin func([]string) bool, configured ...string) func(ctx context.Context) []string

Approvers lists the administrators to notify, each once: the people whose roles, as their identity provider last reported them, make them administrators, and the configured addresses.

func Mount

func Mount(mux *http.ServeMux, p *platform.Platform, d Deps)

Mount registers the preview route and the Approvals routes, and points the queue's emails at the notification handle. Nothing without endpoints.

func Opener

func Opener(isAdmin func([]string) bool) func(r *http.Request) *eppreview.Opener

Opener is the portal caller as the opener of a preview, nil when signed out.

Types

type Bridge

type Bridge interface {
	NotifyApprovalRequest(ctx context.Context, approvers []string, a notifydelivery.AccessNotice)
	NotifyApprovalDecision(ctx context.Context, a notifydelivery.AccessNotice)
}

Bridge sends the portal's emails (notifydelivery.PortalNotifier).

type Deps

type Deps struct {
	Wrap    func(http.Handler) http.Handler
	IsAdmin func([]string) bool
	Notify  *notifydelivery.Handle
}

Deps is what the routes are mounted with.

type Notifier

type Notifier struct{ Bridge Bridge }

Notifier sends the queue's two emails through the portal's notifier.

func (Notifier) Decided

func (n Notifier) Decided(ctx context.Context, r *approval.Request)

Decided tells the requester how their request was decided.

func (Notifier) Requested

func (n Notifier) Requested(ctx context.Context, r *approval.Request, approvers []string)

Requested tells each approver a request waits.

type Users

type Users interface {
	List(ctx context.Context, filter user.Filter) ([]user.User, int, error)
}

Users lists the people the platform knows.

Jump to

Keyboard shortcuts

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