auth

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name of the service
	Name = "go.micro.auth"
	// Address of the service
	Address = ":8010"
	// ServiceFlags are provided to commands which run micro services
	ServiceFlags = []cli.Flag{
		&cli.StringFlag{
			Name:    "address",
			Usage:   "Set the auth http address e.g 0.0.0.0:8010",
			EnvVars: []string{"MICRO_SERVER_ADDRESS"},
		},
		&cli.StringFlag{
			Name:    "auth_provider",
			EnvVars: []string{"MICRO_AUTH_PROVIDER"},
			Usage:   "Auth provider enables account generation",
		},
		&cli.StringFlag{
			Name:    "auth_public_key",
			EnvVars: []string{"MICRO_AUTH_PUBLIC_KEY"},
			Usage:   "Public key for JWT auth (base64 encoded PEM)",
		},
		&cli.StringFlag{
			Name:    "auth_private_key",
			EnvVars: []string{"MICRO_AUTH_PRIVATE_KEY"},
			Usage:   "Private key for JWT auth (base64 encoded PEM)",
		},
	}
	// RuleFlags are provided to commands which create or delete rules
	RuleFlags = []cli.Flag{
		&cli.StringFlag{
			Name:     "role",
			Usage:    "The role to amend, e.g. 'user' or '*' to represent all",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "resource",
			Usage:    "The resource to amend in the format namespace:type:name:endpoint, e.g. micro:service:go.micro.auth:*",
			Required: true,
		},
		&cli.StringFlag{
			Name:  "access",
			Usage: "The access level, must be granted or denied",
			Value: "granted",
		},
		&cli.IntFlag{
			Name:  "priority",
			Usage: "The priority level, default is 0, the greater the number the higher the priority",
			Value: 0,
		},
	}
	// AccountFlags are provided to the create account command
	AccountFlags = []cli.Flag{
		&cli.StringFlag{
			Name:     "id",
			Usage:    "The account id",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "secret",
			Usage:    "The account secret (password)",
			Required: true,
		},
		&cli.StringSliceFlag{
			Name:  "roles",
			Usage: "Comma seperated list of roles to give the account",
		},
	}
	// PlatformFlag connects via proxy
	PlatformFlag = &cli.BoolFlag{
		Name:  "platform",
		Usage: "Connect to the platform",
		Value: false,
	}
)

Functions

func Commands

func Commands(srvOpts ...micro.Option) []*cli.Command

Commands for auth

func Plugins

func Plugins() []plugin.Plugin

Plugins lists the auth plugins

func Register

func Register(pl plugin.Plugin) error

Register registers an auth plugin

Types

This section is empty.

Directories

Path Synopsis
api
handler

Jump to

Keyboard shortcuts

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