Skip to content

Commit a8a19d3

Browse files
PM-14922 - Move AC policy code to own crate to unblock auth login work (#600)
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-14922 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> To move the AC owned policy code out of the BW-Core crate into its own folder so I can place new domain models there which is required by the data we return for successful logins. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
1 parent 0d52f61 commit a8a19d3

File tree

8 files changed

+46
-13
lines changed

8 files changed

+46
-13
lines changed

Cargo.lock

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ bitwarden-fido = { path = "crates/bitwarden-fido", version = "=1.0.0" }
3636
bitwarden-generators = { path = "crates/bitwarden-generators", version = "=1.0.0" }
3737
bitwarden-ipc = { path = "crates/bitwarden-ipc", version = "=1.0.0" }
3838
bitwarden-pm = { path = "crates/bitwarden-pm", version = "=1.0.0" }
39+
bitwarden-policies = { path = "crates/bitwarden-policies", version = "=1.0.0" }
3940
bitwarden-send = { path = "crates/bitwarden-send", version = "=1.0.0" }
4041
bitwarden-sm = { path = "bitwarden_license/bitwarden-sm", version = "=1.0.0" }
4142
bitwarden-ssh = { path = "crates/bitwarden-ssh", version = "=1.0.0" }

crates/bitwarden-core/src/admin_console/mod.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/bitwarden-core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ uniffi::setup_scaffolding!();
55
#[cfg(feature = "uniffi")]
66
mod uniffi_support;
77

8-
#[cfg(feature = "internal")]
9-
pub mod admin_console;
108
pub mod auth;
119
pub mod client;
1210
mod error;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "bitwarden-policies"
3+
version.workspace = true
4+
authors.workspace = true
5+
edition.workspace = true
6+
rust-version.workspace = true
7+
homepage.workspace = true
8+
repository.workspace = true
9+
license-file.workspace = true
10+
readme.workspace = true
11+
keywords.workspace = true
12+
13+
[dependencies]
14+
bitwarden-api-api = { workspace = true }
15+
bitwarden-core = { workspace = true }
16+
serde = { workspace = true }
17+
serde_json = { workspace = true }
18+
serde_repr = { workspace = true }
19+
uuid = { workspace = true }
20+
21+
[lints]
22+
workspace = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Bitwarden Policies
2+
3+
Contains Admin console owned policy code
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![doc = include_str!("../README.md")]
2+
3+
mod policy;
4+
5+
pub use policy::Policy;

crates/bitwarden-core/src/admin_console/policy.rs renamed to crates/bitwarden-policies/src/policy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use std::collections::HashMap;
22

33
use bitwarden_api_api::models::PolicyResponseModel;
4+
use bitwarden_core::{MissingFieldError, require};
45
use serde::{Deserialize, Serialize};
56
use serde_repr::{Deserialize_repr, Serialize_repr};
67
use uuid::Uuid;
78

8-
use crate::{MissingFieldError, require};
9-
109
/// Represents a policy that can be applied to an organization.
1110
#[derive(Serialize, Deserialize, Debug)]
1211
pub struct Policy {

0 commit comments

Comments
 (0)