Login admission¶
rn_forge.auth.admission
¶
Admit a verified login to an account and session; the caller starts the session.
AdmittedLogin(account_id, session, return_to)
dataclass
¶
The account, session content and destination for an admitted login.
Attributes:
| Name | Type | Description |
|---|---|---|
account_id |
str
|
The internal account ID. |
session |
SessionInfo
|
The identity content to use when starting the session. |
return_to |
str
|
The validated destination after login. |
admit_login(completed, *, provider_id, accounts, contexts, now, absolute_timeout, return_to_prefixes, default_return_to)
¶
Resolve a verified login and build its session content.
Emits account.rejected or account.disabled when admission is
refused. It does not emit login.success or a log warning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
completed
|
CompletedLogin
|
The verified identity and requested destination. |
required |
provider_id
|
str
|
The configured provider ID used by audit events. |
required |
accounts
|
AccountResolver
|
The resolver for external identities. |
required |
contexts
|
AuthorizationContextProvider
|
The account context provider. |
required |
now
|
datetime
|
The time the session starts. |
required |
absolute_timeout
|
timedelta
|
The session's absolute lifetime. |
required |
return_to_prefixes
|
Sequence[str]
|
Path prefixes the destination may use. |
required |
default_return_to
|
str
|
The destination used for an invalid path. |
required |
Returns:
| Type | Description |
|---|---|
AdmittedLogin
|
The admitted account, session content and validated destination. |
Raises:
| Type | Description |
|---|---|
LoginFailed
|
|