yorcoidc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

README

yorcoidc

OpenID connect utilities 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)
	// GetUserInfo returns info on the user (name, attributes, etc..)
	GetUserInfo(ctx context.Context, accessToken string) (UserInfo, error)
	// RefreshToken refreshes a token to get a new access and a refresh token for this client
	RefreshToken(ctx context.Context, refreshToken string) (string, string, error)
}

Client is the client interface to AAI service

func GetClient

func GetClient(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"`
}

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