Documentation
¶
Index ¶
- Constants
- func DecodeToken(token string) ([]byte, error)
- func FilterWorkspacesUserHasAccessTo(workspaceIds []string, accessToken string) ([]string, error)
- func GetCompositeClientRolesByUserID(ctx context.Context, token, realm, clientID, userID string, ...) ([]*gocloak.Role, error)
- func GetLoginURL(csrfToken string) string
- func GetOIDCInfo(discoveryEndpoint string) (types.OIDCInfo, error)
- func GetResourceServerAccessToken() (string, error)
- func GetTokensUsingAuthCode(_ctx context.Context, authCode, redirectURI, clientID, clientSecret string) (types.Tokens, error)
- func GetUMAInfo(umaConfigEndpoint string) (types.UMAInfo, error)
- func GetUserInfo(_ctx context.Context, accessToken string) (types.UserInfo, error)
- func GetUserInfoFromOIDC(accessToken string) (types.UserInfo, error)
- func Setup() error
Constants ¶
const ( // URL_READ_WORKSPACE is the endpoint used to read a workspace URL_READ_WORKSPACE = "/workspaces/%s" // %s should be filled with workspace id // VERB_ALL_PERMS is the verb that allows all actions on the resource VERB_ALL_PERMS = "all" // VERB_READ_WORKSPACE is the verb that allows read permission on a workspace VERB_READ_WORKSPACE = "GET" )
Variables ¶
This section is empty.
Functions ¶
func DecodeToken ¶
DecodeToken decodes the token using the JSON web keys from the server
func FilterWorkspacesUserHasAccessTo ¶
FilterWorkspacesUserHasAccessTo filters the provided workspace Ids and returns only the ones the user has access to
func GetCompositeClientRolesByUserID ¶
func GetCompositeClientRolesByUserID(ctx context.Context, token, realm, clientID, userID string, briefRepresentation bool) ([]*gocloak.Role, error)
GetCompositeClientRolesByUserID is our custom version of GetCompositeClientRolesByUserID This is a workaround for this issue https://github.com/Nerzal/gocloak/issues/306
func GetLoginURL ¶
GetLoginURL returns the URL of the authz server frontend to which the user should be redirected for login
func GetOIDCInfo ¶
GetOIDCInfo gets the OIDC information from the authorization server.
func GetResourceServerAccessToken ¶
GetResourceServerAccessToken returns the access token for the resource server
func GetTokensUsingAuthCode ¶
func GetTokensUsingAuthCode(_ctx context.Context, authCode, redirectURI, clientID, clientSecret string) (types.Tokens, error)
GetTokensUsingAuthCode gets access and refresh tokens according to https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
func GetUMAInfo ¶
GetUMAInfo gets the UMA information from the authorization server.
func GetUserInfo ¶
GetUserInfo retrieves the user's information from the authz server, given the user's access token
func GetUserInfoFromOIDC ¶
GetUserInfoFromOIDC returns the user's identifying information from the OIDC user info endpoint
Types ¶
This section is empty.