Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UNDEFINED is the undefined type which would behave the same as NOOP UNDEFINED = Type("") // NOOP would effectively disable security feature NOOP = Type("NOOP") // BASIC would use username and password for auth BASIC = Type("BASIC") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // AuthType is the type of auth AuthType Type `yaml:"auth_type"` // Path is the path to the config file for auth Path string `yaml:"path"` }
Config is auth specific configuration
type SecurityClient ¶
type SecurityClient interface { // GetToken returns the token needed by internal component // for communication GetToken() Token }
SecurityClient is the internal client used by each of the peloton components to talk to each other. For each SecurityManager there should be a corresponding SecurityClient, which helps components communication.
type SecurityManager ¶
type SecurityManager interface { // Authenticate with the token provided, // return User if authentication succeeds Authenticate(token Token) (User, error) // RedactToken redact token passed in by // removing sensitive info, so the info would // not be leaked into other components and get // leaked/logged accidentally. // It would be called after auth is done, before // passing the token to other components RedactToken(token Token) }
SecurityManager includes authentication related methods
type Token ¶
type Token interface { Get(k string) (string, bool) Del(k string) // Items returns all of the items in the token. // The returned map should not be modified, it is // the caller's responsibility to copy before write. Items() map[string]string }
Token is used by SecurityManager to authenticate a user
Click to show internal directories.
Click to hide internal directories.