orders

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package orders is application code for the dispatcher example, not an edge API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEnvironment

func FromEnvironment(streaming bool) (http.Handler, error)

FromEnvironment configures real verification and a small, explicitly enrolled read-only demonstration store. It never obtains server-side AWS credentials.

func New

func New(cfg Config) (http.Handler, error)

New constructs the complete application without network I/O. Streaming is a startup choice: orders.watch is absent from the buffered variant's registry.

Types

type Config

type Config struct {
	Cognito       authn.CognitoConfig
	Region        string
	ProofAudience string
	IAMPrincipal  string
	Origin        string
	STSTransport  http.RoundTripper
	Grants        Grants
	Store         Store
	Streaming     bool
}

Config belongs to this example. Required strings have no implicit defaults. Transports are trusted infrastructure; nil selects the verifier's default.

type Grants

type Grants interface {
	Allowed(context.Context, identity.Caller, string, string) (bool, error)
}

Grants resolves application enrollment and permissions, independently of token scopes and AWS IAM policies. Implementations must support concurrent requests.

type Store

type Store interface {
	Read(context.Context, string) (string, error)
	Events(context.Context, string, func(string) error) error
}

Store reads the exact authorized resource. Events calls yield synchronously, stops on its first error, and observes context cancellation. A database-backed application must also preserve object/version consistency through execution.

Jump to

Keyboard shortcuts

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