Documentation ¶
Index ¶
Constants ¶
const InternalFeatureLevel = "internal"
Variables ¶
This section is empty.
Functions ¶
func PlainText ¶
PlainText is a Decode function that can be used to fetch tokens that are not encrypted. Simply return the same token back
func ValidateResponse ¶
ValidateResponse function when given client and response checks if the response has any errors by also looking at the status code
Types ¶
type Decode ¶
Decode a function to decode a given value
func NewGPGDecypter ¶
NewGPGDecypter takes a passphrase and returns a GPG based Decypter decode function
type JSONKeys ¶
type JSONKeys struct {
Keys []interface{} `json:"keys"`
}
JSONKeys the JSON structure for unmarshalling the keys
type Service ¶
type Service interface { GetUser(ctx context.Context) (*User, error) GetAuthURL() string NewSaClient() (*authclient.Client, error) ResolveUserToken(ctx context.Context, target, userToken string) (user, accessToken string, err error) ResolveSaToken(ctx context.Context, target string) (username, accessToken string, err error) GetPublicKeys() ([]*rsa.PublicKey, error) }
func NewAuthService ¶
func NewAuthService(config *configuration.Data, options ...configuration.HTTPClientOption) (Service, error)
NewAuthService retrieves SA OAuth token and creates a service instance that is the main point for communication with auth service
func NewAuthServiceWithToken ¶
func NewAuthServiceWithToken(config *configuration.Data, saToken string, options ...configuration.HTTPClientOption) Service
NewAuthService creates a service instance that is the main point for communication with auth service
type TenantToken ¶
type TenantToken struct {
Token *jwt.Token
}
TenantToken the token on the tenant
func (TenantToken) Email ¶
func (t TenantToken) Email() string
Email returns the value of the `email` claim in the token
func (TenantToken) Subject ¶
func (t TenantToken) Subject() uuid.UUID
Subject returns the value of the `sub` claim in the token
func (TenantToken) Username ¶
func (t TenantToken) Username() string
Username returns the value of the `preferred_username` claim in the token
type User ¶
type User struct { ID uuid.UUID UserData *authclient.UserDataAttributes OpenShiftUsername string OpenShiftUserToken string }
User contains user data retrieved from auth service and OS username and user token