Documentation ¶
Index ¶
- Variables
- func BasicAuth() middleware.Middleware
- func ClearLocalUser(username string)
- func ClearPassword(username string)
- func GetCachedCredential(username string) (credential.AuthCredential, bool)
- func GetCachedCredentials() []credential.AuthCredential
- func IsPasswordExist(username string, password string) bool
- func RemoveCredentialFromCache(username string)
- func SaveCredentialToCache(username string, c credential.AuthCredential)
- func SavePassword(username string, password string)
- type Auth
- type Cache
- type CacheSyncScript
Constants ¶
This section is empty.
Variables ¶
var CredentialCache = Cache{ // contains filtered or unexported fields }
CredentialCache represents the cached users/credentials where key is `username`
var CurrentProcessMutex = sync.RWMutex{}
CurrentProcessMutex to stop concurrent writes on map
var UserToPasswordCache = make(map[string]string)
UserToPasswordCache represents a map of bcrypt validated users
Functions ¶
func BasicAuth ¶
func BasicAuth() middleware.Middleware
BasicAuth middleware authenticates each requests against the basic auth credentials.
func ClearPassword ¶
func ClearPassword(username string)
ClearPassword clears the password in the cache
func GetCachedCredential ¶
func GetCachedCredential(username string) (credential.AuthCredential, bool)
GetCachedCredential returns the cached credential
func GetCachedCredentials ¶
func GetCachedCredentials() []credential.AuthCredential
GetCachedCredentials returns the cached credentials
func IsPasswordExist ¶
IsPasswordExist checks whether the password in the cache or not
func RemoveCredentialFromCache ¶
func RemoveCredentialFromCache(username string)
RemoveCredentialFromCache removes the credential from the cache
func SaveCredentialToCache ¶
func SaveCredentialToCache(username string, c credential.AuthCredential)
SaveCredentialToCache saves the credential to the cache
func SavePassword ¶
SavePassword saved the password in the cache
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func Instance ¶
func Instance() *Auth
Instance returns the singleton instance of the auth plugin. Instance should be the only way (both within or outside the package) to fetch the instance of the plugin, in order to avoid stateless duplicates.
func (*Auth) ESMiddleware ¶
func (a *Auth) ESMiddleware() []middleware.Middleware
Default empty middleware array function
func (*Auth) InitFunc ¶
InitFunc initializes the dao, i.e. elasticsearch client, and should be executed only once in the lifetime of the plugin.
func (*Auth) RSMiddleware ¶
func (a *Auth) RSMiddleware() []middleware.Middleware
Default empty middleware array function
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache represents the struct for CredentialCache
type CacheSyncScript ¶
type CacheSyncScript struct {
// contains filtered or unexported fields
}
func (CacheSyncScript) Index ¶
func (s CacheSyncScript) Index() string
func (CacheSyncScript) PluginName ¶
func (s CacheSyncScript) PluginName() string
func (CacheSyncScript) SetCache ¶
func (s CacheSyncScript) SetCache(response *elastic.SearchResult) error