Return error on reload on encountering an invalid identity
This commit is contained in:
parent
abfe4918b4
commit
ddb18a8c3c
@ -41,15 +41,22 @@ func New(config iam.Config, store store.Store) (iam.IAM, error) {
|
||||
|
||||
func (m *manager) apply(op store.Operation) {
|
||||
m.logger.Debug().WithField("operation", string(op)).Log("Applying action on operation")
|
||||
|
||||
var err error
|
||||
|
||||
switch op {
|
||||
case store.OpAddIdentity:
|
||||
m.ReloadIndentities()
|
||||
err = m.ReloadIndentities()
|
||||
case store.OpUpdateIdentity:
|
||||
m.ReloadIndentities()
|
||||
err = m.ReloadIndentities()
|
||||
case store.OpRemoveIdentity:
|
||||
m.ReloadIndentities()
|
||||
err = m.ReloadIndentities()
|
||||
case store.OpSetPolicies:
|
||||
m.ReloadPolicies()
|
||||
err = m.ReloadPolicies()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
m.logger.Error().WithError(err).WithField("operation", string(op)).Log("")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -607,7 +607,7 @@ func (im *identityManager) Reload() error {
|
||||
}
|
||||
|
||||
if err := u.Validate(); err != nil {
|
||||
continue
|
||||
return fmt.Errorf("invalid user from adapter: %s, %w", u.Name, err)
|
||||
}
|
||||
|
||||
identity, err := im.create(u)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user