mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
WebUI: add a token validation mode that allows checking the signature
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -783,6 +783,8 @@ type Provider interface {
|
||||
updateLastLogin(username string) error
|
||||
updateAdminLastLogin(username string) error
|
||||
setUpdatedAt(username string)
|
||||
getAdminSignature(username string) (string, error)
|
||||
getUserSignature(username string) (string, error)
|
||||
getFolders(limit, offset int, order string, minimal bool) ([]vfs.BaseVirtualFolder, error)
|
||||
getFolderByName(name string) (vfs.BaseVirtualFolder, error)
|
||||
addFolder(folder *vfs.BaseVirtualFolder) error
|
||||
@@ -2098,6 +2100,20 @@ func UserExists(username, role string) (User, error) {
|
||||
return provider.userExists(username, role)
|
||||
}
|
||||
|
||||
// GetAdminSignature returns the signature for the admin with the specified
|
||||
// username.
|
||||
func GetAdminSignature(username string) (string, error) {
|
||||
username = config.convertName(username)
|
||||
return provider.getAdminSignature(username)
|
||||
}
|
||||
|
||||
// GetUserSignature returns the signature for the user with the specified
|
||||
// username.
|
||||
func GetUserSignature(username string) (string, error) {
|
||||
username = config.convertName(username)
|
||||
return provider.getUserSignature(username)
|
||||
}
|
||||
|
||||
// GetUserWithGroupSettings tries to return the user with the specified username
|
||||
// loading also the group settings
|
||||
func GetUserWithGroupSettings(username, role string) (User, error) {
|
||||
|
||||
Reference in New Issue
Block a user