basicauthextension

package module
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 12 Imported by: 14

README

Basic Authenticator

This extension implements configauth.ServerAuthenticator to authenticate clients using HTTP Basic Authentication. The authenticator type has to be set to basicauth.

If authentication is successful client.Info.Auth will expose the following attributes:

  • username: The username of the authenticated user.
  • raw: Raw base64 encoded credentials.

Configuration

extensions:
  basicauth:
    htpasswd: 
      file: .htpasswd
      inline: |
        ${BASIC_AUTH_USERNAME}:${BASIC_AUTH_PASSWORD}

receivers:
  otlp:
    protocols:
      http:
        auth:
          authenticator: basicauth

processors:

exporters:
  logging:
    logLevel: debug

service:
  extensions: [basicauth]
  pipelines:
    traces:
      receivers: [otlp]
      processors: []
      exporters: [logging]
htpasswd
  • file: The path to the htpasswd file.
  • inline: The htpasswd file inline content.

If both file and inline are configured, inline credentials take precedence.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() component.ExtensionFactory

NewFactory creates a factory for the static bearer token Authenticator extension.

Types

type Config

type Config struct {
	config.ExtensionSettings `mapstructure:",squash"`

	// Htpasswd settings.
	Htpasswd HtpasswdSettings `mapstructure:"htpasswd"`
}

type HtpasswdSettings

type HtpasswdSettings struct {
	// Path to the htpasswd file.
	File string `mapstructure:"file"`
	// Inline contents of the htpasswd file.
	Inline string `mapstructure:"inline"`
}

Jump to

Keyboard shortcuts

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