Documentation
¶
Overview ¶
Package invite provides helpers for OCM invite integration tests.
Index ¶
- func BuildWAYFRedirectURL(inviteAcceptDialog, token, providerDomain string) string
- func OutgoingStatus(dataDir, token string) (invites.InviteStatus, string, error)
- func StrictInstanceExtraConfig(opts StrictInstanceOptions) string
- func StrictInstanceTLSRootCA(moduleRoot string) string
- type AcceptResponse
- type DiscoverResponse
- type ImportResponse
- type InboxInviteView
- type InboxListResponse
- type OutgoingCreateResponse
- type StrictInstanceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWAYFRedirectURL ¶
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 ¶
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.
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.
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.
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 ¶
StrictInstanceOptions tunes subprocess extra config for two-instance invite proofs.