[PR #3116] [MERGED] Admin password reset #3218

Closed
opened 2026-03-03 09:41:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3116
Author: @sirux88
Created: 1/6/2023
Status: Merged
Merged: 2/12/2023
Merged by: @dani-garcia

Base: mainHead: admin-password-reset


📝 Commits (8)

  • 9549408 added database migration
  • c6c45c4 working implementation
  • adaefc8 fixes for current upstream main
  • 26cd5d9 Replaced wrong mysql column type
  • 62dfeb8 improved security, disabling policy usage on
  • a6558f5 rust lang specific improvements
  • 0d1753a completly hide reset password policy
  • 78abdf0 Merge branch 'main' into admin-password-reset

📊 Changes

17 files changed (+284 additions, -6 deletions)

View changed files

migrations/mysql/2023-01-06-151600_add_reset_password_support/down.sql (+0 -0)
migrations/mysql/2023-01-06-151600_add_reset_password_support/up.sql (+2 -0)
migrations/postgresql/2023-01-06-151600_add_reset_password_support/down.sql (+0 -0)
migrations/postgresql/2023-01-06-151600_add_reset_password_support/up.sql (+2 -0)
migrations/sqlite/2023-01-06-151600_add_reset_password_support/down.sql (+0 -0)
migrations/sqlite/2023-01-06-151600_add_reset_password_support/up.sql (+2 -0)
📝 src/api/core/organizations.rs (+213 -0)
📝 src/config.rs (+1 -0)
📝 src/db/models/event.rs (+3 -3)
📝 src/db/models/org_policy.rs (+22 -1)
📝 src/db/models/organization.rs (+6 -2)
📝 src/db/schemas/mysql/schema.rs (+1 -0)
📝 src/db/schemas/postgresql/schema.rs (+1 -0)
📝 src/db/schemas/sqlite/schema.rs (+1 -0)
📝 src/mail.rs (+13 -0)
src/static/templates/email/admin_reset_password.hbs (+6 -0)
src/static/templates/email/admin_reset_password.html.hbs (+11 -0)

📄 Description

Since i'd like to use the admin reset password functionality within my instance I implemented the missing "Reset Master Password" policy and the needed functions

There are two points that (maybe) need improvment:

  • Auto-enrollment won't work for instances without email enabled
  • Bitwarden's reference implementation logs out the user to reset after resetting the password. I haven't found a api/method for this and also don't know how to implement

As i'm not used to programming in rust please feel free to comment and throw any improvements concering syntax.
All other improvements are welcome aswell


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3116 **Author:** [@sirux88](https://github.com/sirux88) **Created:** 1/6/2023 **Status:** ✅ Merged **Merged:** 2/12/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `admin-password-reset` --- ### 📝 Commits (8) - [`9549408`](https://github.com/dani-garcia/vaultwarden/commit/95494083f2b09417fef916f4d315cb5a38a78128) added database migration - [`c6c45c4`](https://github.com/dani-garcia/vaultwarden/commit/c6c45c4c49be81a86240b7a4462b7d502be4257d) working implementation - [`adaefc8`](https://github.com/dani-garcia/vaultwarden/commit/adaefc8628423dd7aebb39e76ce35ee00ce618c5) fixes for current upstream main - [`26cd5d9`](https://github.com/dani-garcia/vaultwarden/commit/26cd5d96434d497cc0a7ca11cacc5ea9845230c0) Replaced wrong mysql column type - [`62dfeb8`](https://github.com/dani-garcia/vaultwarden/commit/62dfeb80f211f9ec283b46d8158f86d715f8e6b5) improved security, disabling policy usage on - [`a6558f5`](https://github.com/dani-garcia/vaultwarden/commit/a6558f55488c86c1aa702e9a5e7875afbd2e7490) rust lang specific improvements - [`0d1753a`](https://github.com/dani-garcia/vaultwarden/commit/0d1753ac747c43b9f48310c4f7be284fdc6ee669) completly hide reset password policy - [`78abdf0`](https://github.com/dani-garcia/vaultwarden/commit/78abdf0e9d5921a01f2da0bac5704722bc42c818) Merge branch 'main' into admin-password-reset ### 📊 Changes **17 files changed** (+284 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `migrations/mysql/2023-01-06-151600_add_reset_password_support/down.sql` (+0 -0) ➕ `migrations/mysql/2023-01-06-151600_add_reset_password_support/up.sql` (+2 -0) ➕ `migrations/postgresql/2023-01-06-151600_add_reset_password_support/down.sql` (+0 -0) ➕ `migrations/postgresql/2023-01-06-151600_add_reset_password_support/up.sql` (+2 -0) ➕ `migrations/sqlite/2023-01-06-151600_add_reset_password_support/down.sql` (+0 -0) ➕ `migrations/sqlite/2023-01-06-151600_add_reset_password_support/up.sql` (+2 -0) 📝 `src/api/core/organizations.rs` (+213 -0) 📝 `src/config.rs` (+1 -0) 📝 `src/db/models/event.rs` (+3 -3) 📝 `src/db/models/org_policy.rs` (+22 -1) 📝 `src/db/models/organization.rs` (+6 -2) 📝 `src/db/schemas/mysql/schema.rs` (+1 -0) 📝 `src/db/schemas/postgresql/schema.rs` (+1 -0) 📝 `src/db/schemas/sqlite/schema.rs` (+1 -0) 📝 `src/mail.rs` (+13 -0) ➕ `src/static/templates/email/admin_reset_password.hbs` (+6 -0) ➕ `src/static/templates/email/admin_reset_password.html.hbs` (+11 -0) </details> ### 📄 Description Since i'd like to use the admin reset password functionality within my instance I implemented the missing "Reset Master Password" policy and the needed functions There are two points that (maybe) need improvment: - Auto-enrollment won't work for instances without email enabled - Bitwarden's reference implementation logs out the user to reset after resetting the password. I haven't found a api/method for this and also don't know how to implement As i'm not used to programming in rust please feel free to comment and throw any improvements concering syntax. All other improvements are welcome aswell --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:41:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3218
No description provided.