ims

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL               string
	ClientID          string
	ClientSecret      string
	PrivateKeyPath    string
	Organization      string
	Account           string
	Scopes            []string
	Metascopes        []string
	AccessToken       string
	RefreshToken      string
	DeviceToken       string
	ServiceToken      string
	AuthorizationCode string
	ProfileApiVersion string
	OrgsApiVersion    string
	Timeout           int
	ProxyURL          string
	ProxyIgnoreTLS    bool
	PublicClient      bool
	UserID            string
	Cascading         bool
	Token             string
	Port              int
	PKCE              bool
	FullOutput        bool
	Guid              string
	AuthSrc           string
}

func (Config) AuthorizeClientCredentials added in v0.7.0

func (i Config) AuthorizeClientCredentials() (string, error)

AuthorizeClientCredentials : Client Credentials OAuth flow

func (Config) AuthorizeJWTExchange

func (i Config) AuthorizeJWTExchange() (TokenInfo, error)

func (Config) AuthorizeService

func (i Config) AuthorizeService() (string, error)

AuthorizeService : Login for the service to service IMS flow

func (Config) AuthorizeUser

func (i Config) AuthorizeUser() (string, error)

AuthorizeUser uses the standard Oauth2 authorization code grant flow. The Oauth2 configuration is taken from the Config struct.

func (Config) ClusterExchange added in v0.4.0

func (i Config) ClusterExchange() (TokenInfo, error)

ClusterExchange performs the Cluster Access Token Exchange grant flow

func (Config) DecodeToken added in v0.6.0

func (i Config) DecodeToken() ([]string, error)

func (Config) GetAdminOrganizations added in v0.10.0

func (i Config) GetAdminOrganizations() (string, error)

GetAdminOrganizations requests the user's organizations using the admin API and a service token.

func (Config) GetAdminProfile added in v0.10.0

func (i Config) GetAdminProfile() (string, error)

GetAdminProfile requests the user profile using an access token.

func (Config) GetOrganizations added in v0.2.0

func (i Config) GetOrganizations() (string, error)

GetOrganizations requests the user's organizations using an access token.

func (Config) GetProfile

func (i Config) GetProfile() (string, error)

GetProfile requests the user profile using an access token.

func (Config) InvalidateToken added in v0.5.0

func (i Config) InvalidateToken() error

InvalidateToken Invalidates the token provided in the configuration using the IMS API.

func (Config) Refresh added in v0.9.0

func (i Config) Refresh() (RefreshInfo, error)

Refresh performs the refresh token flow.

func (Config) ValidateToken added in v0.3.0

func (i Config) ValidateToken() (TokenInfo, error)

ValidateToken Validates the token provided in the configuration using the IMS API. Return the endpoint response or an error.

type RefreshInfo added in v0.9.0

type RefreshInfo struct {
	TokenInfo
	RefreshToken string
}

type TokenInfo

type TokenInfo struct {
	AccessToken string
	Expires     int //(response.ExpiresIn * time.Millisecond),
	Valid       bool
	Info        string
}

Access token information

Jump to

Keyboard shortcuts

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