Documentation
¶
Index ¶
- Variables
- func DoHttpRequest(client ApiClient, options *HttpRequestOptions) (*http.Response, error)
- func DoHttpRequestWithResult[T any](client ApiClient, options *HttpRequestOptions, result *T) (*http.Response, error)
- func StartMockServer(ctx context.Context, config *KeycloakMockServerConfig) *http.Server
- type ApiClient
- type AuthorizationType
- type Client
- type ClientSet
- func (c *ClientSet) GetUserSourceClient(userSource config.UserSourceConfig) (*KeycloakClient, error)
- func (c *ClientSet) GetUserTargetGitLabClient(userTarget *config.UserTargetConfig) (*GitLabClient, error)
- func (c *ClientSet) GetUserTargetMailcowClient(userTarget *config.UserTargetConfig) (*MailcowClient, error)
- func (c *ClientSet) GetUserTargetOutlineClient(userTarget *config.UserTargetConfig) (*OutlineClient, error)
- func (c *ClientSet) TestConnections() error
- type CreateMailboxOptions
- type GitLabClient
- type GitLabClientOptions
- type HttpMethod
- type HttpRequestOptions
- type JWT
- type KeycloakClient
- func (k *KeycloakClient) GetBrokeUserList(ctx context.Context) ([]*user.User, error)
- func (k *KeycloakClient) GetFullGroupList(ctx context.Context) ([]*gocloak.Group, error)
- func (k *KeycloakClient) GetGroup(ctx context.Context, id string) (*gocloak.Group, error)
- func (k *KeycloakClient) GetGroupUsers(ctx context.Context, id string) ([]*gocloak.User, error)
- func (k *KeycloakClient) GetGroups(ctx context.Context) ([]*gocloak.Group, error)
- func (k *KeycloakClient) GetGroupsCount(ctx context.Context) (int, error)
- func (k *KeycloakClient) GetRoleUsers(ctx context.Context, name string) ([]*gocloak.User, error)
- func (k *KeycloakClient) GetUserGroups(ctx context.Context, id string) ([]*gocloak.Group, error)
- func (k *KeycloakClient) GetUserRealmRoles(ctx context.Context, id string) (*gocloak.MappingsRepresentation, error)
- func (k *KeycloakClient) GetUsers(ctx context.Context) ([]*gocloak.User, error)
- func (k *KeycloakClient) GetUsersCount(ctx context.Context) (int, error)
- func (c *KeycloakClient) TestConnection() error
- type KeycloakClientOptions
- type KeycloakMockServerAccess
- type KeycloakMockServerConfig
- type KeycloakMockServerData
- type KeycloakMockServerGroup
- type KeycloakMockServerUser
- type MailcowClient
- func (c *MailcowClient) CreateMailbox(options *CreateMailboxOptions) error
- func (c MailcowClient) GetAuthorization() string
- func (c MailcowClient) GetAuthorizationType() AuthorizationType
- func (c MailcowClient) GetBaseUrl() string
- func (c MailcowClient) GetName() string
- func (c *MailcowClient) MailboxExists(email string) (bool, error)
- func (c *MailcowClient) TestConnection() error
- type MailcowClientOptions
- type MailcowMailboxResult
- type OutlineClient
- func (c OutlineClient) GetAuthorization() string
- func (c OutlineClient) GetAuthorizationType() AuthorizationType
- func (c OutlineClient) GetBaseUrl() string
- func (c OutlineClient) GetName() string
- func (c *OutlineClient) GetUserIdByMail(mail string) (*string, error)
- func (c *OutlineClient) TestConnection() error
- type OutlineClientOptions
- type Pagination
- type User
- type UserQueryOptions
- type UsersResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessToValueMap = map[string]gitlab.AccessLevelValue{
"Guest": gitlab.GuestPermissions,
"Reporter": gitlab.ReporterPermissions,
"Developer": gitlab.DeveloperPermissions,
"Maintainer": gitlab.MaintainerPermissions,
"Owner": gitlab.OwnerPermissions,
}
Functions ¶
func DoHttpRequest ¶
func DoHttpRequest(client ApiClient, options *HttpRequestOptions) (*http.Response, error)
func DoHttpRequestWithResult ¶
func StartMockServer ¶
func StartMockServer(ctx context.Context, config *KeycloakMockServerConfig) *http.Server
Types ¶
type ApiClient ¶
type ApiClient interface { GetName() string GetBaseUrl() string GetAuthorizationType() AuthorizationType GetAuthorization() string }
type AuthorizationType ¶
type AuthorizationType string
const ( AuthorizationTypeApiKey AuthorizationType = "API_KEY" AuthorizationTypeBearer AuthorizationType = "BEARER" )
type ClientSet ¶
type ClientSet struct { KeycloakClients map[string]*KeycloakClient MailcowClients map[string]*MailcowClient OutlineClients map[string]*OutlineClient GitLabClients map[string]*GitLabClient }
func GetClientSet ¶
func GetClientSet(config *config.BrokeConfig) (*ClientSet, error)
func (*ClientSet) GetUserSourceClient ¶
func (c *ClientSet) GetUserSourceClient(userSource config.UserSourceConfig) (*KeycloakClient, error)
func (*ClientSet) GetUserTargetGitLabClient ¶
func (c *ClientSet) GetUserTargetGitLabClient(userTarget *config.UserTargetConfig) (*GitLabClient, error)
func (*ClientSet) GetUserTargetMailcowClient ¶
func (c *ClientSet) GetUserTargetMailcowClient(userTarget *config.UserTargetConfig) (*MailcowClient, error)
func (*ClientSet) GetUserTargetOutlineClient ¶
func (c *ClientSet) GetUserTargetOutlineClient(userTarget *config.UserTargetConfig) (*OutlineClient, error)
func (*ClientSet) TestConnections ¶
type CreateMailboxOptions ¶
type GitLabClient ¶
type GitLabClient struct { Client *gitlab.Client Options *GitLabClientOptions }
func NewGitLabClient ¶
func NewGitLabClient(config *GitLabClientOptions) (*GitLabClient, error)
func (*GitLabClient) TestConnection ¶
func (c *GitLabClient) TestConnection() error
type GitLabClientOptions ¶
type HttpMethod ¶
type HttpMethod string
const ( GET HttpMethod = "GET" POST HttpMethod = "POST" PUT HttpMethod = "PUT" DELETE HttpMethod = "DELETE" )
type HttpRequestOptions ¶
type HttpRequestOptions struct { Method HttpMethod ContextPath string Body interface{} ExpectedStatusCode int }
type KeycloakClient ¶
type KeycloakClient struct { Client *gocloak.GoCloak Token *gocloak.JWT Realm string Options *KeycloakClientOptions }
func NewKeycloakClient ¶
func NewKeycloakClient(ctx context.Context, options *KeycloakClientOptions) (*KeycloakClient, error)
func (*KeycloakClient) GetBrokeUserList ¶
func (*KeycloakClient) GetFullGroupList ¶
func (k *KeycloakClient) GetFullGroupList(ctx context.Context) ([]*gocloak.Group, error)
func (*KeycloakClient) GetGroup ¶
func (k *KeycloakClient) GetGroup(ctx context.Context, id string) (*gocloak.Group, error)
func (*KeycloakClient) GetGroupUsers ¶
func (k *KeycloakClient) GetGroupUsers(ctx context.Context, id string) ([]*gocloak.User, error)
func (*KeycloakClient) GetGroups ¶
func (k *KeycloakClient) GetGroups(ctx context.Context) ([]*gocloak.Group, error)
func (*KeycloakClient) GetGroupsCount ¶
func (k *KeycloakClient) GetGroupsCount(ctx context.Context) (int, error)
func (*KeycloakClient) GetRoleUsers ¶
func (k *KeycloakClient) GetRoleUsers(ctx context.Context, name string) ([]*gocloak.User, error)
func (*KeycloakClient) GetUserGroups ¶
func (k *KeycloakClient) GetUserGroups(ctx context.Context, id string) ([]*gocloak.Group, error)
func (*KeycloakClient) GetUserRealmRoles ¶
func (k *KeycloakClient) GetUserRealmRoles(ctx context.Context, id string) (*gocloak.MappingsRepresentation, error)
func (*KeycloakClient) GetUsers ¶
func (k *KeycloakClient) GetUsers(ctx context.Context) ([]*gocloak.User, error)
func (*KeycloakClient) GetUsersCount ¶
func (k *KeycloakClient) GetUsersCount(ctx context.Context) (int, error)
func (*KeycloakClient) TestConnection ¶
func (c *KeycloakClient) TestConnection() error
type KeycloakClientOptions ¶
type KeycloakMockServerConfig ¶
type KeycloakMockServerConfig struct { Port int `yaml:"port"` AdminUsername string `yaml:"adminUsername"` AdminPassword string `yaml:"adminPassword"` Realm string `yaml:"realm"` Data KeycloakMockServerData `yaml:"data"` }
type KeycloakMockServerData ¶
type KeycloakMockServerData struct { Users []KeycloakMockServerUser `json:"users"` Groups []KeycloakMockServerGroup `json:"groups"` }
type KeycloakMockServerGroup ¶
type KeycloakMockServerUser ¶
type MailcowClient ¶
type MailcowClient struct {
Options *MailcowClientOptions
}
func NewMailcowClient ¶
func NewMailcowClient(options *MailcowClientOptions) (*MailcowClient, error)
func (*MailcowClient) CreateMailbox ¶
func (c *MailcowClient) CreateMailbox(options *CreateMailboxOptions) error
func (MailcowClient) GetAuthorization ¶
func (c MailcowClient) GetAuthorization() string
func (MailcowClient) GetAuthorizationType ¶
func (c MailcowClient) GetAuthorizationType() AuthorizationType
func (MailcowClient) GetBaseUrl ¶
func (c MailcowClient) GetBaseUrl() string
func (MailcowClient) GetName ¶
func (c MailcowClient) GetName() string
func (*MailcowClient) MailboxExists ¶
func (c *MailcowClient) MailboxExists(email string) (bool, error)
func (*MailcowClient) TestConnection ¶
func (c *MailcowClient) TestConnection() error
type MailcowClientOptions ¶
type MailcowMailboxResult ¶
type OutlineClient ¶
type OutlineClient struct {
Options *OutlineClientOptions
}
func NewOutlineClient ¶
func NewOutlineClient(options *OutlineClientOptions) (*OutlineClient, error)
func (OutlineClient) GetAuthorization ¶
func (c OutlineClient) GetAuthorization() string
func (OutlineClient) GetAuthorizationType ¶
func (c OutlineClient) GetAuthorizationType() AuthorizationType
func (OutlineClient) GetBaseUrl ¶
func (c OutlineClient) GetBaseUrl() string
func (OutlineClient) GetName ¶
func (c OutlineClient) GetName() string
func (*OutlineClient) GetUserIdByMail ¶
func (c *OutlineClient) GetUserIdByMail(mail string) (*string, error)
func (*OutlineClient) TestConnection ¶
func (c *OutlineClient) TestConnection() error
type OutlineClientOptions ¶
type Pagination ¶
type UserQueryOptions ¶
type UsersResponse ¶
type UsersResponse struct { Data []User `json:"data"` Pagination Pagination `json:"pagination"` }
Click to show internal directories.
Click to hide internal directories.