ims

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Overview

Package ims implements the core business logic for interacting with the Adobe Identity Management System (IMS) API. It provides functions for authorization flows, token management, profile retrieval, and client registration.

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
	FullOutput            bool
	Verbose               bool
	Guid                  string
	AuthSrc               string
	DecodeFulfillableData bool
	ClientName            string
	RedirectURIs          []string
}

Config holds all parameters needed to interact with the IMS API. Fields are populated from CLI flags, environment variables, or a config file.

func (Config) AuthorizeClientCredentials added in v0.7.0

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

AuthorizeClientCredentials performs the Client Credentials OAuth flow.

func (Config) AuthorizeJWTExchange

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

AuthorizeJWTExchange performs the JWT Bearer exchange flow.

func (Config) AuthorizeService

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

AuthorizeService performs the service-to-service IMS authorization flow.

func (Config) AuthorizeUser

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

AuthorizeUser uses the standard OAuth2 authorization code grant flow.

func (Config) AuthorizeUserPKCE added in v0.13.0

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

AuthorizeUserPKCE uses the OAuth2 authorization code grant flow with PKCE.

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() (*DecodedToken, error)

DecodeToken decodes a JWT token into its header and payload parts.

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 a service 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) OBOExchange added in v0.13.0

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

func (Config) Refresh added in v0.9.0

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

Refresh performs the refresh token flow.

func (Config) Register added in v0.12.0

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

Register performs Dynamic Client Registration.

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. It returns the endpoint response or an error.

type DecodedToken added in v0.12.0

type DecodedToken struct {
	Header  string
	Payload string
}

DecodedToken represents the decoded parts of a JWT token.

type RefreshInfo added in v0.9.0

type RefreshInfo struct {
	TokenInfo
	RefreshToken string
}

RefreshInfo extends TokenInfo with the new refresh token returned by a token refresh.

type TokenInfo

type TokenInfo struct {
	AccessToken string
	Valid       bool
	Info        string
}

TokenInfo holds the response data from token-related IMS API calls.

Jump to

Keyboard shortcuts

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