Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an endpoint to get policy status #5049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyprain-okeke
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13347

📔 Objective

When the Remove Bitwarden Families policy is on, the product will follow the following behaviors depending on the # of organizations the user is part of.

Individual vault impacts - Scenario 1

Given the users email address is only associated with 1 enterprise organization, when the policy is turned on, then hide the Free Bitwarden Families page from the navigation

Individual vault impacts - Scenario 2

Given the email address is associated with multiple enterprise organization, the policy is turned on, and my sponsorship is status is active, when the user attempts to interact with the three dot menu, then the only option is to remove the sponsorship

Individual vault impacts - Scenario 3

Given the email address is associated with multiple enterprise organization, the policy is turned on, and my sponsorship is status is sent, when the user attempts to interact with the three dot menu, then the only option is to remove the sponsorship and we hide the Resend email option

📸 Screenshots

⏰ 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

  • 👍 (:+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

@cyprain-okeke cyprain-okeke requested a review from a team as a code owner November 19, 2024 19:02
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 43.05%. Comparing base (5166085) to head (1fa38b6).

Files with missing lines Patch % Lines
...Api/AdminConsole/Controllers/PoliciesController.cs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5049      +/-   ##
==========================================
- Coverage   43.06%   43.05%   -0.01%     
==========================================
  Files        1412     1412              
  Lines       64775    64784       +9     
  Branches     5920     5922       +2     
==========================================
  Hits        27894    27894              
- Misses      35649    35658       +9     
  Partials     1232     1232              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details857351d4-4770-4918-b0bc-6341996f2450

No New Or Fixed Issues Found

Copy link
Contributor

@r-tome r-tome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, can you please add unit tests?

@@ -85,6 +85,23 @@ public async Task<PolicyDetailResponseModel> Get(Guid orgId, int type)
return new PolicyDetailResponseModel(policy);
}

[HttpGet("{type}/policy-status")]
public async Task<bool> GetPolicyStatusAsync(Guid orgId, int type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use PolicyType type directly?

Suggested change
public async Task<bool> GetPolicyStatusAsync(Guid orgId, int type)
public async Task<bool> GetPolicyStatusAsync(Guid orgId, PolicyType type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants