Skip to main content

Crate secrets_auth_userpass

Crate secrets_auth_userpass 

Source

Structs§

UserInfo
What may be said about a user to anyone allowed to manage it. A separate type from the stored record, so the password hash cannot end up in a response by someone serializing the wrong struct.
UserPassAuth

Constants§

MAX_USERNAME_LEN
Longest username accepted by UserPassAuth::upsert_user.
MIN_PASSWORD_LEN
Shortest password accepted by UserPassAuth::upsert_user, in characters. These identities belong to services, whose passwords are generated, so the floor costs nothing and rules out a guessable one slipping in.

Functions§

validate_password
At least MIN_PASSWORD_LEN characters — counted as characters, not bytes, so a non-ASCII password is not credited for its encoding.
validate_policies
An empty list is fine (an identity that can log in and do nothing); an empty name is not, since it can only be a mistake in the caller.
validate_username
[A-Za-z0-9_.-], 1 to MAX_USERNAME_LEN characters, not starting with .. The name becomes a storage key and a policy path segment, so it must not carry / (which would reach into another key’s namespace) or look like a relative path component.