epsource

package
v1.154.0 Latest Latest
Warning

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

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

Documentation

Overview

Package epsource makes the webhook source a form stores its submissions in (#2178), when the form is bound to an endpoint: named for the endpoint, on the Trino connection the binding names or the only one there is, with the personas a script may decrypt the form's sensitive fields as; and finds the one made for a form script before.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Maker

type Maker struct {
	Admin SourceAdmin
	// Connections names the connections a source's tables can be created
	// on (trino.Toolkit.ScratchConnections).
	Connections func() []string
}

Maker makes the webhook source a form stores its submissions in, when the form is bound to an endpoint (#2178).

func (*Maker) ConnectionChoices

func (m *Maker) ConnectionChoices() []string

ConnectionChoices names the connections a form's source can be made on.

func (*Maker) Ensure

func (m *Maker) Ensure(ctx context.Context, req SourceRequest) (SourceResult, error)

Ensure is the form's source: the one made for its script before, with its decrypt personas replaced when the request names them, or a new one on the connection the request names, or on the only one there is.

func (*Maker) Find

func (m *Maker) Find(ctx context.Context, scriptID string) (SourceResult, bool, error)

Find is the source made for a form script before, and whether there is one; it makes nothing.

type SourceAdmin

type SourceAdmin interface {
	List(ctx context.Context) ([]whsource.Source, error)
	CreateForm(ctx context.Context, src whsource.Source) (whsource.Source, error)
	SetDecryptPersonas(ctx context.Context, name string, personas []string) (whsource.Source, error)
}

SourceAdmin is the webhook source service as a form's source is made and changed through it (whadmin.Service).

type SourceRequest

type SourceRequest struct {
	ScriptID string
	Endpoint string
	// Connection is the Trino connection the source's tables go on; empty
	// is the deployment's only connection with a scratch catalog.
	Connection string
	// DecryptPersonas replaces the personas the form's sensitive fields may
	// be decrypted as; nil keeps them.
	DecryptPersonas []string
	Actor           string
}

SourceRequest is a form bound to an endpoint, asking for its source.

type SourceResult

type SourceResult struct {
	Source          string   `json:"source"`
	Table           string   `json:"table"`
	Connection      string   `json:"connection"`
	DecryptPersonas []string `json:"decrypt_personas"`
	Created         bool     `json:"created"`
}

SourceResult is the source a form stores into.

Jump to

Keyboard shortcuts

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