Help us shape the future of Go! Take the 2026 Go Developer Survey

invite

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package invite provides helpers for OCM invite integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWAYFRedirectURL

func BuildWAYFRedirectURL(inviteAcceptDialog, token, providerDomain string) string

BuildWAYFRedirectURL matches internal/components/ui/templates/wayf.html redirectToProvider.

func OutgoingStatus

func OutgoingStatus(dataDir, token string) (invites.InviteStatus, string, error)

OutgoingStatus reads json persistence at dataDir/data/outgoing_invites.json and returns the status for the invite matching token.

func StrictInstanceExtraConfig

func StrictInstanceExtraConfig(opts StrictInstanceOptions) string

StrictInstanceExtraConfig returns TOML appended to the integration subprocess harness config. It mirrors tests/e2e/harness/server.ts strict settings. public_origin, listen_addr, outbound_http baseline, and tls_root_ca_file are owned by the harness SubprocessConfig fields.

func StrictInstanceTLSRootCA

func StrictInstanceTLSRootCA(moduleRoot string) string

StrictInstanceTLSRootCA returns the shared test CA bundle used by strict two-instance invite integration tests.

Types

type AcceptResponse

type AcceptResponse struct {
	Status   invites.InviteStatus `json:"status"`
	InviteID string               `json:"inviteId"`
}

AcceptResponse mirrors POST /api/inbox/invites/{id}/accept.

func Accept

func Accept(ctx context.Context, client *http.Client, baseURL, token, inviteID string) (*AcceptResponse, int, error)

Accept posts to /api/inbox/invites/{id}/accept.

type DiscoverResponse

type DiscoverResponse struct {
	Success                    bool            `json:"success"`
	Error                      string          `json:"error,omitempty"`
	ReasonCode                 string          `json:"reasonCode,omitempty"`
	Discovery                  *spec.Discovery `json:"discovery,omitempty"`
	InviteAcceptDialogAbsolute string          `json:"inviteAcceptDialogAbsolute,omitempty"`
}

DiscoverResponse mirrors GET /ocm-aux/discover success payload fields used by tests.

func DiscoverProvider

func DiscoverProvider(ctx context.Context, client *http.Client, auxBaseURL, providerBaseURL string) (*DiscoverResponse, int, error)

DiscoverProvider calls GET /ocm-aux/discover?base=<providerBaseURL>.

type ImportResponse

type ImportResponse struct {
	ID         string               `json:"id"`
	SenderFQDN string               `json:"senderFqdn"`
	Status     invites.InviteStatus `json:"status"`
}

ImportResponse mirrors POST /api/inbox/invites/import.

func Import

func Import(ctx context.Context, client *http.Client, baseURL, token, inviteString string) (*ImportResponse, int, error)

Import posts to /api/inbox/invites/import.

type InboxInviteView

type InboxInviteView struct {
	ID         string               `json:"id"`
	SenderFQDN string               `json:"senderFqdn"`
	Status     invites.InviteStatus `json:"status"`
}

InboxInviteView is one inbox invite row from the list API.

func FindInboxInvite

func FindInboxInvite(list *InboxListResponse, inviteID string) (*InboxInviteView, error)

FindInboxInvite returns the invite with the given id from a list response.

type InboxListResponse

type InboxListResponse struct {
	Invites []InboxInviteView `json:"invites"`
}

InboxListResponse mirrors GET /api/inbox/invites.

func ListInbox

func ListInbox(ctx context.Context, client *http.Client, baseURL, token string) (*InboxListResponse, int, error)

ListInbox returns GET /api/inbox/invites.

type OutgoingCreateResponse

type OutgoingCreateResponse struct {
	InviteString string `json:"inviteString"`
	Token        string `json:"token"`
	ProviderFQDN string `json:"providerFqdn"`
}

OutgoingCreateResponse mirrors POST /api/invites/outgoing.

func CreateOutgoing

func CreateOutgoing(ctx context.Context, client *http.Client, baseURL, token string) (*OutgoingCreateResponse, int, error)

CreateOutgoing posts to /api/invites/outgoing and returns the created invite.

type StrictInstanceOptions

type StrictInstanceOptions struct {
	ModuleRoot      string
	EnableWAYF      bool
	JSONPersistence bool
}

StrictInstanceOptions tunes subprocess extra config for two-instance invite proofs.

Jump to

Keyboard shortcuts

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