Documentation
¶
Index ¶
- func GetAuthTypeDescription(authType AuthType) string
- func RequiresAPIKeyFallback(method, path string) bool
- func ValidateEndpointAuth(ctx context.Context, cfg *config.Config, method, path string) error
- type AuthType
- type Client
- func (c *Client) API() *datadog.APIClient
- func (c *Client) Config() *config.Config
- func (c *Client) Context() context.Context
- func (c *Client) GetAuthType() AuthType
- func (c *Client) RawRequest(method, path string, body io.Reader) (*http.Response, error)
- func (c *Client) V1() *datadog.APIClient
- func (c *Client) V2() *datadog.APIClient
- func (c *Client) ValidateEndpointAuth(method, path string) error
- type EndpointAuthRequirement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthTypeDescription ¶ added in v0.11.0
GetAuthTypeDescription returns a human-readable description of the auth type
func RequiresAPIKeyFallback ¶ added in v0.11.0
RequiresAPIKeyFallback returns true if the endpoint doesn't support OAuth and we need to fallback to API keys even if OAuth is available
func ValidateEndpointAuth ¶ added in v0.11.0
ValidateEndpointAuth checks if the endpoint can be accessed with the current authentication Returns an error if: 1. The endpoint doesn't support OAuth but only OAuth is available 2. The endpoint requires API keys but they're not configured
Types ¶
type AuthType ¶ added in v0.11.0
type AuthType int
AuthType represents the type of authentication being used
func GetAuthType ¶ added in v0.11.0
GetAuthType returns the authentication type from the context
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Datadog API client
func New ¶
New creates a new Datadog API client Authentication priority:
- OAuth2 tokens (if available and valid)
- API keys (DD_API_KEY and DD_APP_KEY)
func NewWithAPIKeys ¶ added in v0.11.0
NewWithAPIKeys creates a new Datadog API client forcing API key authentication This is used for endpoints that don't support OAuth2
func NewWithOptions ¶ added in v0.11.0
NewWithOptions creates a new Datadog API client with authentication options
func (*Client) GetAuthType ¶ added in v0.11.0
GetAuthType returns the type of authentication being used by this client
func (*Client) RawRequest ¶
RawRequest makes an HTTP request with proper authentication headers. This is used for APIs not covered by the typed datadog-api-client-go library.
func (*Client) ValidateEndpointAuth ¶ added in v0.11.0
ValidateEndpointAuth checks if the current authentication is compatible with the endpoint