citrixclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestData added in v0.2.0

func AddRequestData[T any](request T, c *CitrixDaasClient) T

Types

type AuthTokenModel

type AuthTokenModel struct {
	Token     string `json:"access_token"`
	ExpiresAt string `json:"expires_in"`
}

type AuthenticationConfiguration

type AuthenticationConfiguration struct {
	AuthUrl      string `json:"auth_url"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	OnPremise    bool   `json:"on_premise"`
}

AuthenticationConfiguration provides authentication settings for CC Athena / on-prem trust service

type CCAuthResponse

type CCAuthResponse struct {
	TokenType        string `json:"token_type"`
	Token            string `json:"access_token"`
	Expiration       string `json:"expires_in"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

AuthResponse -

type CitrixDaasClient

type CitrixDaasClient struct {
	ApiClient    *openapiclient.APIClient
	AuthConfig   *AuthenticationConfiguration
	ClientConfig *ClientConfiguration
	AuthToken    *AuthTokenModel
}

func NewCitrixDaasClient

func NewCitrixDaasClient(authUrl, hostname, customerId, clientId, clientSecret string, onPremise bool, userAgent *string, middlewareFunc MiddlewareAuthFunction) (*CitrixDaasClient, error)

func (*CitrixDaasClient) SignIn

func (c *CitrixDaasClient) SignIn() (string, error)

SignIn - Get a new token for user

func (*CitrixDaasClient) WaitForJob

func (c *CitrixDaasClient) WaitForJob(ctx context.Context, jobId string, maxWaitTimeInMinutes int) (*openapiclient.JobResponseModel, error)

type ClientConfiguration

type ClientConfiguration struct {
	CustomerId string
	SiteId     string
	UserAgent  string
}

ClientConfiguration provides Citrix DaaS customer context

type MiddlewareAuthFunction added in v0.2.0

type MiddlewareAuthFunction func(authClient *CitrixDaasClient, r *http.Request)

MiddlewareAuthFunction provides way to implement custom middleware which can do auth

type TrustAuthResponse

type TrustAuthResponse struct {
	Token      string `json:"Token"`
	Principal  string `json:"Principal"`
	UserId     string `json:"UserId"`
	CustomerId string `json:"CustomerId"`
	ExpiresAt  string `json:"ExpiresAt"`
}

AuthResponse -

Jump to

Keyboard shortcuts

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