grape

package module
v0.0.2-0...-39a6fec Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

grape grape Release Go Report Card GoDoc Docker Container Image Size Docker Container Layers

WIP: Grafana Elasticsearch proxy for TXN2 account keys.

Release Packaging

Build test release:

goreleaser --skip-publish --rm-dist --skip-validate

Build and release:

GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-dist

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Cfg
	// contains filtered or unexported fields
}

Auth

func NewAuth

func NewAuth(cfg Cfg) *Auth

NewAuth

func (*Auth) RequestHandler

func (a *Auth) RequestHandler(c *gin.Context)

RequestHandler is reverse proxy middleware for checking calls made by the Grafana Elasticsearch datasource. The data source makes two type of calls. A GET call for index/_mapping and /_msearch calls for batching queries.

Each call is checked for an account prefixed index ACCOUNT-index and permission are verified using the name and password segments from BasicAuth as key name and key from the corresponding account. See: https://godoc.org/github.com/txn2/provision#AccessKey

Elasticsearch datasource documentation see: https://grafana.com/docs/features/datasources/elasticsearch/

type Cfg

type Cfg struct {
	HttpClient       *http.Client
	Logger           *zap.Logger
	PathPrefix       string
	ProvisionService string
}

Cfg

type IndexArray

type IndexArray struct {
	Indexes []string `json:"index"`
}

IndexArray

type IndexSingle

type IndexSingle struct {
	Index string `json:"index"`
}

IndexSingle

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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