traefik_middleware_sigv4

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 10 Imported by: 0

README

Traefik SigV4 Middleware

This is a Traefik plugin that lets you sign your requests sent to an aws-like API. The plugin can be used to serve static sites from an s3-compatible provider.

Configuration

Option Required Description
accessKey X aws Access Key
secretKey X aws Secret Key
sessionToken aws Session Token
service X aws Service
endpoint X aws Endpoint
region X aws Region

Example config

Static config

# traefik.yml
experimental:
  plugins:
    traefik_middleware_sigv4:
      moduleName: "github.com/LiveOakLabs/traefik_middleware_sigv4"
      # Populate this with the latest release tag.
      version: 0.1.0

Dynamic config

http:
  middlewares:
    sigv4:
      plugin:
        traefik_middleware_sigv4:
          accessKey: ROOTNAME
          secretKey: CHANGEME123
          service: s3
          endpoint: minio.localhost
          region: us-east-1
  routers:
    minio:
      rule: host(`minio.localhost`)
      service: minio@docker
      entryPoints:
        - web
      middlewares:
        - sigv4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

Types

type Config

type Config struct {
	AccessKey    string  `json:"accessKey"`
	SecretKey    string  `json:"secretKey"`
	SessionToken *string `json:"sessionToken,omitempty"`
	Service      string  `json:"service"`
	Endpoint     string  `json:"endpoint"`
	Region       string  `json:"region"`
}

func CreateConfig

func CreateConfig() *Config

type Plugin

type Plugin struct {
	AccessKey    string  `json:"accessKey"`
	SecretKey    string  `json:"secretKey"`
	SessionToken *string `json:"sessionToken,omitempty"`
	Service      string  `json:"service"`
	Endpoint     string  `json:"endpoint"`
	Region       string  `json:"region"`
	// contains filtered or unexported fields
}

func (*Plugin) ServeHTTP

func (p *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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