webhooks

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PlatformEventVersions = map[string]string{
	"organization.created": "1.0", "organization.retired": "1.0", "organization.restored": "1.0",
	"application.created": "1.0", "application.retired": "1.0", "application.restored": "1.0",
	"delegation.created": "1.0", "delegation.exchanged": "1.0", "delegation.revoked": "1.0",
	"entitlement.granted": "1.0", "local_entitlement_request.created": "1.0", "local_entitlement_request.approved": "1.0",
	"oauth.consent_revoked": "1.0", "platform93.webhook.test": "1.0", "user.created": "1.0",
	"storage.object.upload_requested": "1.0", "storage.object.ready": "1.0", "storage.object.deleted": "1.0",
	"storage.provider.verified": "1.0", "storage.provider.disabled": "1.0",
	"user.email_verified": "1.0", "user.email_unverified": "1.0", "user.organization_verified": "1.0",
	"user.organization_unverified": "1.0", "user.email_changed": "1.0", "user.password_reset": "1.0",
	"user.pending_deletion": "1.0", "user.anonymized": "1.0", "user.deleted": "1.0",
	"user.suspended": "1.0", "user.restored": "1.0", "workspace.invitation_created": "1.0",
	"workspace.invitation_accepted": "1.0", "workspace.owner_transferred": "1.0",
}

Functions

func DecodeData

func DecodeData[T any](event Event) (T, error)

func Verify

func Verify(body []byte, header, secret string, now time.Time, tolerance time.Duration) error

Types

type ApplicationLifecycleData

type ApplicationLifecycleData struct {
	OrganizationID string `json:"organization_id"`
	Reason         string `json:"reason"`
}

type DelegationCreatedData

type DelegationCreatedData struct {
	DelegationID string    `json:"delegation_id"`
	UserID       string    `json:"user_id"`
	WorkspaceID  *string   `json:"workspace_id"`
	Permissions  []string  `json:"permissions"`
	Reason       string    `json:"reason"`
	ExpiresAt    time.Time `json:"expires_at"`
}

type DelegationExchangedData

type DelegationExchangedData struct {
	DelegationID string `json:"delegation_id"`
	UserID       string `json:"user_id"`
}

type DelegationRevokedData

type DelegationRevokedData struct {
	DelegationID string `json:"delegation_id"`
}

type EntitlementGrantedData

type EntitlementGrantedData struct {
	GrantID     string `json:"grant_id"`
	SubjectType string `json:"subject_type"`
	SubjectID   string `json:"subject_id"`
	Reason      string `json:"reason"`
}

type Event

type Event struct {
	SpecVersion    string          `json:"specversion"`
	ID             string          `json:"id"`
	Source         string          `json:"source"`
	Type           string          `json:"type"`
	ContractSource string          `json:"contract_source"`
	Time           time.Time       `json:"time"`
	ApplicationID  string          `json:"application_id"`
	SchemaVersion  string          `json:"schema_version"`
	Subject        *string         `json:"subject"`
	Actor          json.RawMessage `json:"actor"`
	CorrelationID  *string         `json:"correlation_id"`
	CausationID    *string         `json:"causation_id"`
	Data           json.RawMessage `json:"data"`
}

func VerifyAndDecode

func VerifyAndDecode(body []byte, header, secret string, now time.Time, tolerance time.Duration) (Event, error)

func (Event) IsCustom

func (e Event) IsCustom() bool

func (Event) IsPlatform

func (e Event) IsPlatform() bool

func (Event) SupportsKnownVersion

func (e Event) SupportsKnownVersion() bool

type LocalEntitlementRequestApprovedData

type LocalEntitlementRequestApprovedData struct {
	RequestID string `json:"request_id"`
	GrantID   string `json:"grant_id"`
}

type LocalEntitlementRequestCreatedData

type LocalEntitlementRequestCreatedData struct {
	RequestID   string `json:"request_id"`
	SubjectType string `json:"subject_type"`
	SubjectID   string `json:"subject_id"`
	PriceID     string `json:"price_id"`
}

type NamedData

type NamedData struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type OAuthConsentRevokedData

type OAuthConsentRevokedData struct {
	UserID    string `json:"user_id"`
	ClientID  string `json:"client_id"`
	ClientKey string `json:"client_key"`
}

type OrganizationRestoredData

type OrganizationRestoredData struct {
	DescendantsRestored bool `json:"descendants_restored"`
}

type OrganizationRetiredData

type OrganizationRetiredData struct {
	ApplicationCount int `json:"application_count"`
}

type StorageObjectData

type StorageObjectData struct {
	ObjectID   string `json:"object_id"`
	OwnerType  string `json:"owner_type"`
	Visibility string `json:"visibility"`
	SizeBytes  int64  `json:"size_bytes"`
}

type StorageProviderData

type StorageProviderData struct {
	ProviderID     string `json:"provider_id"`
	Scope          string `json:"scope"`
	PublicEnabled  bool   `json:"public_enabled"`
	PrivateEnabled bool   `json:"private_enabled"`
}

type UserCreatedData

type UserCreatedData struct {
	UserID        string `json:"user_id"`
	EmailVerified bool   `json:"email_verified"`
	IsOrgVerified bool   `json:"is_org_verified"`
}

type UserIDData

type UserIDData struct {
	UserID string `json:"user_id"`
}

type UserStateData

type UserStateData struct {
	UserID string `json:"user_id"`
	Reason string `json:"reason"`
}

type UserVerificationData

type UserVerificationData struct {
	UserID   string `json:"user_id"`
	Verified bool   `json:"verified"`
	Reason   string `json:"reason"`
}

type WebhookTestData

type WebhookTestData struct {
	WebhookEndpointID string `json:"webhook_endpoint_id"`
	Test              bool   `json:"test"`
}

type WorkspaceInvitationAcceptedData

type WorkspaceInvitationAcceptedData struct {
	InvitationID string `json:"invitation_id"`
	WorkspaceID  string `json:"workspace_id"`
	UserID       string `json:"user_id"`
}

type WorkspaceInvitationCreatedData

type WorkspaceInvitationCreatedData struct {
	InvitationID string   `json:"invitation_id"`
	WorkspaceID  string   `json:"workspace_id"`
	RoleKeys     []string `json:"role_keys"`
}

type WorkspaceOwnerTransferredData

type WorkspaceOwnerTransferredData struct {
	WorkspaceID              string `json:"workspace_id"`
	PreviousOwnerUserID      string `json:"previous_owner_user_id"`
	NewOwnerUserID           string `json:"new_owner_user_id"`
	PreviousOwnerDisposition string `json:"previous_owner_disposition"`
}

Jump to

Keyboard shortcuts

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