lessor

package module
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

lessor

Caddy based plugin to dynamically inject X-Scope-OrgID header values into Loki bound requests.

Building

You first need to build a new caddy executable with this plugin. The easiest way is to do this with xcaddy.

Install xcaddy :

go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

After xcaddy installation you can build caddy with this plugin by executing:

xcaddy build v2.6.4 --with github.com/loafoe/lessor

Configuration

Helm

Use the included Helm chart to deploy. Example values.yaml

issuer: https://dex.hsp.hostedzonehere.com/

loki:
  url: loki-gateway.observability.svc
  
ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: lessor.test.hostedzonehere.com
      paths:
        - path: /
          pathType: ImplementationSpecific

Then deploy:

helm template lessor charts/lessor --skip-tests --values values.yaml|kubectl apply -f - -n lessor

Once deployed you can configure your Grafana Data source to point to https://lessor.test.hostedzonehere.com. Make sure you enable the Forward OAuth Identity option so lessor can extract tenant claims and inject the X-Scope-OrgID

License

Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	Issuer string
	// contains filtered or unexported fields
}

func (*Middleware) CaddyModule

func (m *Middleware) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Middleware) Provision

func (m *Middleware) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner.

func (*Middleware) ServeHTTP

func (m *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (*Middleware) UnmarshalCaddyfile

func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up Lessor from Caddyfile tokens. Syntax: UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

lessor [<issuer_url>] {
    issuer <issuer_url>
}

func (*Middleware) Validate

func (m *Middleware) Validate() error

Validate implements caddy.Validator.

Jump to

Keyboard shortcuts

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