authserver

package
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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

func DecodeToken(token string) ([]byte, error)

DecodeToken decodes the token using the JSON web keys from the server

func FilterWorkspacesUserHasAccessTo

func FilterWorkspacesUserHasAccessTo(workspaceIds []string, accessToken string) ([]string, error)

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

func GetLoginURL(csrfToken string) string

GetLoginURL returns the URL of the authz server frontend to which the user should be redirected for login

func GetOIDCInfo

func GetOIDCInfo(discoveryEndpoint string) (types.OIDCInfo, error)

GetOIDCInfo gets the OIDC information from the authorization server.

func GetResourceServerAccessToken

func GetResourceServerAccessToken() (string, error)

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

func GetUMAInfo(umaConfigEndpoint string) (types.UMAInfo, error)

GetUMAInfo gets the UMA information from the authorization server.

func GetUserInfo

func GetUserInfo(_ctx context.Context, accessToken string) (types.UserInfo, error)

GetUserInfo retrieves the user's information from the authz server, given the user's access token

func GetUserInfoFromOIDC

func GetUserInfoFromOIDC(accessToken string) (types.UserInfo, error)

GetUserInfoFromOIDC returns the user's identifying information from the OIDC user info endpoint

func Setup

func Setup() error

Setup sets up the authorization server.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL