config

package
v1.1.99 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 24 Imported by: 35

Documentation

Index

Constants

View Source
const (
	ManualApproval  string = "manual"
	AutoApproval    string = "auto"
	WebhookApproval string = "webhook"
)

subscription approval types

View Source
const (
	AccessToken             = "accessToken"
	Client                  = "client"
	ClientSecretBasic       = "client_secret_basic"
	ClientSecretPost        = "client_secret_post"
	ClientSecretJWT         = "client_secret_jwt"
	PrivateKeyJWT           = "private_key_jwt"
	TLSClientAuth           = "tls_client_auth"
	SelfSignedTLSClientAuth = "self_signed_tls_client_auth"
)

Variables

View Source
var (
	ErrBadConfig                 = configerrors.Newf(1401, "error with config %v, please set and/or check its value")
	ErrEnvConfigOverride         = configerrors.New(1402, "error in overriding configuration using environment variables")
	ErrStatusHealthCheckPeriod   = configerrors.New(1403, "invalid value for statusHealthCheckPeriod. Value must be between 1 and 5 minutes")
	ErrStatusHealthCheckInterval = configerrors.New(1404, "invalid value for statusHealthCheckInterval. Value must be between 30 seconds and 5 minutes")
	ErrReadingKeyFile            = configerrors.Newf(1405, "could not read the %v key file %v")
	ErrServiceAccount            = configerrors.New(1406, "using a DOSA_* service account with Marketplace Provisioning is unsupported")
)

Errors hit when validating or parsing config

View Source
var AgentDataPlaneType string

AgentDataPlaneType - Holds the data plane type of agent

View Source
var AgentDisplayName string

AgentDisplayName - Holds the name Agent name for displaying in version command or elsewhere

View Source
var AgentLatestVersion string

AgentLatestVersion - Holds the latest version of the agent

View Source
var AgentTypeName string

AgentTypeName - Holds the name Agent type

View Source
var AgentVersion string

AgentVersion - Holds the version of agent

View Source
var SDKVersion string

SDKVersion - Holds the version of SDK

TLSDefaultCipherSuites - list of suites to use by default

Functions

func AddAgentFeaturesConfigProperties

func AddAgentFeaturesConfigProperties(props properties.Properties)

AddAgentFeaturesConfigProperties - Adds the command properties needed for Agent Features Config

func AddCentralConfigProperties

func AddCentralConfigProperties(props properties.Properties, agentType AgentType)

AddCentralConfigProperties - Adds the command properties needed for Central Config

func AddLogConfigProperties

func AddLogConfigProperties(props properties.Properties, defaultFileName string)

AddLogConfigProperties - Adds the command properties needed for Log Config

func AddMetricLogConfigProperties added in v1.1.80

func AddMetricLogConfigProperties(props properties.Properties, agentType AgentType)

AddMetricLogConfigProperties - Adds the command properties needed for Log Config

func AddMetricReportingProperties added in v1.1.94

func AddMetricReportingProperties(props properties.Properties)

AddMetricReportingProperties - Adds the command properties needed for Metric Reporting Settings

func AddMigrationConfigProperties

func AddMigrationConfigProperties(props properties.Properties)

AddMigrationConfigProperties - Adds the command properties needed for Migration Config

func AddStatusConfigProperties

func AddStatusConfigProperties(props properties.Properties)

AddStatusConfigProperties - Adds the command properties needed for Status Config

func AddUsageConfigProperties added in v1.1.83

func AddUsageConfigProperties(props properties.Properties, agentType AgentType)

func AddUsageReportingProperties

func AddUsageReportingProperties(props properties.Properties)

AddUsageReportingProperties - Adds the command properties needed for Usage Reporting Settings

func LogConfigOverrides

func LogConfigOverrides() []cfgfile.ConditionalOverride

LogConfigOverrides - override the filebeat config options

func TLSDefaultCipherSuitesStringSlice

func TLSDefaultCipherSuitesStringSlice() []string

TLSDefaultCipherSuitesStringSlice - list of suites to use by default

func TLSDefaultMinVersionString

func TLSDefaultMinVersionString() string

TLSDefaultMinVersionString - get the default min version string

func ValidateConfig

func ValidateConfig(cfg interface{}) error

ValidateConfig - Validates the agent config Uses reflection to get the IConfigValidator interface on the config struct or struct variable. Makes call to ValidateCfg method except if the struct variable is of CentralConfig type as the validation for CentralConfig is already done during parseCentralConfig

Types

type AgentFeaturesConfig

type AgentFeaturesConfig interface {
	ConnectionToCentralEnabled() bool
	ProcessSystemSignalsEnabled() bool
	VersionCheckerEnabled() bool
	PersistCacheEnabled() bool
	GetExternalIDPConfig() ExternalIDPConfig
	AgentStatusUpdatesEnabled() bool
	SetPersistentCache(enable bool)
}

AgentFeaturesConfig - Interface to get agent features Config

func NewAgentFeaturesConfiguration

func NewAgentFeaturesConfiguration() AgentFeaturesConfig

NewAgentFeaturesConfiguration - Creates the default agent features config

func ParseAgentFeaturesConfig

func ParseAgentFeaturesConfig(props properties.Properties) (AgentFeaturesConfig, error)

ParseAgentFeaturesConfig - Parses the AgentFeatures Config values from the command line

type AgentFeaturesConfiguration

type AgentFeaturesConfiguration struct {
	AgentFeaturesConfig
	IConfigValidator
	ConnectToCentral     bool              `config:"connectToCentral"`
	ProcessSystemSignals bool              `config:"processSystemSignals"`
	VersionChecker       bool              `config:"versionChecker"`
	PersistCache         bool              `config:"persistCache"`
	ExternalIDPConfig    ExternalIDPConfig `config:"idp"`
	AgentStatusUpdates   bool              `config:"agentStatusUpdates"`
}

AgentFeaturesConfiguration - Structure to hold the agent features config

func (*AgentFeaturesConfiguration) AgentStatusUpdatesEnabled

func (c *AgentFeaturesConfiguration) AgentStatusUpdatesEnabled() bool

AgentStatusUpdatesEnabled - True if the agent SDK should manage the status update.

func (*AgentFeaturesConfiguration) ConnectionToCentralEnabled

func (c *AgentFeaturesConfiguration) ConnectionToCentralEnabled() bool

ConnectionToCentralEnabled - True if the agent is a standard agent that connects to Central

func (*AgentFeaturesConfiguration) GetExternalIDPConfig

func (c *AgentFeaturesConfiguration) GetExternalIDPConfig() ExternalIDPConfig

GetExternalIDPConfig - returns the config for external IdP providers

func (*AgentFeaturesConfiguration) PersistCacheEnabled

func (c *AgentFeaturesConfiguration) PersistCacheEnabled() bool

PersistCacheEnabled - True if the agent SDK should use persistence for agent cache.

func (*AgentFeaturesConfiguration) ProcessSystemSignalsEnabled

func (c *AgentFeaturesConfiguration) ProcessSystemSignalsEnabled() bool

ProcessSystemSignalsEnabled - True if the agent SDK listens for system signals and manages shutdown

func (*AgentFeaturesConfiguration) SetPersistentCache added in v1.1.94

func (c *AgentFeaturesConfiguration) SetPersistentCache(enable bool)

func (*AgentFeaturesConfiguration) ValidateCfg

func (c *AgentFeaturesConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

func (*AgentFeaturesConfiguration) VersionCheckerEnabled

func (c *AgentFeaturesConfiguration) VersionCheckerEnabled() bool

VersionCheckerEnabled - True if the agent SDK should check for newer versions of the agent.

type AgentType

type AgentType int

AgentType - Defines the type of agent

const (
	// DiscoveryAgent - Type definition for discovery agent
	DiscoveryAgent AgentType = iota + 1
	// TraceabilityAgent - Type definition for traceability agent
	TraceabilityAgent
	// GovernanceAgent - Type definition for governance agent
	GovernanceAgent
	// GenericService - Type for a generic service
	GenericService
)

func (AgentType) ToShortString added in v1.1.42

func (agentType AgentType) ToShortString() string

func (AgentType) ToString added in v1.1.42

func (agentType AgentType) ToString() string

type AuthConfig

type AuthConfig interface {
	GetTokenURL() string
	GetRealm() string
	GetAudience() string
	GetClientID() string
	GetPrivateKey() string
	GetPublicKey() string
	GetKeyPassword() string
	GetTimeout() time.Duration
	// contains filtered or unexported methods
}

AuthConfig - Interface for service account config

type AuthConfiguration

type AuthConfiguration struct {
	AuthConfig
	RegionSettings regionalSettings
	URL            string        `config:"url"`
	Realm          string        `config:"realm"`
	ClientID       string        `config:"clientId"`
	PrivateKey     string        `config:"privateKey"`
	PublicKey      string        `config:"publicKey"`
	PrivateKeyData string        `config:"privateKeyData"`
	PublicKeyData  string        `config:"publicKeyData"`
	KeyPwd         string        `config:"keyPassword"`
	ClientIDReuse  bool          `config:"clientIdReuse"`
	Timeout        time.Duration `config:"timeout"`
}

AuthConfiguration -

func (*AuthConfiguration) GetAudience

func (a *AuthConfiguration) GetAudience() string

GetAudience - Returns the token audience URL

func (*AuthConfiguration) GetClientID

func (a *AuthConfiguration) GetClientID() string

GetClientID - Returns the token audience URL

func (*AuthConfiguration) GetKeyPassword

func (a *AuthConfiguration) GetKeyPassword() string

GetKeyPassword - Returns the token audience URL

func (*AuthConfiguration) GetPrivateKey

func (a *AuthConfiguration) GetPrivateKey() string

GetPrivateKey - Returns the private key file path

func (*AuthConfiguration) GetPublicKey

func (a *AuthConfiguration) GetPublicKey() string

GetPublicKey - Returns the public key file path

func (*AuthConfiguration) GetRealm

func (a *AuthConfiguration) GetRealm() string

GetRealm - Returns the token audience URL

func (*AuthConfiguration) GetTimeout

func (a *AuthConfiguration) GetTimeout() time.Duration

GetTimeout - Returns the token audience URL

func (*AuthConfiguration) GetTokenURL

func (a *AuthConfiguration) GetTokenURL() string

GetTokenURL - Returns the token URL

func (*AuthConfiguration) GetURL added in v1.1.86

func (a *AuthConfiguration) GetURL() string

type CentralConfig

type CentralConfig interface {
	GetAgentType() AgentType
	GetRegion() Region
	GetTenantID() string
	GetAPICDeployment() string
	GetEnvironmentID() string
	SetEnvironmentID(environmentID string)
	IsAxwayManaged() bool
	SetAxwayManaged(isAxwayManaged bool)
	GetEnvironmentName() string
	GetAgentName() string
	GetTeamName() string
	GetTeamID() string
	SetTeamID(teamID string)
	GetURL() string
	GetTraceabilityHost() string
	GetPlatformURL() string
	GetAPIServerURL() string
	GetEnvironmentURL() string
	GetEnvironmentACLsURL() string
	GetServicesURL() string
	GetRevisionsURL() string
	GetInstancesURL() string
	DeleteServicesURL() string
	GetAPIServerAccessRequestDefinitionURL() string
	GetAPIServerSecretsURL() string
	GetAccessRequestsURL() string
	GetAccessRequestURL(string) string
	GetAccessRequestStateURL(string) string
	GetAuthConfig() AuthConfig
	GetTLSConfig() TLSConfig
	GetTagsToPublish() string
	GetProxyURL() string
	GetPollInterval() time.Duration
	GetReportActivityFrequency() time.Duration
	GetAPIValidationCronSchedule() string
	GetJobExecutionTimeout() time.Duration
	GetClientTimeout() time.Duration
	GetPageSize() int
	GetAPIServiceRevisionPattern() string
	GetAppendEnvironmentToTitle() bool
	GetUsageReportingConfig() UsageReportingConfig
	GetMetricReportingConfig() MetricReportingConfig
	IsUsingGRPC() bool
	GetGRPCHost() string
	GetGRPCPort() int
	IsGRPCInsecure() bool
	GetCacheStoragePath() string
	GetCacheStorageInterval() time.Duration
	GetSingleURL() string
	GetMigrationSettings() MigrationConfig
	GetWatchResourceFilters() []ResourceFilter
	SetWatchResourceFilters([]ResourceFilter) error
	GetCredentialConfig() CredentialConfig
}

CentralConfig - Interface to get central Config

func NewCentralConfig

func NewCentralConfig(agentType AgentType) CentralConfig

NewCentralConfig - Creates the default central config

func NewTestCentralConfig

func NewTestCentralConfig(agentType AgentType) CentralConfig

NewTestCentralConfig - Creates the default central config

func ParseCentralConfig

func ParseCentralConfig(props properties.Properties, agentType AgentType) (CentralConfig, error)

ParseCentralConfig - Parses the Central Config values from the command line

type CentralConfiguration

type CentralConfiguration struct {
	CentralConfig
	IConfigValidator
	AgentType                 AgentType
	RegionSettings            regionalSettings
	Region                    Region                `config:"region"`
	TenantID                  string                `config:"organizationID"`
	TeamName                  string                `config:"team"`
	APICDeployment            string                `config:"deployment"`
	Environment               string                `config:"environment"`
	EnvironmentID             string                `config:"environmentID"`
	AgentName                 string                `config:"agentName"`
	URL                       string                `config:"url"`
	SingleURL                 string                `config:"platformSingleURL"`
	PlatformURL               string                `config:"platformURL"`
	APIServerVersion          string                `config:"apiServerVersion"`
	TagsToPublish             string                `config:"additionalTags"`
	AppendEnvironmentToTitle  bool                  `config:"appendEnvironmentToTitle"`
	MigrationSettings         MigrationConfig       `config:"migration"`
	Auth                      AuthConfig            `config:"auth"`
	TLS                       TLSConfig             `config:"ssl"`
	PollInterval              time.Duration         `config:"pollInterval"`
	ReportActivityFrequency   time.Duration         `config:"reportActivityFrequency"`
	ClientTimeout             time.Duration         `config:"clientTimeout"`
	PageSize                  int                   `config:"pageSize"`
	APIValidationCronSchedule string                `config:"apiValidationCronSchedule"`
	APIServiceRevisionPattern string                `config:"apiServiceRevisionPattern"`
	ProxyURL                  string                `config:"proxyUrl"`
	UsageReporting            UsageReportingConfig  `config:"usageReporting"`
	MetricReporting           MetricReportingConfig `config:"metricReporting"`
	GRPCCfg                   GRPCConfig            `config:"grpc"`
	CacheStoragePath          string                `config:"cacheStoragePath"`
	CacheStorageInterval      time.Duration         `config:"cacheStorageInterval"`
	CredentialConfig          CredentialConfig      `config:"credential"`
	JobExecutionTimeout       time.Duration

	WatchResourceFilters []ResourceFilter
	// contains filtered or unexported fields
}

CentralConfiguration - Structure to hold the central config

func (*CentralConfiguration) DeleteServicesURL

func (c *CentralConfiguration) DeleteServicesURL() string

DeleteServicesURL - Returns the APIServer URL for services API instances

func (*CentralConfiguration) GetAPICDeployment

func (c *CentralConfiguration) GetAPICDeployment() string

GetAPICDeployment - Returns the Central deployment type 'prod', 'preprod', team ('beano')

func (*CentralConfiguration) GetAPIServerAccessRequestDefinitionURL

func (c *CentralConfiguration) GetAPIServerAccessRequestDefinitionURL() string

GetAPIServerAccessRequestDefinitionURL - Returns the APIServer URL for access request definitions

func (*CentralConfiguration) GetAPIServerSecretsURL

func (c *CentralConfiguration) GetAPIServerSecretsURL() string

GetAPIServerSecretsURL - Returns the APIServer URL for secrets

func (*CentralConfiguration) GetAPIServerURL

func (c *CentralConfiguration) GetAPIServerURL() string

GetAPIServerURL - Returns the base path for the API server

func (*CentralConfiguration) GetAPIServiceRevisionPattern

func (c *CentralConfiguration) GetAPIServiceRevisionPattern() string

GetAPIServiceRevisionPattern - Returns the naming pattern for APIServiceRevition title

func (*CentralConfiguration) GetAPIValidationCronSchedule added in v1.1.72

func (c *CentralConfiguration) GetAPIValidationCronSchedule() string

GetAPIValidationCronSchedule - Returns the cron schedule running the api validator

func (*CentralConfiguration) GetAccessRequestStateURL

func (c *CentralConfiguration) GetAccessRequestStateURL(accessRequestName string) string

GetAccessRequestStateURL - Returns the access request URL to update the state

func (*CentralConfiguration) GetAccessRequestURL

func (c *CentralConfiguration) GetAccessRequestURL(accessRequestName string) string

GetAccessRequestURL - Returns the access request URL for catalog item subscription states

func (*CentralConfiguration) GetAccessRequestsURL

func (c *CentralConfiguration) GetAccessRequestsURL() string

GetAccessRequestsURL - Returns the accessrequest URL for access request API

func (*CentralConfiguration) GetAgentName

func (c *CentralConfiguration) GetAgentName() string

GetAgentName - Returns the agent name

func (*CentralConfiguration) GetAgentType

func (c *CentralConfiguration) GetAgentType() AgentType

GetAgentType - Returns the agent type

func (*CentralConfiguration) GetAppendEnvironmentToTitle

func (c *CentralConfiguration) GetAppendEnvironmentToTitle() bool

GetAppendEnvironmentToTitle - Returns the value of append environment name to title attribute

func (*CentralConfiguration) GetAuthConfig

func (c *CentralConfiguration) GetAuthConfig() AuthConfig

GetAuthConfig - Returns the Auth Config

func (*CentralConfiguration) GetCacheStorageInterval

func (c *CentralConfiguration) GetCacheStorageInterval() time.Duration

GetCacheStorageInterval -

func (*CentralConfiguration) GetCacheStoragePath

func (c *CentralConfiguration) GetCacheStoragePath() string

GetCacheStoragePath -

func (*CentralConfiguration) GetClientTimeout

func (c *CentralConfiguration) GetClientTimeout() time.Duration

GetClientTimeout - Returns the interval for http client timeouts

func (*CentralConfiguration) GetCredentialConfig added in v1.1.35

func (c *CentralConfiguration) GetCredentialConfig() CredentialConfig

GetCredentialConfig -

func (*CentralConfiguration) GetEnvironmentACLsURL

func (c *CentralConfiguration) GetEnvironmentACLsURL() string

GetEnvironmentACLsURL - Returns the APIServer URL for ACLs in Environments

func (*CentralConfiguration) GetEnvironmentID

func (c *CentralConfiguration) GetEnvironmentID() string

GetEnvironmentID - Returns the environment ID

func (*CentralConfiguration) GetEnvironmentName

func (c *CentralConfiguration) GetEnvironmentName() string

GetEnvironmentName - Returns the environment name

func (*CentralConfiguration) GetEnvironmentURL

func (c *CentralConfiguration) GetEnvironmentURL() string

GetEnvironmentURL - Returns the APIServer URL for services API

func (*CentralConfiguration) GetGRPCHost

func (c *CentralConfiguration) GetGRPCHost() string

GetGRPCHost -

func (*CentralConfiguration) GetGRPCPort

func (c *CentralConfiguration) GetGRPCPort() int

GetGRPCPort -

func (*CentralConfiguration) GetInstancesURL

func (c *CentralConfiguration) GetInstancesURL() string

GetInstancesURL - Returns the APIServer URL for services API instances

func (*CentralConfiguration) GetJobExecutionTimeout

func (c *CentralConfiguration) GetJobExecutionTimeout() time.Duration

GetJobExecutionTimeout - Returns the max time a job execution can run before considered failed

func (*CentralConfiguration) GetMetricReportingConfig added in v1.1.94

func (c *CentralConfiguration) GetMetricReportingConfig() MetricReportingConfig

GetMetricReportingConfig -

func (*CentralConfiguration) GetMigrationSettings

func (c *CentralConfiguration) GetMigrationSettings() MigrationConfig

GetMigrationSettings - Returns the Migration Config

func (*CentralConfiguration) GetPageSize added in v1.1.93

func (c *CentralConfiguration) GetPageSize() int

GetPageSize - Returns the page size for api server calls

func (*CentralConfiguration) GetPlatformURL

func (c *CentralConfiguration) GetPlatformURL() string

GetPlatformURL - Returns the central base URL

func (*CentralConfiguration) GetPollInterval

func (c *CentralConfiguration) GetPollInterval() time.Duration

GetPollInterval - Returns the interval for polling subscriptions

func (*CentralConfiguration) GetProxyURL

func (c *CentralConfiguration) GetProxyURL() string

GetProxyURL - Returns the central Proxy URL

func (*CentralConfiguration) GetRegion added in v1.1.86

func (c *CentralConfiguration) GetRegion() Region

GetRegion - Returns the region

func (*CentralConfiguration) GetReportActivityFrequency

func (c *CentralConfiguration) GetReportActivityFrequency() time.Duration

GetReportActivityFrequency - Returns the interval between running periodic status updater

func (*CentralConfiguration) GetRevisionsURL

func (c *CentralConfiguration) GetRevisionsURL() string

GetRevisionsURL - Returns the APIServer URL for services API revisions

func (*CentralConfiguration) GetServicesURL

func (c *CentralConfiguration) GetServicesURL() string

GetServicesURL - Returns the APIServer URL for services API

func (*CentralConfiguration) GetSingleURL

func (c *CentralConfiguration) GetSingleURL() string

GetSingleURL - Returns the Alternate base URL

func (*CentralConfiguration) GetTLSConfig

func (c *CentralConfiguration) GetTLSConfig() TLSConfig

GetTLSConfig - Returns the TLS Config

func (*CentralConfiguration) GetTagsToPublish

func (c *CentralConfiguration) GetTagsToPublish() string

GetTagsToPublish - Returns tags to publish

func (*CentralConfiguration) GetTeamID

func (c *CentralConfiguration) GetTeamID() string

GetTeamID - Returns the team ID

func (*CentralConfiguration) GetTeamName

func (c *CentralConfiguration) GetTeamName() string

GetTeamName - Returns the team name

func (*CentralConfiguration) GetTenantID

func (c *CentralConfiguration) GetTenantID() string

GetTenantID - Returns the tenant ID

func (*CentralConfiguration) GetTraceabilityHost added in v1.1.86

func (c *CentralConfiguration) GetTraceabilityHost() string

GetTraceabilityHost - Returns the central traceability host

func (*CentralConfiguration) GetURL

func (c *CentralConfiguration) GetURL() string

GetURL - Returns the central base URL

func (*CentralConfiguration) GetUsageReportingConfig

func (c *CentralConfiguration) GetUsageReportingConfig() UsageReportingConfig

GetUsageReportingConfig -

func (*CentralConfiguration) GetWatchResourceFilters

func (c *CentralConfiguration) GetWatchResourceFilters() []ResourceFilter

GetWatchResourceFilters - returns the custom watch filter config

func (*CentralConfiguration) IsAxwayManaged

func (c *CentralConfiguration) IsAxwayManaged() bool

IsAxwayManaged - Returns the environment ID

func (*CentralConfiguration) IsGRPCInsecure

func (c *CentralConfiguration) IsGRPCInsecure() bool

IsGRPCInsecure -

func (*CentralConfiguration) IsUsingGRPC

func (c *CentralConfiguration) IsUsingGRPC() bool

IsUsingGRPC -

func (*CentralConfiguration) SetAxwayManaged

func (c *CentralConfiguration) SetAxwayManaged(isManaged bool)

SetAxwayManaged - Sets the environment ID

func (*CentralConfiguration) SetEnvironmentID

func (c *CentralConfiguration) SetEnvironmentID(environmentID string)

SetEnvironmentID - Sets the environment ID

func (*CentralConfiguration) SetTeamID

func (c *CentralConfiguration) SetTeamID(teamID string)

SetTeamID - Sets the team ID

func (*CentralConfiguration) SetWatchResourceFilters

func (c *CentralConfiguration) SetWatchResourceFilters(filters []ResourceFilter) error

SetWatchResourceFilters - sets the custom watch filter config

func (*CentralConfiguration) ValidateCfg

func (c *CentralConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

type CredentialConfig added in v1.1.35

type CredentialConfig interface {
	SetAllowedOAuthMethods(allowedMethods []string)
	GetAllowedOAuthMethods() []string
	ShouldDeprovisionExpired() bool
	SetShouldDeprovisionExpired(deprovisionExpired bool)
	GetExpirationDays() int
	SetExpirationDays(expirationDays int)
}

SubscriptionConfig - Interface to get subscription config

type CredentialConfiguration added in v1.1.35

type CredentialConfiguration struct {
	AllowedOAuthMethods []string `config:"allowedOAuthMethods"`
	ExpirationDays      int      `config:"expirationDays"`
	DeprovisionOnExpire bool     `config:"deprovisionOnExpire"`
}

NotificationConfig -

func (*CredentialConfiguration) GetAllowedOAuthMethods added in v1.1.97

func (s *CredentialConfiguration) GetAllowedOAuthMethods() []string

GetAllowedOAuthMethods -

func (*CredentialConfiguration) GetExpirationDays added in v1.1.35

func (s *CredentialConfiguration) GetExpirationDays() int

GetTimeToLive -

func (*CredentialConfiguration) SetAllowedOAuthMethods added in v1.1.97

func (s *CredentialConfiguration) SetAllowedOAuthMethods(allowedOAuthMethods []string)

SetAllowedOAuthMethods -

func (*CredentialConfiguration) SetExpirationDays added in v1.1.52

func (s *CredentialConfiguration) SetExpirationDays(expirationDays int)

Set GetTimeToLive -

func (*CredentialConfiguration) SetShouldDeprovisionExpired added in v1.1.52

func (s *CredentialConfiguration) SetShouldDeprovisionExpired(deprovisionExpired bool)

Set ExpireAction -

func (*CredentialConfiguration) ShouldDeprovisionExpired added in v1.1.35

func (s *CredentialConfiguration) ShouldDeprovisionExpired() bool

ExpireAction -

func (*CredentialConfiguration) ValidateCfg added in v1.1.35

func (s *CredentialConfiguration) ValidateCfg() error

ValidateCfg - Validates the config, implementing IConfigInterface

type ExternalIDPConfig

type ExternalIDPConfig interface {
	GetIDPList() []IDPConfig
	ValidateCfg() (err error)
}

ExternalIDPConfig -

type ExtraProperties

type ExtraProperties map[string]string

ExtraProperties - type for representing extra IdP provider properties to be included in client request

func (*ExtraProperties) UnmarshalJSON

func (e *ExtraProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON - deserializes extra properties from env config

type GRPCConfig

type GRPCConfig struct {
	Enabled  bool   `config:"enabled"`
	Host     string `config:"host"`
	Port     int    `config:"port"`
	Insecure bool   `config:"insecure"`
}

GRPCConfig - Represents the grpc config

type IConfigValidator

type IConfigValidator interface {
	ValidateCfg() error
}

IConfigValidator - Interface to be implemented for config validation by agent

type IDPAuthConfig

type IDPAuthConfig interface {
	// GetType - type of authentication mechanism to use "accessToken" or "client"
	GetType() string
	// GetAccessToken - token(initial access token/Admin API Token etc) to be used by Agent SDK to authenticate with IdP
	GetAccessToken() string
	// GetClientID - Identifier of the client in IdP that can used to create new OAuth clients
	GetClientID() string
	// GetClientSecret - Secret for the client in IdP that can used to create new OAuth clients
	GetClientSecret() string
	// GetClientScope - Scopes used for requesting the token using the ID client
	GetClientScope() string

	// GetPrivateKey() - private key to be used for private_key_jwt authentication
	GetPrivateKey() string
	// GetPublicKey() - public key to be used for private_key_jwt authentication
	GetPublicKey() string
	// GetKeyPassword() - public key to be used for private_key_jwt authentication
	GetKeyPassword() string
	// GetSigningMethod() - the token signing method for private_key_jwt authentication
	GetTokenSigningMethod() string
	// UseTokenCache() - return flag to indicate if the auth client to get new token on each request
	UseTokenCache() bool
	// UseRegistrationAccessToken - return flag to indicate if the auth client to use registration access token
	UseRegistrationAccessToken() bool
	// GetRequestHeaders - set of additional request headers to be applied when registering the client
	GetRequestHeaders() map[string]string
	// GetQueryParams - set of additional query parameters to be applied when registering the client
	GetQueryParams() map[string]string
	// contains filtered or unexported methods
}

IDPAuthConfig - interface for IdP provider auth config

type IDPAuthConfiguration

type IDPAuthConfiguration struct {
	Type                 string            `json:"type,omitempty"`
	RequestHeaders       IDPRequestHeaders `json:"requestHeaders,omitempty"`
	QueryParams          IDPQueryParams    `json:"queryParams,omitempty"`
	AccessToken          string            `json:"accessToken,omitempty"`
	ClientID             string            `json:"clientId,omitempty"`
	ClientSecret         string            `json:"clientSecret,omitempty"`
	ClientScope          string            `json:"clientScope,omitempty"`
	PrivateKey           string            `json:"privateKey,omitempty"`
	PublicKey            string            `json:"publicKey,omitempty"`
	KeyPwd               string            `json:"keyPassword,omitempty"`
	TokenSigningMethod   string            `json:"tokenSigningMethod,omitempty"`
	UseCachedToken       bool              `json:"-"`
	UseRegistrationToken bool              `json:"-"`
}

IDPAuthConfiguration - Structure to hold the IdP provider auth config

func (*IDPAuthConfiguration) GetAccessToken

func (i *IDPAuthConfiguration) GetAccessToken() string

GetAccessToken - token(initial access token/Admin API Token etc) to be used by Agent SDK to authenticate with IdP

func (*IDPAuthConfiguration) GetClientID

func (i *IDPAuthConfiguration) GetClientID() string

GetClientID - Identifier of the client in IdP that can used to create new OAuth client

func (*IDPAuthConfiguration) GetClientScope added in v1.1.57

func (i *IDPAuthConfiguration) GetClientScope() string

GetClientScope - scopes used for requesting the token using the ID client

func (*IDPAuthConfiguration) GetClientSecret

func (i *IDPAuthConfiguration) GetClientSecret() string

GetClientSecret - Secret for the client in IdP that can used to create new OAuth clients

func (*IDPAuthConfiguration) GetKeyPassword added in v1.1.61

func (i *IDPAuthConfiguration) GetKeyPassword() string

GetKeyPassword -

func (*IDPAuthConfiguration) GetPrivateKey added in v1.1.61

func (i *IDPAuthConfiguration) GetPrivateKey() string

GetPrivateKey -

func (*IDPAuthConfiguration) GetPublicKey added in v1.1.61

func (i *IDPAuthConfiguration) GetPublicKey() string

GetPublicKey -

func (*IDPAuthConfiguration) GetQueryParams added in v1.1.86

func (i *IDPAuthConfiguration) GetQueryParams() map[string]string

GetQueryParams - set of additional query params to be applied when registering the client

func (*IDPAuthConfiguration) GetRequestHeaders added in v1.1.86

func (i *IDPAuthConfiguration) GetRequestHeaders() map[string]string

GetRequestHeaders - set of additional request headers to be applied when registering the client

func (*IDPAuthConfiguration) GetTokenSigningMethod added in v1.1.61

func (i *IDPAuthConfiguration) GetTokenSigningMethod() string

GetTokenSigningMethod -

func (*IDPAuthConfiguration) GetType

func (i *IDPAuthConfiguration) GetType() string

GetType - type of authentication mechanism to use "accessToken" or "client"

func (*IDPAuthConfiguration) MarshalJSON added in v1.1.61

func (i *IDPAuthConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON - custom marshaler for Application struct

func (*IDPAuthConfiguration) UnmarshalJSON added in v1.1.61

func (i *IDPAuthConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON - custom unmarshaler for IDPAuthConfiguration struct

func (*IDPAuthConfiguration) UseRegistrationAccessToken added in v1.1.85

func (i *IDPAuthConfiguration) UseRegistrationAccessToken() bool

UseRegistrationAccessToken - return flag to indicate if the auth client to use registration access token

func (*IDPAuthConfiguration) UseTokenCache added in v1.1.61

func (i *IDPAuthConfiguration) UseTokenCache() bool

UseTokenCache - return flag to indicate if the auth client to get new token on each request

type IDPConfig

type IDPConfig interface {
	// GetMetadataURL - URL exposed by OAuth authorization server to provide metadata information
	GetMetadataURL() string
	// GetIDPType - IDP type ("generic" or "okta")
	GetIDPType() string
	// GetIDPName - for the identity provider
	GetIDPName() string
	// GetIDPTitle - for the identity provider friendly name
	GetIDPTitle() string
	// GetAuthConfig - to be used for authentication with IDP
	GetAuthConfig() IDPAuthConfig
	// GetClientScopes - default list of scopes that are included in the client metadata request to IDP
	GetClientScopes() string
	// GetGrantType - default grant type to be used when creating the client. (default :  "client_credentials")
	GetGrantType() string
	// GetAuthMethod - default token endpoint authentication method(default : "client_secret_basic")
	GetAuthMethod() string
	// GetAuthResponseType - default token response type to be used when registering the client
	GetAuthResponseType() string
	// GetExtraProperties - set of additional properties to be applied when registering the client
	GetExtraProperties() map[string]string
	// GetRequestHeaders - set of additional request headers to be applied when registering the client
	GetRequestHeaders() map[string]string
	// GetQueryParams - set of additional query parameters to be applied when registering the client
	GetQueryParams() map[string]string
	// GetTLSConfig - tls config for IDP connection
	GetTLSConfig() TLSConfig
	// contains filtered or unexported methods
}

IDPConfig - interface for IdP provider config

type IDPConfiguration

type IDPConfiguration struct {
	Name             string            `json:"name,omitempty"`
	Title            string            `json:"title,omitempty"`
	Type             string            `json:"type,omitempty"`
	MetadataURL      string            `json:"metadataUrl,omitempty"`
	AuthConfig       IDPAuthConfig     `json:"auth,omitempty"`
	ClientScopes     string            `json:"scope,omitempty"`
	GrantType        string            `json:"grantType,omitempty"`
	AuthMethod       string            `json:"authMethod,omitempty"`
	AuthResponseType string            `json:"authResponseType,omitempty"`
	ExtraProperties  ExtraProperties   `json:"extraProperties,omitempty"`
	RequestHeaders   IDPRequestHeaders `json:"requestHeaders,omitempty"`
	QueryParams      IDPQueryParams    `json:"queryParams,omitempty"`
	TLSConfig        TLSConfig         `json:"-"`
}

IDPConfiguration - Structure to hold the IdP provider config

func (*IDPConfiguration) GetAuthConfig

func (i *IDPConfiguration) GetAuthConfig() IDPAuthConfig

GetAuthConfig - to be used for authentication with IDP

func (*IDPConfiguration) GetAuthMethod

func (i *IDPConfiguration) GetAuthMethod() string

GetAuthMethod - default token endpoint authentication method(default : "client_secret_basic")

func (*IDPConfiguration) GetAuthResponseType

func (i *IDPConfiguration) GetAuthResponseType() string

GetAuthResponseType - default token response type to be used when registering the client

func (*IDPConfiguration) GetClientScopes

func (i *IDPConfiguration) GetClientScopes() string

GetClientScopes - default list of scopes that are included in the client metadata request to IDP

func (*IDPConfiguration) GetExtraProperties

func (i *IDPConfiguration) GetExtraProperties() map[string]string

GetExtraProperties - set of additional properties to be applied when registering the client

func (*IDPConfiguration) GetGrantType

func (i *IDPConfiguration) GetGrantType() string

GetGrantType - default grant type to be used when creating the client. (default : "client_credentials")

func (*IDPConfiguration) GetIDPName

func (i *IDPConfiguration) GetIDPName() string

GetIDPName - for the identity provider

func (*IDPConfiguration) GetIDPTitle added in v1.1.35

func (i *IDPConfiguration) GetIDPTitle() string

GetIDPName - for the identity provider frinedly name

func (*IDPConfiguration) GetIDPType

func (i *IDPConfiguration) GetIDPType() string

GetIDPType - IDP type ("generic" or "okta")

func (*IDPConfiguration) GetMetadataURL

func (i *IDPConfiguration) GetMetadataURL() string

GetMetadataURL - URL exposed by OAuth authorization server to provide metadata information

func (*IDPConfiguration) GetQueryParams added in v1.1.86

func (i *IDPConfiguration) GetQueryParams() map[string]string

GetQueryParams - set of additional query params to be applied when registering the client

func (*IDPConfiguration) GetRequestHeaders added in v1.1.86

func (i *IDPConfiguration) GetRequestHeaders() map[string]string

GetRequestHeaders - set of additional request headers to be applied when registering the client

func (*IDPConfiguration) GetTLSConfig added in v1.1.57

func (i *IDPConfiguration) GetTLSConfig() TLSConfig

GetTLSConfig - tls config for IDP connection

func (*IDPConfiguration) MarshalJSON added in v1.1.91

func (i *IDPConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON - custom marshaler for IDPConfiguration struct

func (*IDPConfiguration) UnmarshalJSON added in v1.1.91

func (i *IDPConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON - custom unmarshaler for IDPConfiguration struct

type IDPQueryParams added in v1.1.86

type IDPQueryParams map[string]string

IDPQueryParams - additional query params for calls to IdP

func (*IDPQueryParams) UnmarshalJSON added in v1.1.86

func (e *IDPQueryParams) UnmarshalJSON(data []byte) error

UnmarshalJSON - deserializes query parameters from env config

type IDPRequestHeaders added in v1.1.86

type IDPRequestHeaders map[string]string

IDPRequestHeaders - additional request headers for calls to IdP

func (*IDPRequestHeaders) UnmarshalJSON added in v1.1.86

func (e *IDPRequestHeaders) UnmarshalJSON(data []byte) error

UnmarshalJSON - deserializes request header from env config

type IResourceConfigCallback

type IResourceConfigCallback interface {
	ApplyResources(agentResource *v1.ResourceInstance) error
}

IResourceConfigCallback - Interface to be implemented by configs to apply API Server resource for agent

type LogConfig

type LogConfig interface {
	SetLevel(level string)
	GetMetricConfig() LogFileConfiguration
	GetUsageConfig() LogFileConfiguration
}

LogConfig - Interface for logging config

func ParseAndSetupLogConfig

func ParseAndSetupLogConfig(props properties.Properties, agentType AgentType) (LogConfig, error)

ParseAndSetupLogConfig - Parses the Log Config and setups the logger

type LogConfiguration

type LogConfiguration struct {
	LogConfig
	Level        string               `config:"level"`
	Format       string               `config:"format"`
	Output       string               `config:"output"`
	File         LogFileConfiguration `config:"file"`
	MetricFile   LogFileConfiguration `config:"metricfile"`
	UsageFile    LogFileConfiguration `config:"usagefile"`
	MaskedValues string               `config:"maskedvalues"`
}

LogConfiguration -

func (*LogConfiguration) GetMetricConfig added in v1.1.80

func (l *LogConfiguration) GetMetricConfig() LogFileConfiguration

func (*LogConfiguration) GetUsagefileConfig added in v1.1.83

func (l *LogConfiguration) GetUsagefileConfig() LogFileConfiguration

type LogFileConfiguration

type LogFileConfiguration struct {
	Enabled    bool   `config:"enable"`
	Name       string `config:"name"`
	Path       string `config:"path"`
	MaxSize    int    `config:"rotateeverybytes"`
	MaxAge     int    `config:"cleanbackups"`
	MaxBackups int    `config:"keepfiles"`
}

LogFileConfiguration - setup the logging configuration for file output

type MetricReportingConfig added in v1.1.94

type MetricReportingConfig interface {
	CanPublish() bool
	GetSchedule() string
	GetReportGranularity() int
	UsingQAVars() bool
	Validate()
}

MetricReportingConfig - Interface to get metric reporting config

func NewMetricReporting added in v1.1.94

func NewMetricReporting() MetricReportingConfig

NewMetricReporting - Creates the default metric reporting config

func ParseMetricReportingConfig added in v1.1.94

func ParseMetricReportingConfig(props properties.Properties) MetricReportingConfig

ParseUsageReportingConfig - Parses the Usage Reporting Config values from the command line

type MetricReportingConfiguration added in v1.1.94

type MetricReportingConfiguration struct {
	MetricReportingConfig
	Publish  bool   `config:"publish"`
	Schedule string `config:"schedule"`
	// contains filtered or unexported fields
}

MetricReportingConfiguration - structure to hold all metric reporting settings

func (*MetricReportingConfiguration) CanPublish added in v1.1.94

func (u *MetricReportingConfiguration) CanPublish() bool

CanPublish - Returns the publish metric boolean

func (*MetricReportingConfiguration) GetReportGranularity added in v1.1.94

func (u *MetricReportingConfiguration) GetReportGranularity() int

GetReportGranularity - Returns the schedule string

func (*MetricReportingConfiguration) GetSchedule added in v1.1.94

func (u *MetricReportingConfiguration) GetSchedule() string

GetSchedule - Returns the schedule string

func (*MetricReportingConfiguration) UsingQAVars added in v1.1.94

func (u *MetricReportingConfiguration) UsingQAVars() bool

UsingQAVars - Returns the offline boolean

func (*MetricReportingConfiguration) Validate added in v1.1.94

func (m *MetricReportingConfiguration) Validate()

Validate -

type MigrationConfig

type MigrationConfig interface {
	ShouldCleanInstances() bool
	// contains filtered or unexported methods
}

MigrationConfig - Interface for migration settings config

func ParseMigrationConfig

func ParseMigrationConfig(props properties.Properties) MigrationConfig

ParseMigrationConfig - Parses the Migration Config values from the command line

type MigrationSettings

type MigrationSettings struct {
	CleanInstances bool
}

MigrationSettings -

func (*MigrationSettings) ShouldCleanInstances

func (m *MigrationSettings) ShouldCleanInstances() bool

ShouldCleanInstances - returns the value fo CleanInstances

type Region added in v1.1.86

type Region int
const (
	US Region = iota + 1
	EU
	AP
)

func (Region) ToString added in v1.1.86

func (r Region) ToString() string

type ResourceEventType

type ResourceEventType string

ResourceEventType - watch filter event types

const (
	ResourceEventCreated ResourceEventType = "created"
	ResourceEventUpdated ResourceEventType = "updated"
	ResourceEventDeleted ResourceEventType = "deleted"
)

Resource event types

type ResourceFilter

type ResourceFilter struct {
	Group            string              `json:"group"` // remove group ? and default to management or allow filter for other groups as well?
	Kind             string              `json:"kind"`
	Name             string              `json:"name"`
	EventTypes       []ResourceEventType `json:"eventTypes"`
	Scope            *ResourceScope      `json:"scope"`
	IsCachedResource bool                `json:"isCachedResource"`
}

ResourceFilter - custom watch filter

type ResourceScope

type ResourceScope struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

ResourceScope - scope config for watch resource filter

type StatusConfig

type StatusConfig interface {
	GetPort() int
	GetHealthCheckPeriod() time.Duration
	GetHealthCheckInterval() time.Duration
	ValidateCfg() error
}

StatusConfig - Interface for status config

func NewStatusConfig

func NewStatusConfig() StatusConfig

NewStatusConfig - create a new status config

func ParseStatusConfig

func ParseStatusConfig(props properties.Properties) (StatusConfig, error)

ParseStatusConfig - Parses the Status Config values form teh command line

type StatusConfiguration

type StatusConfiguration struct {
	StatusConfig
	Port                int           `config:"port"`
	HealthCheckPeriod   time.Duration `config:"healthCheckPeriod"`
	HealthCheckInterval time.Duration `config:"healthCheckInterval"` // this for binary agents only
}

StatusConfiguration -

func (*StatusConfiguration) GetHealthCheckInterval

func (a *StatusConfiguration) GetHealthCheckInterval() time.Duration

GetHealthCheckInterval - Returns the interval between running periodic health checks (binary agents only)

func (*StatusConfiguration) GetHealthCheckPeriod

func (a *StatusConfiguration) GetHealthCheckPeriod() time.Duration

GetHealthCheckPeriod - Returns the timeout before exiting discovery agent

func (*StatusConfiguration) GetPort

func (a *StatusConfiguration) GetPort() int

GetPort - Returns the status port

func (*StatusConfiguration) ValidateCfg

func (a *StatusConfiguration) ValidateCfg() error

ValidateCfg - Validates the config, implementing IConfigInterface

type TLSCipherSuite

type TLSCipherSuite uint16

TLSCipherSuite - defined type

func NewCipherArray

func NewCipherArray(ciphers []string) []TLSCipherSuite

NewCipherArray - create an array of TLSCipherSuite

func (*TLSCipherSuite) String

func (cs *TLSCipherSuite) String() string

func (*TLSCipherSuite) Unpack

func (cs *TLSCipherSuite) Unpack(s string) error

Unpack - transforms the string into a constant.

type TLSConfig

type TLSConfig interface {
	GetNextProtos() []string
	IsInsecureSkipVerify() bool
	GetCipherSuites() []TLSCipherSuite
	GetMinVersion() TLSVersion
	GetMaxVersion() TLSVersion
	BuildTLSConfig() *tls.Config
}

TLSConfig - interface

func NewTLSConfig

func NewTLSConfig() TLSConfig

NewTLSConfig - build default config

type TLSConfiguration

type TLSConfiguration struct {
	IConfigValidator
	// NextProtos is a list of supported application level protocols, in order of preference.
	NextProtos []string `config:"nextProtos,replace" json:"nextProtos,omitempty"`

	// InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
	// If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host
	// name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.
	// This should be used only for testing.
	InsecureSkipVerify bool `config:"insecureSkipVerify" json:"insecureSkipVerify,omitempty"`

	// CipherSuites is a list of supported cipher suites for TLS versions up to TLS 1.2. If CipherSuites
	// is nil, a default list of secure cipher suites is used, with a preference order based on hardware
	// performance. The default cipher suites might change over Go versions. Note that TLS 1.3
	// ciphersuites are not configurable.
	CipherSuites []TLSCipherSuite `config:"cipherSuites,replace" json:"cipherSuites,omitempty"`

	// MinVersion contains the minimum SSL/TLS version that is acceptable. If zero, then TLS 1.0 is taken as the minimum.
	MinVersion TLSVersion `config:"minVersion" json:"minVersion,omitempty"`

	// MaxVersion contains the maximum SSL/TLS version that is acceptable. If zero, then the maximum
	// version supported by this package is used, which is currently TLS 1.3.
	MaxVersion TLSVersion `config:"maxVersion" json:"maxVersion,omitempty"`

	// RootCertificate
	RootCertificatePath string `config:"rootCACertPath" json:"rootCACertPath,omitempty"`

	// Client Certificate Path
	ClientCertificatePath string `config:"clientCertPath" json:"clientCertPath,omitempty"`

	// Client Key Path
	ClientKeyPath string `config:"clientKeyPath" json:"clientKeyPath,omitempty"`
}

TLSConfiguration - A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. A Config may be reused; the tls package will also not modify it.

func (*TLSConfiguration) BuildTLSConfig

func (c *TLSConfiguration) BuildTLSConfig() *tls.Config

BuildTLSConfig takes the TLSConfiguration and transforms it into a `tls.Config`.

func (*TLSConfiguration) GetCipherSuites

func (c *TLSConfiguration) GetCipherSuites() []TLSCipherSuite

GetCipherSuites -

func (*TLSConfiguration) GetMaxVersion

func (c *TLSConfiguration) GetMaxVersion() TLSVersion

GetMaxVersion -

func (*TLSConfiguration) GetMinVersion

func (c *TLSConfiguration) GetMinVersion() TLSVersion

GetMinVersion -

func (*TLSConfiguration) GetNextProtos

func (c *TLSConfiguration) GetNextProtos() []string

GetNextProtos -

func (*TLSConfiguration) IsInsecureSkipVerify

func (c *TLSConfiguration) IsInsecureSkipVerify() bool

IsInsecureSkipVerify -

func (*TLSConfiguration) LoadFrom

func (c *TLSConfiguration) LoadFrom(tlsCfg *tls.Config)

LoadFrom takes the `tls.Config` and transforms it into a TLSConfiguration.

func (*TLSConfiguration) ValidateCfg

func (c *TLSConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

type TLSVersion

type TLSVersion uint16

TLSVersion - define type for version

var TLSDefaultMinVersion TLSVersion = tls.VersionTLS12

TLSDefaultMinVersion - get the default min version

func TLSVersionAsValue

func TLSVersionAsValue(cs string) TLSVersion

TLSVersionAsValue - get the version value

func (*TLSVersion) Unpack

func (v *TLSVersion) Unpack(s string) error

Unpack transforms the string into a constant.

type UsageReportingConfig

type UsageReportingConfig interface {
	GetURL() string
	CanPublish() bool
	GetReportInterval() time.Duration
	GetSchedule() string
	IsOfflineMode() bool
	GetOfflineSchedule() string
	GetReportSchedule() string
	GetReportGranularity() int
	UsingQAVars() bool
	Validate()
}

UsageReportingConfig - Interface to get usage reporting config

func NewUsageReporting

func NewUsageReporting(platformURL string) UsageReportingConfig

NewUsageReporting - Creates the default usage reporting config

func ParseUsageReportingConfig

func ParseUsageReportingConfig(props properties.Properties) UsageReportingConfig

ParseUsageReportingConfig - Parses the Usage Reporting Config values from the command line

type UsageReportingConfiguration

type UsageReportingConfiguration struct {
	UsageReportingConfig
	Publish         bool   `config:"publish"`
	Schedule        string `config:"schedule"`
	Offline         bool   `config:"offline"`
	OfflineSchedule string `config:"offlineSchedule"`
	URL             string
	// contains filtered or unexported fields
}

UsageReportingConfiguration - structure to hold all usage reporting settings

func (*UsageReportingConfiguration) CanPublish added in v1.1.94

func (u *UsageReportingConfiguration) CanPublish() bool

CanPublish - Returns the publish boolean

func (*UsageReportingConfiguration) GetOfflineSchedule added in v1.1.94

func (u *UsageReportingConfiguration) GetOfflineSchedule() string

GetSchedule - Returns the schedule string

func (*UsageReportingConfiguration) GetReportGranularity

func (u *UsageReportingConfiguration) GetReportGranularity() int

GetReportGranularity - Returns the granularity used in the offline reports

func (*UsageReportingConfiguration) GetReportSchedule

func (u *UsageReportingConfiguration) GetReportSchedule() string

GetReportSchedule - Returns the offline schedule string for creating reports

func (*UsageReportingConfiguration) GetSchedule

func (u *UsageReportingConfiguration) GetSchedule() string

GetSchedule - Returns the schedule string for publishing reports

func (*UsageReportingConfiguration) GetURL

func (u *UsageReportingConfiguration) GetURL() string

GetURL - Returns the usage reporting URL

func (*UsageReportingConfiguration) IsOfflineMode

func (u *UsageReportingConfiguration) IsOfflineMode() bool

IsOfflineMode - Returns the offline boolean

func (*UsageReportingConfiguration) UsingQAVars

func (u *UsageReportingConfiguration) UsingQAVars() bool

UsingQAVars - Returns the offline boolean

func (*UsageReportingConfiguration) Validate

func (u *UsageReportingConfiguration) Validate()

Validate -

type WebhookConfig

type WebhookConfig interface {
	GetURL() string
	GetWebhookHeaders() map[string]string
	GetSecret() string
	IsConfigured() bool
	ValidateConfig() error
}

WebhookConfig - Interface for webhook config

func NewWebhookConfig

func NewWebhookConfig() WebhookConfig

NewWebhookConfig -

type WebhookConfiguration

type WebhookConfiguration struct {
	WebhookConfig
	URL     string `config:"url"`
	Headers string `config:"headers"`
	Secret  string `config:"secret"`
	// contains filtered or unexported fields
}

WebhookConfiguration - do NOT make this an IConfigValidator, as it is validated as part of subscriptionConfig

func (*WebhookConfiguration) GetSecret

func (c *WebhookConfiguration) GetSecret() string

GetSecret - Returns the secret

func (*WebhookConfiguration) GetURL

func (c *WebhookConfiguration) GetURL() string

GetURL - Returns the URL

func (*WebhookConfiguration) GetWebhookHeaders

func (c *WebhookConfiguration) GetWebhookHeaders() map[string]string

GetWebhookHeaders - Returns the webhook headers

func (*WebhookConfiguration) IsConfigured

func (c *WebhookConfiguration) IsConfigured() bool

IsConfigured - bool

func (*WebhookConfiguration) ValidateConfig

func (c *WebhookConfiguration) ValidateConfig() error

ValidateConfig - Validate the config. Do NOT make this ValidateCfg IConfigValidator. It is called directly from the subscriptionconfig validator. But, it is ONLY called if the approvalMode is "webhook"

Jump to

Keyboard shortcuts

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