Versions in this module Expand all Collapse all v0 v0.1.0 Oct 12, 2026 Changes in this version + const OAuth2SpecURN + const SpecVersion + const WellKnownPath + var ErrInvalidEvent = errors.New("ssf: invalid event") + var ErrInvalidSubject = errors.New("ssf: invalid subject") + var ErrSecretSerialization = errors.New("ssf: secret values cannot be marshaled") + var ErrUnsupportedEventType = errors.New("ssf: unsupported event type") + func Register[E Event](r *Registry) error + func SubjectsEqual(a, b Subject) bool + func SubjectsMatch(a, b Subject) bool + func ValidateIssuer(issuer string) error + func WellKnownURL(issuer string) (string, error) + type AccountSubject struct + URI string + func (AccountSubject) Format() SubjectFormat + func (s AccountSubject) MarshalJSON() ([]byte, error) + func (s AccountSubject) Validate() error + type AddSubjectRequest struct + StreamID string + Subject Subject + Verified *bool + func (r *AddSubjectRequest) UnmarshalJSON(data []byte) error + func (r AddSubjectRequest) MarshalJSON() ([]byte, error) + type AliasesSubject struct + Identifiers []Subject + func (AliasesSubject) Format() SubjectFormat + func (s AliasesSubject) MarshalJSON() ([]byte, error) + func (s AliasesSubject) Validate() error + type Assurance uint8 + const AssuranceDevelopment + const AssuranceProduction + func (a Assurance) IsValid() bool + func (a Assurance) String() string + type Audience []string + func (a *Audience) UnmarshalJSON(data []byte) error + func (a Audience) MarshalJSON() ([]byte, error) + type AuthorizationScheme struct + SpecURN string + type ComplexSubject struct + Additional map[string]Subject + Application Subject + Device Subject + Group Subject + OrgUnit Subject + Session Subject + Tenant Subject + User Subject + func (ComplexSubject) Format() SubjectFormat + func (s ComplexSubject) MarshalJSON() ([]byte, error) + func (s ComplexSubject) Validate() error + type DIDSubject struct + URL string + func (DIDSubject) Format() SubjectFormat + func (s DIDSubject) MarshalJSON() ([]byte, error) + func (s DIDSubject) Validate() error + type DefaultSubjects string + const DefaultSubjectsAll + const DefaultSubjectsNone + type Delivery struct + AuthorizationHeader Secret + EndpointURL string + Method DeliveryMethod + func (d Delivery) LogValue() slog.Value + func (d Delivery) MarshalJSON() ([]byte, error) + type DeliveryMethod string + const DeliveryPoll + const DeliveryPush + type EmailSubject struct + Email string + func (EmailSubject) Format() SubjectFormat + func (s EmailSubject) MarshalJSON() ([]byte, error) + func (s EmailSubject) Validate() error + type Event interface + EventType func() EventType + Validate func() error + type EventType string + const StreamUpdatedEventType + const VerificationEventType + type IPAddressesSubject struct + Addresses []netip.Addr + func (IPAddressesSubject) Format() SubjectFormat + func (s IPAddressesSubject) MarshalJSON() ([]byte, error) + func (s IPAddressesSubject) Validate() error + type IssSubSubject struct + Issuer string + Subject string + func (IssSubSubject) Format() SubjectFormat + func (s IssSubSubject) MarshalJSON() ([]byte, error) + func (s IssSubSubject) Validate() error + type JWTIDSubject struct + Issuer string + JWTID string + func (JWTIDSubject) Format() SubjectFormat + func (s JWTIDSubject) MarshalJSON() ([]byte, error) + func (s JWTIDSubject) Validate() error + type KeyCustody struct + CrossInstanceConsistent bool + Durable bool + type KeyCustodyAssurance interface + KeyCustody func() KeyCustody + type LocalizedText map[string]string + func (t *LocalizedText) UnmarshalJSON(data []byte) error + func (t LocalizedText) Validate() error + type NumericDate struct + func NewNumericDate(t time.Time) NumericDate + func (d *NumericDate) UnmarshalJSON(data []byte) error + func (d NumericDate) MarshalJSON() ([]byte, error) + type OpaqueSubject struct + ID string + func (OpaqueSubject) Format() SubjectFormat + func (s OpaqueSubject) MarshalJSON() ([]byte, error) + func (s OpaqueSubject) Validate() error + type PhoneNumberSubject struct + PhoneNumber string + func (PhoneNumberSubject) Format() SubjectFormat + func (s PhoneNumberSubject) MarshalJSON() ([]byte, error) + func (s PhoneNumberSubject) Validate() error + type ProprietarySubject struct + FormatName SubjectFormat + Members map[string]json.RawMessage + func (s ProprietarySubject) Format() SubjectFormat + func (s ProprietarySubject) MarshalJSON() ([]byte, error) + func (s ProprietarySubject) Validate() error + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Decode(typ EventType, payload json.RawMessage) (Event, error) + func (r *Registry) Supports(typ EventType) bool + func (r *Registry) Types() []EventType + type RemoveSubjectRequest struct + StreamID string + Subject Subject + func (r *RemoveSubjectRequest) UnmarshalJSON(data []byte) error + func (r RemoveSubjectRequest) MarshalJSON() ([]byte, error) + type SAMLAssertionIDSubject struct + AssertionID string + Issuer string + func (SAMLAssertionIDSubject) Format() SubjectFormat + func (s SAMLAssertionIDSubject) MarshalJSON() ([]byte, error) + func (s SAMLAssertionIDSubject) Validate() error + type SCIMSubject struct + Attributes map[string]json.RawMessage + ExternalID string + ID string + URI string + func (SCIMSubject) Format() SubjectFormat + func (s SCIMSubject) MarshalJSON() ([]byte, error) + func (s SCIMSubject) Validate() error + type SET struct + Audience []string + Event Event + IssuedAt time.Time + Issuer string + JWTID string + Subject Subject + TransactionID string + func (s SET) Validate() error + type Secret struct + func NewSecret(value string) Secret + func (s *Secret) UnmarshalText(text []byte) error + func (s Secret) Format(f fmt.State, verb rune) + func (s Secret) GoString() string + func (s Secret) IsZero() bool + func (s Secret) LogValue() slog.Value + func (s Secret) MarshalText() ([]byte, error) + func (s Secret) Reveal() string + func (s Secret) String() string + type SignatureAlgorithm uint8 + const ES256 + const ES384 + const ES512 + const EdDSA + const PS256 + const PS384 + const PS512 + const RS256 + const RS384 + const RS512 + func ParseSignatureAlgorithm(alg string) (SignatureAlgorithm, error) + func SignatureAlgorithms() []SignatureAlgorithm + func (a SignatureAlgorithm) IsValid() bool + func (a SignatureAlgorithm) String() string + type StreamConfiguration struct + Audience Audience + Delivery Delivery + Description string + EventsDelivered []EventType + EventsRequested []EventType + EventsSupported []EventType + InactivityTimeout int + Issuer string + MinVerificationInterval int + StreamID string + func (c StreamConfiguration) LogValue() slog.Value + func (c StreamConfiguration) MarshalJSON() ([]byte, error) + type StreamState struct + Reason string + Status StreamStatus + StreamID string + type StreamStatus string + const StreamDisabled + const StreamEnabled + const StreamPaused + func (s StreamStatus) IsValid() bool + type StreamUpdated struct + Reason string + Status StreamStatus + func (StreamUpdated) EventType() EventType + func (StreamUpdated) ValidateSubject(s Subject) error + func (e StreamUpdated) Validate() error + type Subject interface + Format func() SubjectFormat + Validate func() error + func ParseSubject(data []byte) (Subject, error) + type SubjectConstrainedEvent interface + ValidateSubject func(Subject) error + type SubjectFormat string + const FormatAccount + const FormatAliases + const FormatComplex + const FormatDID + const FormatEmail + const FormatIPAddresses + const FormatIssSub + const FormatJWTID + const FormatOpaque + const FormatPhoneNumber + const FormatSAMLAssertionID + const FormatSCIM + const FormatURI + type TransmitterMetadata struct + AddSubjectEndpoint string + AuthorizationSchemes []AuthorizationScheme + ConfigurationEndpoint string + CriticalSubjectMembers []string + DefaultSubjects DefaultSubjects + DeliveryMethodsSupported []DeliveryMethod + Issuer string + JWKSURI string + RemoveSubjectEndpoint string + SpecVersion string + StatusEndpoint string + VerificationEndpoint string + type URISubject struct + URI string + func (URISubject) Format() SubjectFormat + func (s URISubject) MarshalJSON() ([]byte, error) + func (s URISubject) Validate() error + type Verification struct + State string + func (Verification) EventType() EventType + func (Verification) Validate() error + func (Verification) ValidateSubject(s Subject) error + type VerificationRequest struct + State string + StreamID string