zitadel/internal/auth/repository
Livio Spring aabefb9382
feat(session api): respect lockout policy (#8027)
# Which Problems Are Solved

The session API was designed to be flexible enough for multiple use
cases / login scenarios, where the login could respect the login policy
or not. The session API itself does not have a corresponding policy and
would not check for a required MFA or alike. It therefore also did not
yet respect the lockout policy and would leave it to the login UI to
handle that.
Since the lockout policy is related to the user and not the login
itself, we decided to handle the lockout also on calls of the session
API.

# How the Problems Are Solved

If a lockout policy is set for either password or (T)OTP checks, the
corresponding check on the session API be run against the lockout check.
This means that any failed check, regardless if occurred in the session
API or the current hosted login will be counted against the maximum
allowed checks of that authentication mechanism. TOTP, OTP SMS and OTP
Email are each treated as a separate mechanism.

For implementation:
- The existing lockout check functions were refactored to be usable for
session API calls.
- `SessionCommand` type now returns not only an error, but also
`[]eventstore.Command`
  - these will be executed in case of an error

# Additional Changes

None.

# Additional Context

Closes #7967

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
2024-05-30 22:08:48 +00:00
..
eventsourcing feat(session api): respect lockout policy (#8027) 2024-05-30 22:08:48 +00:00
auth_request.go feat(idp): provide option to auto link user (#7734) 2024-04-10 15:46:30 +00:00
org.go feat(login): use new IDP templates (#5315) 2023-02-28 21:20:58 +01:00
refresh_token.go chore: upgrade to oidc v2 release (#5437) 2023-03-28 11:28:56 +00:00
repository.go fix: move activity log to queries and remove old code (#3096) 2022-01-26 10:16:33 +01:00
token.go feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
user_session.go refactor: cleanup unused code (#7130) 2024-01-02 14:26:31 +00:00
user.go fix: change to repository event types and removed unused code (#3386) 2022-03-31 11:36:26 +02:00