atoti_query.security.basic_security.BasicSecurity.credentials#
- property BasicSecurity.credentials: MutableMapping[str, str]#
Mapping from username to password.
Note
At the moment, unlike the rest of the
Securityconfiguration, these credentials are transient (kept in memory). They are not stored in theuser content storageand thus will reset when the session stops.Use
individual_rolesto grant roles to the user.Example
>>> session = tt.Session(authentication=tt.BasicAuthenticationConfig()) >>> session.security.basic.credentials {} >>> session.security.basic.credentials["elon"] = "X Æ A-12" >>> # The password can be changed: >>> session.security.basic.credentials["elon"] = "AE A-XII" >>> # But, for security reasons, it cannot be retrieved (accessing it will return a redacted string): >>> session.security.basic.credentials {'elon': '**REDACTED**'} >>> # Prevent user to authenticate through basic authentication: >>> del session.security.basic.credentials["elon"] >>> session.security.basic.credentials {}