Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
property BasicAuthenticationSecurity.credentials : MutableMapping[str, str]
Mapping from username to password.
Use individual_roles to grant roles to the users.
Example
>>> session_config = tt.SessionConfig(security=tt.SecurityConfig())
>>> session = tt.Session.start(session_config)
>>> session.security.basic_authentication.credentials
{}
Letting a user authenticate through Basic Authentication requires two steps:
- Granting the required role:
>>> session.security.individual_roles["Chen"] = {"ROLE_USER"}
- Configuring credentials:
>>> session.security.basic_authentication.credentials["Chen"] = "Peking"
The password can be changed:
>>> session.security.basic_authentication.credentials["Chen"] = "Beijing"
But, for security reasons, it cannot be retrieved.
Accessing it will return a redacted string:
>>> session.security.basic_authentication.credentials
{'Chen': '**REDACTED**'}
Revoking access:
>>> del session.security.basic_authentication.credentials["Chen"]
>>> session.security.basic_authentication.credentials
{}
Cleaning the individual roles to not leave unused keys:
>>> del session.security.individual_roles["Chen"]