yorcoidc

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

README

yorcoidc

OpenID connect client used by Yorc LEXIS plugins

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// ExchangeToken exchanges a token to get an access and a refresh token for this client
	ExchangeToken(ctx context.Context, accessToken string) (string, string, error)
	// IsAccessTokenValid checks if an access token is still valid
	IsAccessTokenValid(ctx context.Context, accessToken string) (bool, error)
	// RefreshToken refreshes the access token
	RefreshToken(ctx context.Context) (string, string, error)
	// GetAccessToken returns the access token
	GetAccessToken() (string, error)
	// GetRefreshToken returns the refresh token
	GetRefreshToken() (string, error)
	// GetUserInfo returns info on the user (name, attributes, etc..)
	GetUserInfo(ctx context.Context, accessToken string) (UserInfo, error)
}

Client is the client interface to AAI service

func GetClient

func GetClient(deploymentID, url, clientID, clientSecret, realm string) Client

GetClient returns a client of the Authentication and Authorization Infrastructure service

type UserInfo

type UserInfo struct {
	Sub               string                         `json:"sub,omitempty"`
	Name              string                         `json:"name,omitempty"`
	GivenName         string                         `json:"given_name,omitempty"`
	FamilyName        string                         `json:"family_name,omitempty"`
	MiddleName        string                         `json:"middle_name,omitempty"`
	Nickname          string                         `json:"nickname,omitempty"`
	PreferredUsername string                         `json:"preferred_username,omitempty"`
	Profile           string                         `json:"profile,omitempty"`
	Picture           string                         `json:"picture,omitempty"`
	Website           string                         `json:"website,omitempty"`
	Email             string                         `json:"email,omitempty"`
	Gender            string                         `json:"gender,omitempty"`
	ZoneInfo          string                         `json:"zoneinfo,omitempty"`
	Locale            string                         `json:"locale,omitempty"`
	PhoneNumber       string                         `json:"phone_number,omitempty"`
	Attributes        map[string][]map[string]string `json:"attributes,omitempty"`
}

UserInfo provides details on the user info in an acess token

func (UserInfo) GetName

func (u UserInfo) GetName() string

Jump to

Keyboard shortcuts

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