Documentation ¶
Index ¶
- Variables
- func GetActions() []security.Action
- func MakeAuthorizationCommunicationsComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
- func MakeCommunicationsHandler(e endpoint.Endpoint, logger log.Logger) *http_transport.Server
- func MakeGetActionsEndpoint(component Component) cs.Endpoint
- func MakeSendEmailEndpoint(component Component) cs.Endpoint
- func MakeSendSMSEndpoint(component Component) cs.Endpoint
- type Component
- type Endpoints
- type KeycloakCommunicationsClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( COMGetActions = newAction("COM_GetActions", security.ScopeRealm) COMSendEmail = newAction("COM_SendEmail", security.ScopeRealm) COMSendSMS = newAction("COM_SendSMS", security.ScopeRealm) )
Creates constants for API method names
Functions ¶
func MakeAuthorizationCommunicationsComponentMW ¶
func MakeAuthorizationCommunicationsComponentMW(logger log.Logger, authorizationManager security.AuthorizationManager) func(Component) Component
MakeAuthorizationCommunicationsComponentMW checks authorization and return an error if the action is not allowed.
func MakeCommunicationsHandler ¶
MakeCommunicationsHandler make an HTTP handler for a Communications endpoint.
func MakeGetActionsEndpoint ¶
MakeGetActionsEndpoint creates an endpoint for GetActions
func MakeSendEmailEndpoint ¶
MakeSendEmailEndpoint makes the SendEmail Endpoint
func MakeSendSMSEndpoint ¶
MakeSendSMSEndpoint makes the SendSMS Endpoint
Types ¶
type Component ¶
type Component interface { GetActions(ctx context.Context) ([]api.ActionRepresentation, error) SendEmail(ctx context.Context, realmName string, emailRep api.EmailRepresentation) error SendSMS(ctx context.Context, realmName string, smsRep api.SMSRepresentation) error }
Component interface exposes methods used by the bridge API
func NewComponent ¶
func NewComponent(keycloakCommunicationsClient KeycloakCommunicationsClient, logger internal.Logger) Component
NewComponent returns the communications component.
type Endpoints ¶
type Endpoints struct { GetActions endpoint.Endpoint SendEmail endpoint.Endpoint SendSMS endpoint.Endpoint }
Endpoints wraps a service behind a set of endpoints.
type KeycloakCommunicationsClient ¶
type KeycloakCommunicationsClient interface { SendEmail(accessToken string, reqRealmName string, realmName string, emailRep kc.EmailRepresentation) error SendSMS(accessToken string, realmName string, smsRep kc.SMSRepresentation) error }
KeycloakCommunicationsClient interface exposes methods we need to call to send requests to Keycloak communications API
Click to show internal directories.
Click to hide internal directories.