Documentation ¶
Index ¶
- Constants
- func GetPathToInsecureKeyring() string
- func GetServerInfo(keycloakHostname string, accesstoken string) (*ServerInfo, *SecError)
- func IsSecretNotFoundError(se *SecError) bool
- func SecAuthenticate(httpClient utils.HTTPClient, c *cli.Context, connectionRealm string, ...) (*AuthToken, *SecError)
- func SecClientGet(c *cli.Context) (*RegisteredClient, *SecError)
- func SecClientGetSecret(c *cli.Context) (*RegisteredClientSecret, *SecError)
- func SecRealmGet(authURL string, accessToken string, realmName string) (*KeycloakRealm, *SecError)
- func SecRefreshAccessToken(httpClient utils.HTTPClient, connection *connections.Connection, ...) (*AuthToken, *SecError)
- func SecRefreshTokens(httpClient utils.HTTPClient, c *cli.Context) (*AuthToken, *SecError)
- func SecUserGet(c *cli.Context) (*RegisteredUser, *SecError)
- type AuthToken
- type ClientMockAuthenticate
- type ClientMockRequestFail
- type KeycloakAPIError
- type KeycloakRealm
- type KeyringSecret
- type RegisteredClient
- type RegisteredClientSecret
- type RegisteredClients
- type RegisteredTheme
- type RegisteredThemes
- type RegisteredUser
- type RegisteredUsers
- type Result
- type Role
- type SecError
- func DeleteSecretFromKeyring(connectionID, uName string) *SecError
- func GetSecretFromKeyring(connectionID, uName string) (string, *SecError)
- func GetSuggestedThemes(keycloakHostname string, accesstoken string) (string, string, *SecError)
- func SecClientAppendURL(c *cli.Context, gatekeeperURL string) *SecError
- func SecClientCreate(c *cli.Context) *SecError
- func SecKeyGetSecret(connectionID, username string) (string, *SecError)
- func SecKeyUpdate(connectionID string, username string, password string) *SecError
- func SecRealmCreate(c *cli.Context) *SecError
- func SecRoleCreate(c *cli.Context) *SecError
- func SecUserAddRole(c *cli.Context) *SecError
- func SecUserCreate(c *cli.Context) *SecError
- func SecUserSetPW(c *cli.Context) *SecError
- func StoreSecretInKeyring(connectionID, uName, pass string) *SecError
- type ServerInfo
Constants ¶
const CodewindCliID string = "codewind-cli"
CodewindCliID : master realm name
const CodewindClientID string = "codewind-backend"
CodewindClientID : master realm name
const KeycloakAdminClientID string = "admin-cli"
KeycloakAdminClientID : master realm name
const KeycloakMasterRealm string = "master"
KeycloakMasterRealm : master realm name
const KeyringServiceName string = "org.eclipse.codewind"
KeyringServiceName : name
Variables ¶
This section is empty.
Functions ¶
func GetPathToInsecureKeyring ¶
func GetPathToInsecureKeyring() string
GetPathToInsecureKeyring gets the path to the insecureKeychain.json
func GetServerInfo ¶
func GetServerInfo(keycloakHostname string, accesstoken string) (*ServerInfo, *SecError)
GetServerInfo - fetch Keycloak server info
func IsSecretNotFoundError ¶
IsSecretNotFoundError : Test whether a secret error is due to the secret not existing.
func SecAuthenticate ¶
func SecAuthenticate(httpClient utils.HTTPClient, c *cli.Context, connectionRealm string, connectionClient string) (*AuthToken, *SecError)
SecAuthenticate - sends credentials to the auth server for a specific realm and returns an AuthToken connectionRealm can be used to override the supplied context arguments
func SecClientGet ¶
func SecClientGet(c *cli.Context) (*RegisteredClient, *SecError)
SecClientGet : Retrieve Client information
func SecClientGetSecret ¶
func SecClientGetSecret(c *cli.Context) (*RegisteredClientSecret, *SecError)
SecClientGetSecret : Retrieve the client secret for the supplied clientID
func SecRealmGet ¶
func SecRealmGet(authURL string, accessToken string, realmName string) (*KeycloakRealm, *SecError)
SecRealmGet : Reads a realm in Keycloak
func SecRefreshAccessToken ¶
func SecRefreshAccessToken(httpClient utils.HTTPClient, connection *connections.Connection, refreshToken string) (*AuthToken, *SecError)
SecRefreshAccessToken : Obtain an access token using a refresh token
func SecRefreshTokens ¶
SecRefreshTokens : Retrieve new tokens using the cached refresh token
func SecUserGet ¶
func SecUserGet(c *cli.Context) (*RegisteredUser, *SecError)
SecUserGet : Get user from Keycloak
Types ¶
type AuthToken ¶
type AuthToken struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` TokenType string `json:"token_type"` NotBeforePolicy int `json:"not-before-policy"` SessionState string `json:"session_state"` Scope string `json:"scope"` }
AuthToken from the keycloak server after successfully authenticating
type ClientMockAuthenticate ¶
type ClientMockAuthenticate struct { StatusCode int Body io.ReadCloser }
ClientMockAuthenticate : Client Mock with a concrete response and status code
type ClientMockRequestFail ¶
type ClientMockRequestFail struct { }
type KeycloakAPIError ¶
type KeycloakAPIError struct { HTTPStatus int Error string `json:"error"` ErrorDescription string `json:"error_description"` ErrorMessage string `json:"errorMessage"` }
KeycloakAPIError : Error responses from Keycloak
type KeycloakRealm ¶
type KeycloakRealm struct { ID string `json:"id"` Realm string `json:"realm"` DisplayName string `json:"displayName"` Enabled bool `json:"enabled"` LoginTheme string `json:"loginTheme"` }
KeycloakRealm : A Keycloak Realm
type KeyringSecret ¶
type KeyringSecret struct { Service []byte `json:"service"` Username []byte `json:"username"` Password []byte `json:"password"` }
KeyringSecret : Secret
type RegisteredClient ¶
type RegisteredClient struct { ID string `json:"id"` ClientID string `json:"clientId"` Name string `json:"name"` RedirectUris []string `json:"redirectUris"` WebOrigins []string `json:"webOrigins"` }
RegisteredClient : Registered client
type RegisteredClientSecret ¶
RegisteredClientSecret : Client secret
type RegisteredClients ¶
type RegisteredClients struct {
Collection []RegisteredClient
}
RegisteredClients : A collection of registered clients
type RegisteredTheme ¶
RegisteredTheme : A Keycloak theme
type RegisteredThemes ¶
type RegisteredThemes struct { Common []RegisteredTheme `json:"common"` Admin []RegisteredTheme `json:"admin"` Login []RegisteredTheme `json:"login"` Welcome []RegisteredTheme `json:"welcome"` Account []RegisteredTheme `json:"account"` Email []RegisteredTheme `json:"email"` }
RegisteredThemes : A collection of themes
type RegisteredUser ¶
RegisteredUser : details of a registered user
type RegisteredUsers ¶
type RegisteredUsers struct {
Collection []RegisteredUser
}
RegisteredUsers : A collection of registered users
type Role ¶
type Role struct { ID string `json:"id"` Name string `json:"name"` Composite bool `json:"composite"` ClientRole bool `json:"clientRole"` ContainerID string `json:"containerId"` }
Role : Access role
type SecError ¶
SecError : Security package errors
func DeleteSecretFromKeyring ¶
DeleteSecretFromKeyring deletes the secret from either the system keyring or our insecure keyring.
func GetSecretFromKeyring ¶
GetSecretFromKeyring gets the secret from either the system keyring or our insecure keyring.
func GetSuggestedThemes ¶ added in v0.14.0
GetSuggestedThemes - Recommends the Codewind theme, else Che, else keycloak default Returns the loginTheme, accountTheme, optionalError
func SecClientAppendURL ¶
SecClientAppendURL : Append an additional url to the whitelist
func SecClientCreate ¶
SecClientCreate : Create a new client in Keycloak
func SecKeyGetSecret ¶
SecKeyGetSecret : retrieve secret / credentials from the keyring
func SecKeyUpdate ¶
SecKeyUpdate : Creates or updates a key in the platforms keyring
func SecRealmCreate ¶
SecRealmCreate : Create a new realm in Keycloak
func SecRoleCreate ¶
SecRoleCreate : Create a new role in Keycloak
func SecUserAddRole ¶
SecUserAddRole : Adds a role to a specified user
func SecUserCreate ¶
SecUserCreate : Create a new realm in Keycloak
func SecUserSetPW ¶
SecUserSetPW : Resets the users password in keycloak to a new one supplied
func StoreSecretInKeyring ¶
StoreSecretInKeyring stores the secret in either the system keyring or our insecure keyring.
type ServerInfo ¶
type ServerInfo struct {
Themes RegisteredThemes `json:"themes"`
}
ServerInfo : A collection of themes