Documentation ¶
Index ¶
- func GetAccessToken(req TokenRequest) (string, error)
- func GetConfiguredAccounts() (accounts []string, err error)
- func GetLoadedAccounts() (accountNames []string, err error)
- func GetMytoken(req MytokenRequest) (string, error)
- type AccountInfoResponse
- type IssuerInfo
- type MytokenRequest
- type MytokenResponse
- type OIDCAgentError
- type TokenRequest
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetAccessToken(req TokenRequest) (string, error)
GetAccessToken gets an access token
func GetConfiguredAccounts ¶ added in v0.3.0
GetConfiguredAccounts returns a list of all accounts which are configured for oidc-agent
func GetLoadedAccounts ¶ added in v0.3.0
GetLoadedAccounts returns a list of all accounts which are currently loaded by oidc-agent
func GetMytoken ¶ added in v0.4.0
func GetMytoken(req MytokenRequest) (string, error)
GetMytoken gets an mytoken
Types ¶
type AccountInfoResponse ¶ added in v0.5.0
type AccountInfoResponse map[string]IssuerInfo
AccountInfoResponse holds information about the available accounts and issuers
func GetAccountInfos ¶ added in v0.5.0
func GetAccountInfos() (info AccountInfoResponse, err error)
GetAccountInfos returns information about all issuers and their available account names and if those are loaded or not
type IssuerInfo ¶ added in v0.5.0
type IssuerInfo struct { // Indicates whether a public client for this issuer is available or not HasPubClient bool `json:"pubclient"` // Maps account short names to a bool indicating if this account is currently loaded or not Accounts map[string]bool `json:"accounts"` }
IssuerInfo is a type for holding information about a supported issuer
type MytokenRequest ¶ added in v0.4.0
type MytokenRequest struct { // ShortName that should be used ShortName string // A mytoken profile describing the properties of the requested mytoken MytokenProfile string // A string describing the requesting application (i.e. its name). It might // be displayed to the user, if the request must be confirmed or an account // configuration loaded. ApplicationHint string }
MytokenRequest is used to request a mytoken from the agent
type MytokenResponse ¶ added in v0.4.0
type MytokenResponse struct { mytoken.MytokenResponse OIDCIssuer string MytokenIssuer string // The time when the token expires ExpiresAt time.Time }
MytokenResponse is a parse response from the oidc-agent compatible with the struct from the mytoken api, but with ExpiresAt set instead of ExpiresIn
func GetMytokenResponse ¶ added in v0.4.0
func GetMytokenResponse(req MytokenRequest) (resp MytokenResponse, err error)
GetMytokenResponse gets a mytoken response from the agent
type OIDCAgentError ¶ added in v0.2.0
type OIDCAgentError struct {
// contains filtered or unexported fields
}
OIDCAgentError is an error type used for returning errors
func (OIDCAgentError) Error ¶ added in v0.2.0
func (e OIDCAgentError) Error() string
func (OIDCAgentError) ErrorWithHelp ¶ added in v0.2.0
func (e OIDCAgentError) ErrorWithHelp() string
ErrorWithHelp returns a string combining the error message and the help message (if available).
func (OIDCAgentError) Help ¶ added in v0.2.0
func (e OIDCAgentError) Help() string
Help returns a help message if available. This help message helps the user to solve the problem. If a help message is available it SHOULD be displayed to the user. One can use ErrorWithHelp to obtain both.
type TokenRequest ¶
type TokenRequest struct { // ShortName that should be used (Can be omitted if IssuerURL is specified) ShortName string // IssuerURL for which an access token should be obtained (Can be omitted // if ShortName is specified) IssuerURL string // MinValidPeriod specifies how long the access token should be valid at // least. The time is given in seconds. Default is 0. MinValidPeriod uint64 // The scopes for the requested access token Scopes []string // The audiences for the requested access token Audiences []string // A string describing the requesting application (i.e. its name). It might // be displayed to the user, if the request must be confirmed or an account // configuration loaded. ApplicationHint string }
TokenRequest is used to request an access token from the agent
type TokenResponse ¶
type TokenResponse struct { // The access token Token string // The provider that issued the token Issuer string // The time when the token expires ExpiresAt time.Time }
TokenResponse is a parsed response from the oidc-agent
func GetTokenResponse ¶
func GetTokenResponse(req TokenRequest) (resp TokenResponse, err error)
GetTokenResponse gets a TokenResponse