Documentation ¶
Index ¶
- func MakeExportEndpoint(c Component) endpoint.Endpoint
- func MakeHTTPExportHandler(e endpoint.Endpoint) *http_transport.Server
- func MakeStoreAndExportEndpoint(c Component) endpoint.Endpoint
- type Component
- type DB
- type Endpoints
- type KeycloakClient
- type Module
- type RealmExporter
- type Storage
- type StorageModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeExportEndpoint ¶
MakeExportEndpoint makes endpoint that reads the config in DB.
func MakeHTTPExportHandler ¶
func MakeHTTPExportHandler(e endpoint.Endpoint) *http_transport.Server
MakeHTTPExportHandler makes a HTTP handler for the export endpoint.
func MakeStoreAndExportEndpoint ¶
MakeStoreAndExportEndpoint makes the endpoint that forces the keycloak exportation and stores the config in DB.
Types ¶
type Component ¶
type Component interface { Export(ctx context.Context) (map[string]interface{}, error) StoreAndExport(ctx context.Context) (map[string]interface{}, error) }
Component is the user component interface.
func NewComponent ¶
func NewComponent(componentName, componentVersion string, logger internal.Logger, re RealmExporter, s Storage) Component
NewComponent returns an export component.
type DB ¶
type DB interface { Exec(query string, args ...interface{}) (sql.Result, error) QueryRow(query string, args ...interface{}) sqltypes.SQLRow }
DB interface
type KeycloakClient ¶
type KeycloakClient interface { GetRealms(accessToken string) ([]keycloak.RealmRepresentation, error) ExportRealm(accessToken string, realmName string) (keycloak.RealmRepresentation, error) }
KeycloakClient is the interface of the keycloak client.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module wraps a KeycloakClient to Get/Export realms
func NewModule ¶
func NewModule(kc KeycloakClient, logger internal.Logger) *Module
NewModule returns a user module.
func (*Module) ExportRealm ¶
func (m *Module) ExportRealm(ctx context.Context, realmName string) (keycloak.RealmRepresentation, error)
ExportRealm exports the desired realm.
type RealmExporter ¶
type RealmExporter interface { GetRealms(ctx context.Context) ([]string, error) ExportRealm(ctx context.Context, realmName string) (keycloak.RealmRepresentation, error) }
RealmExporter interface
type Storage ¶
type Storage interface { Save(componentName, version string, config []byte) error Read(componentName, version string) ([]byte, error) }
Storage interface
type StorageModule ¶
type StorageModule struct {
// contains filtered or unexported fields
}
StorageModule is the module that saves configs in Storage DB.
func NewConfigStorageModule ¶
func NewConfigStorageModule(db DB) *StorageModule
NewConfigStorageModule returns the storage module.