mirror of
https://github.com/jech/galene.git
synced 2024-11-09 18:25:58 +01:00
Ensure that keys can be parsed in SetKeys.
This commit is contained in:
parent
3a6d924374
commit
6c01925342
1 changed files with 9 additions and 0 deletions
|
@ -11,6 +11,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/jech/galene/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrTagMismatch = errors.New("tag mismatch")
|
var ErrTagMismatch = errors.New("tag mismatch")
|
||||||
|
@ -578,6 +580,13 @@ func SetWildcardUser(group string, user *UserDescription) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKeys(group string, keys []map[string]any) error {
|
func SetKeys(group string, keys []map[string]any) error {
|
||||||
|
if keys != nil {
|
||||||
|
_, err := token.ParseKeys(keys)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
groups.mu.Lock()
|
groups.mu.Lock()
|
||||||
defer groups.mu.Unlock()
|
defer groups.mu.Unlock()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue