authentication

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PLUGIN_BASIC_AUTH = "basic-auth"
)

Variables

View Source
var BasicAuthCommand = cli.Command{
	Name: "basic-auth",
	Flags: append(utils.CommonPluginFlags, []cli.Flag{
		cli.BoolFlag{Name: "hide_credentials", Usage: "an optional boolean value telling the plugin to show or hide the credential from the upstream service"},
		cli.StringFlag{Name: "anonymous", Value: "", Usage: "an optional string (consumer uuid) value to use as an “anonymous” consumer if authentication fails"},
	}...),
	Usage: "create basic-auth plugin",
	Subcommands: []cli.Command{
		{
			Name:  "credential",
			Usage: "You can provision new username/password credentials by making the following HTTP request",
			Flags: []cli.Flag{
				cli.StringFlag{Name: "username", Usage: "The username to use in the Basic Authentication,when consumer id is not empty"},
				cli.StringFlag{Name: "password", Usage: "The password to use in the Basic Authentication, when consumer id is not empty"},
				cli.StringFlag{Name: "consumer_id", Usage: "The unique identifier of the consumer that overrides the existing settings for this specific consumer on incoming requests"},
			},
			Action: createBasicAuthCredential,
		},
	},
	Action: createBasicAuthPlugin,
}

Functions

This section is empty.

Types

type BasicAuthCredential

type BasicAuthCredential struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type BasicAuthPluginConfig

type BasicAuthPluginConfig struct {
	Name string `json:"name"`
	//An optional boolean value telling the plugin to show or hide the credential from the upstream service. If true, the plugin will strip the credential from the request (i.e. the Authorization header) before proxying it.
	HideCredentials bool `json:"hide_credentials"`
	//An optional string (consumer uuid) value to use as an “anonymous” consumer if authentication fails. If empty (default), the request will fail with an authentication failure 4xx. Please note that this value must refer to the Consumer id attribute which is internal to Kong, and not its custom_id.
	Anonymous string `json:"anonymous"`
}

Jump to

Keyboard shortcuts

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