Skip to content

Commit 5c8bd7c

Browse files
committed
Add a comment on empty passwords
1 parent 14ce3d5 commit 5c8bd7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/authentication_handler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ func NewInMemoryAuthenticationHandler(defaultAuthMethod ...string) *InMemoryAuth
4141
}
4242
}
4343

44+
// Credential holds authentication settings for a user.
45+
// Passwords contains all valid raw passwords for the user. They are hashed on demand during comparison.
46+
// If empty password authentication is allowed, Passwords must contain an empty string (e.g., []string{""})
47+
// rather than being a zero-length slice. A zero-length slice means no valid passwords are configured.
4448
type Credential struct {
45-
Passwords []string // raw passwords, hashed on demand during comparison
49+
Passwords []string
4650
AuthPluginName string
4751
}
4852

0 commit comments

Comments
 (0)