feat: password age policy (#8132)

# Which Problems Are Solved

Some organizations / customers have the requirement, that there users
regularly need to change their password.
ZITADEL already had the possibility to manage a `password age policy` (
thought the API) with the maximum amount of days a password should be
valid, resp. days after with the user should be warned of the upcoming
expiration.
The policy could not be managed though the Console UI and was not
checked in the Login UI.

# How the Problems Are Solved

- The policy can be managed in the Console UI's settings sections on an
instance and organization level.
- During an authentication in the Login UI, if a policy is set with an
expiry (>0) and the user's last password change exceeds the amount of
days set, the user will be prompted to change their password.
- The prompt message of the Login UI can be customized in the Custom
Login Texts though the Console and API on the instance and each
organization.
- The information when the user last changed their password is returned
in the Auth, Management and User V2 API.
- The policy can be retrieved in the settings service as `password
expiry settings`.

# Additional Changes

None.

# Additional Context

- closes #8081

---------

Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
This commit is contained in:
Livio Spring
2024-06-18 13:27:44 +02:00
committed by GitHub
parent 65f787cc02
commit fb8cd18f93
93 changed files with 1250 additions and 487 deletions

View File

@@ -21,24 +21,24 @@ var (
", members.user_id" +
", members.roles" +
", projections.login_names3.login_name" +
", projections.users12_humans.email" +
", projections.users12_humans.first_name" +
", projections.users12_humans.last_name" +
", projections.users12_humans.display_name" +
", projections.users12_machines.name" +
", projections.users12_humans.avatar_key" +
", projections.users12.type" +
", projections.users13_humans.email" +
", projections.users13_humans.first_name" +
", projections.users13_humans.last_name" +
", projections.users13_humans.display_name" +
", projections.users13_machines.name" +
", projections.users13_humans.avatar_key" +
", projections.users13.type" +
", COUNT(*) OVER () " +
"FROM projections.project_grant_members4 AS members " +
"LEFT JOIN projections.users12_humans " +
"ON members.user_id = projections.users12_humans.user_id " +
"AND members.instance_id = projections.users12_humans.instance_id " +
"LEFT JOIN projections.users12_machines " +
"ON members.user_id = projections.users12_machines.user_id " +
"AND members.instance_id = projections.users12_machines.instance_id " +
"LEFT JOIN projections.users12 " +
"ON members.user_id = projections.users12.id " +
"AND members.instance_id = projections.users12.instance_id " +
"LEFT JOIN projections.users13_humans " +
"ON members.user_id = projections.users13_humans.user_id " +
"AND members.instance_id = projections.users13_humans.instance_id " +
"LEFT JOIN projections.users13_machines " +
"ON members.user_id = projections.users13_machines.user_id " +
"AND members.instance_id = projections.users13_machines.instance_id " +
"LEFT JOIN projections.users13 " +
"ON members.user_id = projections.users13.id " +
"AND members.instance_id = projections.users13.instance_id " +
"LEFT JOIN projections.login_names3 " +
"ON members.user_id = projections.login_names3.user_id " +
"AND members.instance_id = projections.login_names3.instance_id " +