fix cross folder copy

also update css/js deps and other minor changes

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-04-13 18:23:42 +02:00
parent 6279216c2e
commit 3cb53b2c33
25 changed files with 322 additions and 131 deletions

View File

@@ -185,6 +185,15 @@ func (k *APIKey) Authenticate(plainKey string) error {
return fmt.Errorf("API key %q is expired, expiration timestamp: %v current timestamp: %v", k.KeyID,
k.ExpiresAt, util.GetTimeAsMsSinceEpoch(time.Now()))
}
if config.PasswordCaching {
found, match := cachedAPIKeys.Check(k.KeyID, plainKey, k.Key)
if found {
if !match {
return ErrInvalidCredentials
}
return nil
}
}
if strings.HasPrefix(k.Key, bcryptPwdPrefix) {
if err := bcrypt.CompareHashAndPassword([]byte(k.Key), []byte(plainKey)); err != nil {
return ErrInvalidCredentials
@@ -196,5 +205,6 @@ func (k *APIKey) Authenticate(plainKey string) error {
}
}
cachedAPIKeys.Add(k.KeyID, plainKey, k.Key)
return nil
}