Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoneOfConstructorArgsCanBeEmpty = errors.New("none of the arguments can be empty; neither 'Realm', 'User', 'Password', 'BaseURI' or 'Port'") ErrResponseBodyMapNotContainKeyAccessToken = errors.New("response body map does not contain key 'access_token'") ErrResponseBodyMapNotContainKeyRefreshToken = errors.New("response body map does not contain key 'refresh_token'") ErrResponseBodyMapNotContainKeyPgcdiPrivileges = errors.New("response body map does not contain key 'pgcdi_privileges'") TemplateForErrorCannotCreateClusterInvalidRole = "User '%s' is not allowed to create cluster. Only users assigned to role '%s' can create cluster. User roles: '%s'" TemplateForErrorCannotCreateClusterRealmsDiffer = "Cannot create cluster. User realm and tenant differ. Realm: '%s', tenant: '%s'" TemplateForErrorCannotCreateClusterInDefaultRealm = "User '%s' is not allowed to create cluster in master realm '%s'" )
Functions ¶
This section is empty.
Types ¶
type KeycloakClient ¶
type KeycloakClient struct {
Realm string
UserName string
UserPassword string
AccessToken string
RefreshToken string
// contains filtered or unexported fields
}
func NewKeycloak ¶
func NewKeycloak(realm, userName, userPassword, baseURI, endpoint string) (*KeycloakClient, error)
NewKeycloak Creates and returns a new instance of the Keycloak
func (*KeycloakClient) GetToken ¶
func (k *KeycloakClient) GetToken() string
GetToken Returns bearer token.
func (*KeycloakClient) InitConnection ¶
func (k *KeycloakClient) InitConnection() error
InitConnection Init connection with Keycloak service. In this method bearer token is taken
func (*KeycloakClient) IsInit ¶
func (k *KeycloakClient) IsInit() bool
func (*KeycloakClient) String ¶
func (k *KeycloakClient) String() string
func (*KeycloakClient) UserIsAllowedToCreateCluster ¶
func (k *KeycloakClient) UserIsAllowedToCreateCluster() error
UserIsAllowedToCreateCluster Verify if user is allowed to create cluster
type KeycloakHttpError ¶
func (*KeycloakHttpError) Error ¶
func (e *KeycloakHttpError) Error() string
Implement the Error() method for the error interface
Click to show internal directories.
Click to hide internal directories.