tucson

command module
v0.0.0-...-91bc0ee Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 1 Imported by: 0

README

project tucson

It's a place in near Phoenix...

Usage

Tucson is a very basic OIDC capable gateway. It was built out of a need to add auth some backend systems with heterogenous programming languages and mixed capabilities. It was also built out of curiosity and an interest in learning more about how a go proxy might work and how OIDC might work through a proxy. Trade-offs were made in it's implementation and I make no guarentees about it's production suitability.

Tuscon is configured with origins and matchers.

Origins

Origins are the basic building block for proxy backends. Origns have a name key and a configuration. The simplest way to configure origins is through a config file, although it should be possible to configure through the environment as well. Origins support the following parameters:

Parameter Type Description
url string the backend url to proxy to
set_headers map[string]string override headers in the request to the backend
add_header map[string]string append headers in the request to the backend
insecure bool ignore tls errors in backend requests
oidc bool enable/disable oidc for connections to the origin

ex.

"origins": {
  "example": {
    "url": "https:/www.example.com",
    "set_headers": {
      "Host": "www.example.com"
    },
    "insecure": true,
    "oidc": true
  },
  "google": {
    "url": "https://www.google.com",
    "set_headers": {
      "Host": "www.google.com"
    },
    "insecure": false,
    "oidc": false
  }
},
Matchers

Matchers link a url to an origin. The matchers are processed in order with the first match winning. Path patterns are passed directly as chi router patterns. Matchers support the following parameters:

Parameter Type Description
path string the chi router pattern for matching requests
origin string the name of origin to select for the pattern

ex.

  "matchers": [
    {
      "path": "/foo/*",
      "origin": "google"
    },
    {
      "path": "/bar",
      "origin": "example"
    }
  ]
Default Origins

The configuration also accepts a default_origin for anything that falls through.

Limitations

Tucson does not rewrite links and URLs in the payload from backend systems, so they need to be proxy aware.

Author

E Camden Fisher

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd provides our CLI interface for project tuscon
Package cmd provides our CLI interface for project tuscon
internal
srv
token
Package token generates and validates tokens
Package token generates and validates tokens
pkg
chizap
Package chizap implements the zap logging middleware for chi.
Package chizap implements the zap logging middleware for chi.
version provides the version info
version provides the version info

Jump to

Keyboard shortcuts

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