allow to cache external authentications

Fixes #733

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-02-25 11:51:10 +01:00
parent f5a0559be6
commit 4e9dae6fa4
13 changed files with 182 additions and 22 deletions

View File

@@ -96,6 +96,7 @@ type Manager struct {
hasSearcher bool
hasMetadater bool
hasNotifiers bool
hasAuths bool
}
// Initialize initializes the configured plugins
@@ -174,6 +175,7 @@ func (m *Manager) validateConfigs() error {
m.hasSearcher = false
m.hasMetadater = false
m.hasNotifiers = false
m.hasAuths = false
for _, config := range m.Configs {
if config.Type == kmsplugin.PluginName {
@@ -201,10 +203,18 @@ func (m *Manager) validateConfigs() error {
if config.Type == notifier.PluginName {
m.hasNotifiers = true
}
if config.Type == auth.PluginName {
m.hasAuths = true
}
}
return nil
}
// HasAuthenticators returns true if there is at least an auth plugin
func (m *Manager) HasAuthenticators() bool {
return m.hasAuths
}
// HasNotifiers returns true if there is at least a notifier plugin
func (m *Manager) HasNotifiers() bool {
return m.hasNotifiers