Documentation
¶
Index ¶
- Constants
- Variables
- type CreateStreamReq
- type EventSet
- type PollTransmitterRequest
- type Reason
- type ReceiverConfig
- type SETCredentialChange
- type SETSessionRevoked
- type SETVerification
- type SsfDelivery
- type SsfReceiver
- type SsfReceiverImplementation
- func (receiver *SsfReceiverImplementation) ConfigureCallback(callback func(events []events.SsfEvent), pollInterval int) error
- func (receiver *SsfReceiverImplementation) DeleteReceiver()
- func (receiver *SsfReceiverImplementation) DisableStream() (StreamStatus, error)
- func (receiver *SsfReceiverImplementation) EnableStream() (StreamStatus, error)
- func (receiver *SsfReceiverImplementation) GetStreamStatus() (StreamStatus, error)
- func (receiver *SsfReceiverImplementation) InitPollInterval()
- func (receiver *SsfReceiverImplementation) PauseStream() (StreamStatus, error)
- func (receiver *SsfReceiverImplementation) PollEvents() ([]events.SsfEvent, error)
- func (receiver *SsfReceiverImplementation) PrintStream()
- func (receiver *SsfReceiverImplementation) RequestVerificationEvent() error
- type StreamConfig
- type StreamStatus
- type StreamStatusResponse
- type StreamSubjectRequest
- type StreamVerificationState
- type SubId
- type Subject
- type TransmitterConfig
- type UpdateStreamRequest
- type User
- type VerificationRequest
Constants ¶
const TransmitterConfigMetadataPath = "/.well-known/ssf-configuration"
const TransmitterPollRFC = "urn:ietf:rfc:8936"
const TransmitterPushRFC = "urn:ietf:rfc:8935"
Variables ¶
var EnumToStringStatusMap = map[StreamStatus]string{ StreamEnabled: "enabled", StreamPaused: "paused", StreamDisabled: "disabled", }
var StatusEnumMap = map[string]StreamStatus{ "enabled": StreamEnabled, "paused": StreamPaused, "disabled": StreamDisabled, }
Functions ¶
This section is empty.
Types ¶
type CreateStreamReq ¶
type CreateStreamReq struct { Delivery SsfDelivery `json:"delivery"` EventsRequested []string `json:"events_requested"` Description string `json:"description,omitempty"` }
Struct used to make a Create Stream request for the receiver
type PollTransmitterRequest ¶
type PollTransmitterRequest struct { Acknowledgements []string `json:"ack"` MaxEvents int `json:"maxEvents,omitempty"` ReturnImmediately bool `json:"returnImmediately"` }
Struct to make a request to poll SSF Events to the configured transmitter
type ReceiverConfig ¶
type ReceiverConfig struct { // TransmitterUrl defines the URL for the transmitter that // the configured receiver will create a stream with and receive // events from. // // Required TransmitterUrl string // TransmitterTypeRfc defines whether this receiver is push or pull // // // Required TransmitterTypeRfc string // TransmitterPollUrl defines the URL that the receiver will use // to poll for SSF events. // // Note - Must be a subpath of TransmitterUrl // // Required TransmitterPollUrl string // TransmitterPushUrl defines the URL that the receiver will use // to received push events // // Note - Must be a subpath of TransmitterUrl // // Required TransmitterPushUrl string // TransmitterStreamUrl defines the URL that the receiver will use // to update/get the stream status. // // Note - Must be a subpath of TransmitterUrl // // Optional TransmitterStreamUrl string // EventsRequested specified the SSF events you want to receiver // from the transmitter. // // Required EventsRequested []events.EventType // AuthorizationToken is the authorization token used to authorize // your receiver with the specified transmitter // // Note - all transmitter's will require an authorization token // // Required AuthorizationToken string // PollCallback is used to configure the method that you want the // receiver to call after each automatic poll request. Each time // the poll interval timer is up, the receiver will make a request // to the specified transmitter and fetch available SSF events. It // will then call PollCallback with a list of those events // // Note - The PollCallback and PollInterval can also be configured // after initial receiver construction // // Optional PollCallback func(events []events.SsfEvent) // PollInterval defines, in seconds how often you want the receiver to // poll for SSF events any and pass them to your PollCallback function. // // Note - This field will not be used if the PollCallback isn't configured // // Optional, defaults to 300 (5 minutes) PollInterval int }
type SETCredentialChange ¶ added in v0.5.9
type SETCredentialChange struct { SubID SubId `json:"sub_id"` Events struct { Event struct { EventTimestamp int64 `json:"event_timestamp"` Reason string `json:"reason,omitempty"` CredentialType string `json:"credential_type"` ChangeType string `json:"change_type"` ReasonAdmin Reason `json:"reason_admin,omitempty"` ReasonUser Reason `json:"reason_user,omitempty"` Subject Subject `json:"subject,omitempty"` } `json:"https://schemas.openid.net/secevent/caep/event-type/credential-change"` } `json:"events"` jwt.StandardClaims }
type SETSessionRevoked ¶ added in v0.5.1
type SETSessionRevoked struct { SubID SubId `json:"sub_id"` Events struct { Event struct { EventTimestamp int64 `json:"event_timestamp"` Reason string `json:"reason,omitempty"` ReasonAdmin Reason `json:"reason_admin,omitempty"` ReasonUser Reason `json:"reason_user,omitempty"` Subject Subject `json:"subject,omitempty"` } `json:"https://schemas.openid.net/secevent/caep/event-type/session-revoked"` } `json:"events"` jwt.StandardClaims }
type SETVerification ¶ added in v0.7.1
type SETVerification struct { SubID SubId `json:"sub_id"` Events struct { Event struct { EventTimestamp int64 `json:"event_timestamp"` State string `json:"state,omitempty"` } `json:"https://schemas.openid.net/secevent/ssf/event-type/verification"` } `json:"events"` jwt.StandardClaims }
type SsfDelivery ¶
type SsfDelivery struct { DeliveryMethod string `json:"method"` EndpointUrl string `json:"endpoint_url,omitempty"` }
Struct that defines the deliver method for the Create Stream Request
type SsfReceiver ¶
type SsfReceiver interface { ConfigureCallback(callback func(events []event.SsfEvent), pollInterval int) error // Polls the configured receiver a returns a list of the available SSF // Events PollEvents() ([]event.SsfEvent, error) // Cleans up the Receiver's resources and deletes it from the transmitter DeleteReceiver() // Get stream status from the transmitter GetStreamStatus() (StreamStatus, error) // Get stream status from the transmitter RequestVerificationEvent() error // Enable the stream EnableStream() (StreamStatus, error) // Pause the stream PauseStream() (StreamStatus, error) // Disable the stream DisableStream() (StreamStatus, error) // Disable the stream PrintStream() }
Represents the interface for the SSF receiver with user facing methods
func ConfigureSsfReceiver ¶
func ConfigureSsfReceiver(cfg ReceiverConfig, streamId string) (SsfReceiver, error)
Initializes the SSF Receiver based on the specified configuration.
Returns an error if any process of configuring the receiver, registering it with the transmitter, or setting up the poll interval failed
type SsfReceiverImplementation ¶
type SsfReceiverImplementation struct {
// contains filtered or unexported fields
}
The struct that contains all the necessary fields and methods for the SSF Receiver's implementation
func (*SsfReceiverImplementation) ConfigureCallback ¶
func (receiver *SsfReceiverImplementation) ConfigureCallback(callback func(events []events.SsfEvent), pollInterval int) error
TODO: Not Yet Implemented
func (*SsfReceiverImplementation) DeleteReceiver ¶
func (receiver *SsfReceiverImplementation) DeleteReceiver()
Cleans up the resources used by the Receiver and deletes the Receiver's stream from the transmitter
func (*SsfReceiverImplementation) DisableStream ¶
func (receiver *SsfReceiverImplementation) DisableStream() (StreamStatus, error)
func (*SsfReceiverImplementation) EnableStream ¶
func (receiver *SsfReceiverImplementation) EnableStream() (StreamStatus, error)
func (*SsfReceiverImplementation) GetStreamStatus ¶
func (receiver *SsfReceiverImplementation) GetStreamStatus() (StreamStatus, error)
func (*SsfReceiverImplementation) InitPollInterval ¶
func (receiver *SsfReceiverImplementation) InitPollInterval()
Initializes the poll interval for the receiver that will intermittently send SSF Events to the specified callback function
func (*SsfReceiverImplementation) PauseStream ¶
func (receiver *SsfReceiverImplementation) PauseStream() (StreamStatus, error)
func (*SsfReceiverImplementation) PollEvents ¶
func (receiver *SsfReceiverImplementation) PollEvents() ([]events.SsfEvent, error)
Polls the transmitter for all available SSF Events, returning them as a list for use
func (*SsfReceiverImplementation) PrintStream ¶ added in v0.5.2
func (receiver *SsfReceiverImplementation) PrintStream()
func (*SsfReceiverImplementation) RequestVerificationEvent ¶ added in v0.7.1
func (receiver *SsfReceiverImplementation) RequestVerificationEvent() error
type StreamConfig ¶ added in v0.5.1
type StreamConfig struct { StreamId string `json:"stream_id"` Issuer string `json:"iss"` Audience string `json:"aud"` EventsSupported []string `json:"events_supported"` EventsRequested []string `json:"events_requested"` EventsDelivered []string `json:"events_delivered"` Delivery SsfDelivery `json:"delivery"` Description string `json:"description,omitempty"` }
type StreamStatus ¶
type StreamStatus int
const ( StreamEnabled StreamStatus = iota + 1 StreamPaused StreamDisabled )
type StreamStatusResponse ¶ added in v0.7.1
type StreamSubjectRequest ¶ added in v0.5.4
type StreamSubjectRequest struct { StreamID string `json:"stream_id,omitempty"` Subject SubId `json:"subject,omitempty"` Verified bool `json:"verified,omitempty"` }
Struct to make subject changes to a stream
type StreamVerificationState ¶ added in v0.7.1
type StreamVerificationState string
type TransmitterConfig ¶
type TransmitterConfig struct { Issuer string `json:"issuer"` JwksUri string `json:"jwks_uri,omitempty"` DeliveryMethodsSupported []string `json:"delivery_methods_supported,omitempty"` ConfigurationEndpoint string `json:"configuration_endpoint,omitempty"` StatusEndpoint string `json:"status_endpoint,omitempty"` VerificationEndpoint string `json:"verification_endpoint,omitempty"` AddSubjectEndpoint string `json:"add_subject_endpoint,omitempty"` DeleteStreamEndpoint string `json:"delete_stream_endpoint,omitempty"` RemoveSubjectEndpoint string `json:"remove_subject_endpoint,omitempty"` SpecVersion string `json:"spec_version,omitempty"` AuthorizationSchemes []map[string]interface{} `json:"authorization_schemes,omitempty"` }
Struct used to read a Transmitter's configuration
type UpdateStreamRequest ¶
type UpdateStreamRequest struct { StreamId string `json:"stream_id"` Status string `json:"status"` Reason string `json:"reason"` }
Struct to make a request to update the stream status
type VerificationRequest ¶ added in v0.7.1
type VerificationRequest struct { StreamID string `json:"stream_id,omitempty"` State string `json:"state,omitempty"` }
Struct to make verification event request