backend

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Backends = []string{
	"github",
	"stns",
}

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Keys(ctx context.Context, opts ...Option) ([]string, error)
}

func New

func New(ctx context.Context, backend string) (Backend, error)

New ...

type Cached

type Cached struct {
	Enable   bool `toml:"enable"`
	Prefecth bool `toml:"prefetch"`
}

type Config

type Config struct {
	Users  []string
	Groups []string
}

type GitHub

type GitHub struct {
	// contains filtered or unexported fields
}

func NewGitHub

func NewGitHub(ctx context.Context) (*GitHub, error)

NewGitHub ...

func (*GitHub) Keys

func (b *GitHub) Keys(ctx context.Context, options ...Option) ([]string, error)

type Option

type Option func(*Config) error

func Groups

func Groups(groups []string) (Option, error)

Groups ...

func Teams

func Teams(teams []string) (Option, error)

Teams ...

func Users

func Users(users []string) (Option, error)

Users ...

type STNS

type STNS struct {
	// contains filtered or unexported fields
}

func NewSTNS

func NewSTNS() (*STNS, error)

NewSTNS ...

func (*STNS) Keys

func (b *STNS) Keys(ctx context.Context, options ...Option) ([]string, error)

Keys ...

type STNSClientConfig

type STNSClientConfig struct {
	// api_endpoint = "http://api01.example.com/v1"
	APIEndpoint string `toml:"api_endpoint"`
	// http_proxy = "http://localhost:8080"
	HTTPProxy string `toml:"http_proxy"`
	// request_timeout = 3
	RequestTimeout int `toml:"request_timeout"`
	// request_retry = 1
	RequestRetry int `toml:"request_timeout"`
	// request_locktime = 600
	RequestLocktime int `toml:"request_locktime"`
	// ssl_verify = true
	SSLVerify bool `toml:"ssl_verify"`
	// # basic auth
	// user = "basic_user"
	User string `toml:"user"`
	// password = "basic_password"
	Password string `toml:"password"`
	// # token auth
	// auth_token = "token"
	AuthToken string `toml:"auth_token"`

	// query_wrapper = "/usr/local/bin/stns-query-wrapper"
	QueryWrapper string `toml:"query_wrapper"`
	// chain_ssh_wrapper = "/usr/libexec/openssh/ssh-ldap-wrapper"
	ChainSSHWrapper string `toml:"chain_ssh_wrapper"`

	// cache = true
	Cache bool `toml:"cache"`
	// cache_dir = "/var/cache/stns/"
	CacheDir string `toml:"cache_dir"`
	// cache_ttl = 600
	CacheTTL int `toml:"cache_ttl"`
	// negative_cache_ttl = 600
	NegativeCacheTTL int `toml:"negative_cache_ttl"`

	// uid_shift = 2000
	UIDShift int `toml:"uid_shift"`
	// gid_shift = 2000
	GIDShift int `toml:"gid_shift"`

	// # tls client authentication
	// [tls]
	// ca   = "/etc/stns/keys/ca.pem"
	// cert = "/etc/stns/keys/client.crt"
	// key  = "/etc/stns/keys/client.key"
	TLS *TLS `toml:"tls,omitempty"`

	// [cached]
	// enable = true
	// prefetch = true
	Cached *Cached `toml:"cached,omitempty"`
}

type TLS

type TLS struct {
	CA   string `toml:"ca"`
	Cert string `toml:"cert"`
	Key  string `toml:"key"`
}

Jump to

Keyboard shortcuts

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