types

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	// RequireTokenSTS indicates whether your API will use an STS token to generate authentication tokens
	// for API connectors
	RequireTokenSTS bool `json:"require_token_sts"`

	// TokenService contains the settings required to generate an STS token
	TokenService TokenService
}

Authorization contains the authorization settings to be used by the Graphql API connectors

type Config

type Config struct {
	// Authorization contains the authorization settings to be used by GraphQL API connectors
	Authorization Authorization

	// BasicData is the basic information necessary to register the library observability
	BasicData *Info `json:"basic"`

	// CloudContext is the cloud context that will be used to interact with available cloud resources
	CloudContext cloud.CloudContext

	// Connectors is the content or path to retrieve settings from the GraphQL API resolver that will
	// be created dynamically
	Connectors string `json:"connectors"`

	// Metrics indicates the metrics platform that will be used by the GraphQL Datadog or OpenTelemetry
	Metrics MetricCollectorType `json:"metrics"`

	// Route represents the route that will be used by the GraphQL API (e.g. /graphql)
	Route string `json:"route"`

	// Schema is the content or path to retrieve the schema settings of the GraphQL API that will be
	// created dynamically
	Schema string `json:"schema"`

	// Session is a AWS Session used by the service to interact with the cloud
	Session *session.Session

	// Authenticator is a authorization handler, responsable for authenticate
	// the graphql API. If a self controlled token was created it mantains the token always updated.
	Authenticator *auth.Authenticator

	// AccessToken is the access token updated by the TokenManager
	AccessToken string
}

Config contains all the configuration required to create and instantiate a dynamic GraphQL API

func (*Config) GetConnectorsValue

func (c *Config) GetConnectorsValue() (string, error)

GetConnectorsValue is the method responsible for retrieving the configurations of the GraphQL API connectors

func (*Config) GetCredentials

func (c *Config) GetCredentials() (string, string, error)

func (*Config) GetSchemaValue

func (c *Config) GetSchemaValue() (string, error)

GetSchemaValue is the method responsible for retrieving the schema settings from the GraphQL API

func (*Config) GetTokenServiceURL

func (c *Config) GetTokenServiceURL() (string, error)

type Credentials

type Credentials struct {
	// ClientID indicates the registered client application id
	ClientID string `json:"client_id"`

	// ClientSecret indicates the password of the registered client application
	ClientSecret string `json:"client_secret"`
}

Credentials represents the credentials that will be used to generate a new token

type Info

type Info struct {
	// Team indicates the name of the team/squad responsable for this service
	Team string `json:"team"`

	// Solution indicates the name of the solution/application
	Solution string `json:"solution"`

	// Domain indicates the domain of the solution (DDD)
	Domain string `json:"domain"`

	// Product indicates the name of the product responsable for this service
	Product string `json:"product"`

	// Tags is an additional field to create custom tags not covered by the default object
	Tags map[string]string `json:"tags"`
}

Info represents the basic config necessary to the graphql observability

type MetricCollectorType

type MetricCollectorType int
const (
	DatadogCollector MetricCollectorType = iota
	OpenTelemetryCollector
)

type TokenService

type TokenService struct {
	// TokenAuthorizationURL represents the URL for the Token service
	TokenAuthorizationURL string `json:"token_authorization_url"`

	// Credentials representa as credenciais que serão utilizadas para gerar um novo token
	Credentials Credentials `json:"credentials"`

	// InsecureSkipVerify indicates if you will validate the certificate or ignore it (more insecure)
	InsecureSkipVerify bool `json:"insecureSkipVerify"`
}

Tokenservice contains the settings needed to generate a token STS

Jump to

Keyboard shortcuts

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