googleclientauthextension

package module
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

README

Authenticator - Google Client Credentials

Status
Stability alpha

This extension provides Google OAuth2 Client Credentials and Metadata for gRPC and http based exporters.

The authenticator type has to be set to googleclientauth.

Configuration

extensions:
  googleclientauth:

receivers:
  otlp:
    protocols:
      grpc:

exporters:
  otlp/withauth:
    endpoint: 0.0.0.0:5000
    ca_file: /tmp/certs/ca.pem
    auth:
      authenticator: googleclientauth

service:
  extensions: [googleclientauth]
  pipelines:
    metrics:
      receivers: [otlp]
      processors: []
      exporters: [otlp/withauth]

Following are the configuration fields:

  • project - The Google Cloud Project telemetry is sent to if the gcp.project.id resource attribute is not set. If unspecified, this is determined using application default credentials.
  • scopes - The oauth 2.0 scopes requested by the extension.
  • quota_project - The project for quota and billing purposes. The caller must have serviceusage.services.use permission on the project.
  • token_type - The type of generated token. Default: access_token
  • audience - The audience claim used for generating ID token

Documentation

Overview

Package googleclientauthextension provides gRPC and HTTP credentials and metadata using Application Default Credentials: https://cloud.google.com/docs/authentication#adc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultConfig added in v0.46.0

func CreateDefaultConfig() component.Config

func CreateExtension added in v0.46.0

func CreateExtension(ctx context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error)

Types

type Config

type Config struct {
	// Project is the project telemetry is sent to if the gcp.project.id
	// resource attribute is not set. If unspecified, this is determined using
	// application default credentials.
	Project string `mapstructure:"project"`

	// QuotaProject specifies a project for quota and billing purposes. The
	// caller must have serviceusage.services.use permission on the project.
	//
	// For more information please read:
	// https://cloud.google.com/apis/docs/system-parameters
	QuotaProject string `mapstructure:"quota_project"`

	// TokenType specifies which type of token will be generated.
	// default: access_token
	TokenType string `mapstructure:"token_type,omitempty"`

	// Audience specifies the audience claim used for generating ID token.
	Audience string `mapstructure:"audience,omitempty"`

	// Scope specifies optional requested permissions.
	// See https://datatracker.ietf.org/doc/html/rfc6749#section-3.3
	Scopes []string `mapstructure:"scopes,omitempty"`
}

Config stores the configuration for GCP Client Credentials.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the extension configuration is valid.

Jump to

Keyboard shortcuts

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