aboutsummaryrefslogtreecommitdiff
path: root/src/db/models/org_policy.rs
AgeCommit message (Collapse)Author
2024-06-20Merge branch 'main' into remove_upcaseremove_upcaseDaniel García
2024-06-20Fix some more nightly errors and remove lint that will become an error by ↵Daniel García
default (#4661)
2024-06-19Change API inputs/outputs and structs to camelCaseDaniel García
2024-03-17automatically use email address as 2fa provider (#4317)Stefan Melmuk
2023-04-06check if reset policy is enabledStefan Melmuk
2023-01-25added database migrationsirux88
2022-10-23Update to diesel2Daniel García
2022-08-20Add Org user revoke featureBlackDex
This PR adds a the new v2022.8.x revoke feature which allows an organization owner or admin to revoke access for one or more users. This PR also fixes several permissions and policy checks which were faulty. - Modified some functions to use DB Count features instead of iter/count aftwards. - Rearanged some if statements (faster matching or just one if instead of nested if's) - Added and fixed several policy checks where needed - Some small updates on some response models - Made some functions require an enum instead of an i32
2022-06-14Updated deps and misc fixes and updatesBlackDex
- Updated some Rust dependencies - Fixed an issue with CSP header, this was not configured correctly - Prevent sending CSP and Frame headers for the MFA connector.html files. Else some clients will fail to handle these protocols. - Add `unsafe-inline` for `script-src` only to the CSP for the Admin Interface - Updated JavaScript and CSS files for the Admin interface - Changed the layout for showing overridden settings, better visible now. - Made the version check cachable to prevent hitting the Github API rate limits - Hide the `database_url` as if it is a password in the Admin Interface Else for MariaDB/MySQL or PostgreSQL this was plain text. - Fixed an issue that pressing enter on the SMTP Test would save the config. resolves #2542 - Prevent user names larger then 50 characters resolves #2419
2022-05-06Improve sync speed and updated dep. versionsBlackDex
Improved sync speed by resolving the N+1 query issues. Solves #1402 and Solves #1453 With this change there is just one query done to retreive all the important data, and matching is done in-code/memory. With a very large database the sync time went down about 3 times. Also updated misc crates and Github Actions versions.
2022-02-27Async/Awaited all db methodsBlackDex
This is a rather large PR which updates the async branch to have all the database methods as an async fn. Some iter/map logic needed to be changed to a stream::iter().then(), but besides that most changes were just adding async/await where needed.
2021-10-02feature: Support single organization policyAdam Jones
This adds back-end support for the [single organization policy](https://bitwarden.com/help/article/policies/#single-organization).
2021-07-15Merge branch '2fa_enforcement' of ↵Daniel García
https://github.com/olivierIllogika/bitwarden_rs into olivierIllogika-2fa_enforcement
2021-05-12Add support for the `Send Options` policyJeremy Lin
Upstream refs: * https://github.com/bitwarden/server/pull/1234 * https://bitwarden.com/help/article/policies/#send-options
2021-04-16Merge branch 'master' of github.com:dani-garcia/bitwarden_rs into ↵Olivier Martin
2fa_enforcement # Conflicts: # src/db/models/org_policy.rs # src/db/models/organization.rs
2021-04-11Resolves dani-garcia/bitwarden_rs#981Olivier Martin
* a user without 2fa trying to join a 2fa org will fail, but user gets an email to enable 2fa * a user disabling 2fa will be removed from 2fa orgs; user gets an email for each org * an org enabling 2fa policy will remove users without 2fa; users get an email
2021-03-31Reflow some lines manuallyJake Howard
2021-03-31Run `cargo fmt` on codebaseJake Howard
2021-03-16Add support for the Disable Send policyJeremy Lin
Upstream refs: * https://github.com/bitwarden/server/pull/1130 * https://bitwarden.com/help/article/policies/#disable-send
2021-03-13Remove debug impl from database structsDaniel García
This is only implemented for the database specific structs, which is not what we want
2021-01-23Add support for the Personal Ownership policyJeremy Lin
Upstream refs: * https://github.com/bitwarden/server/pull/1013 * https://bitwarden.com/help/article/policies/#personal-ownership
2020-11-08Ensure that a user is actually in an org when applying policiesAve
2020-11-07Try to fix #1218Daniel García
2020-09-22Fixed foreign-key (mariadb) errors.BlackDex
When using MariaDB v10.5+ Foreign-Key errors were popping up because of some changes in that version. To mitigate this on MariaDB and other MySQL forks those errors are now catched, and instead of a replace_into an update will happen. I have tested this as thorough as possible with MariaDB 10.5, 10.4, 10.3 and the default MySQL on Ubuntu Focal. And tested it again using sqlite, all seems to be ok on all tables. resolves #1081. resolves #1065, resolves #1050
2020-08-24Add support for multiple simultaneous database features by using macros.Daniel García
Diesel requires the following changes: - Separate connection and pool types per connection, the generate_connections! macro generates an enum with a variant per db type - Separate migrations and schemas, these were always imported as one type depending on db feature, now they are all imported under different module names - Separate model objects per connection, the db_object! macro generates one object for each connection with the diesel macros, a generic object, and methods to convert between the connection-specific and the generic ones - Separate connection queries, the db_run! macro allows writing only one that gets compiled for all databases or multiple ones
2020-05-03Remove unused dependency and simple feature, update dependencies and fix ↵Daniel García
some clippy lints
2020-03-14Fix postgres policies, second tryDaniel García
2020-03-14Fix issue with postgresDaniel García
2020-03-14Initial version of policiesDaniel García