modserve

package
v1.76.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package modserve is the listener a GitHub or Slack module answers the issuer on, on Kubernetes (docs/decisions/0071): `POST /rpc` with a projected ServiceAccount token that a TokenReview accepts for the module's audience and that belongs to the issuer's ServiceAccount. It is what the Cloudflare module's listener is, with the caller's class decided by who the subject is and not by what its ServiceAccount is called.

Index

Constants

View Source
const DefaultAddress = ":8081"

DefaultAddress is the listener when the document names none: the chart's `modules.<m>.rpcPort`.

View Source
const HealthPath = "/healthz"

HealthPath answers 200 on the listener, for the probes.

Variables

This section is empty.

Functions

func Address

func Address(s *config.ModuleServe) string

Address is where the listener binds.

func Audience

func Audience(module string, s *config.ModuleServe) string

Audience is the audience a caller's token must have been minted for.

func Mux

func Mux(s *modcall.Server, verify modcall.Verifier, issuers []string) http.Handler

Mux is the module's listener: the calls at modcall.RPCPath, which verify refuses before they reach a method and which only the issuers may make, and a health endpoint that needs no credential and tells nothing.

func NewVerifier

func NewVerifier(audience string) (modcall.Verifier, error)

NewVerifier checks a caller's projected ServiceAccount token with a TokenReview for the audience: a token minted for another audience, such as the pod's default one, is refused.

func Reviewer

func Reviewer(review func(ctx context.Context, token string, audiences []string) (string, error), audience string) modcall.Verifier

Reviewer is the Verifier over a TokenReview call.

func Serve

func Serve(ctx context.Context, serve *config.ModuleServe, s *modcall.Server, verify modcall.Verifier, log *slog.Logger) error

Serve answers the issuer's calls on the document's address until ctx ends. verify checks the bearer of a call.

Types

This section is empty.

Jump to

Keyboard shortcuts

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