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

[PM-5718] Fix free organization generating TOTP #11918

Merged
merged 11 commits into from
Jan 13, 2025

Conversation

shane-melton
Copy link
Member

@shane-melton shane-melton commented Nov 8, 2024

🎟️ Tracking

PM-5718

📔 Objective

The add-edit component in the individual vault would not have an organization set and would fall back to the user's premium status instead of the organization that owned the cipher, which would allow free org ciphers to generate totps codes.

Fixed by updating the showTotp condition to check only consider the user premium status if it is not owned by an organization; otherwise, rely on the value of organizationUseTotp flag on the cipher view.

Applies the same logic to the refreshed CipherView component as well.

⏰ 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

@shane-melton shane-melton requested a review from a team as a code owner November 8, 2024 01:05
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 34.14%. Comparing base (c1e3836) to head (c29c559).
Report is 29 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ibs/angular/src/vault/components/view.component.ts 0.00% 5 Missing ⚠️
apps/desktop/src/app/app.component.ts 0.00% 4 Missing ⚠️
...in-credentials/login-credentials-view.component.ts 75.00% 2 Missing ⚠️
apps/desktop/src/vault/app/vault/view.component.ts 0.00% 1 Missing ⚠️
...c/app/vault/individual-vault/add-edit.component.ts 0.00% 0 Missing and 1 partial ⚠️
...angular/src/vault/components/add-edit.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11918   +/-   ##
=======================================
  Coverage   34.13%   34.14%           
=======================================
  Files        2936     2936           
  Lines       90428    90446   +18     
  Branches    16988    16992    +4     
=======================================
+ Hits        30869    30880   +11     
- Misses      57102    57109    +7     
  Partials     2457     2457           

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

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Logo
Checkmarx One – Scan Summary & Details06c5b365-8f5c-4485-b2e1-50380c5b7820

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/cli/src/commands/get.command.ts: 162 Attack Vector
MEDIUM Client_Privacy_Violation /apps/cli/src/vault/models/cipher.response.ts: 34 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /apps/cli/src/commands/get.command.ts: 331

Jingo88
Jingo88 previously approved these changes Nov 11, 2024
@github-actions github-actions bot temporarily deployed to Web Vault - US QA Cloud November 14, 2024 15:39 Inactive
@github-actions github-actions bot temporarily deployed to Web Vault - US QA Cloud November 14, 2024 18:02 Inactive
@gbubemismith gbubemismith requested a review from Jingo88 January 10, 2025 20:30
nick-livefront
nick-livefront previously approved these changes Jan 10, 2025
Copy link
Collaborator

@nick-livefront nick-livefront left a comment

Choose a reason for hiding this comment

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

I am not seeing TOTP codes within a free organization on the web vault or desktop for a premium user.

Screen.Recording.2025-01-10.at.2.51.29.PM.mov

Comment on lines +80 to +81
// User premium status only applies to personal ciphers, organizationUseTotp applies to organization ciphers
return (userHasPremium && cipher.organizationId == null) || cipher.organizationUseTotp;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 Helpful comment

nick-livefront
nick-livefront previously approved these changes Jan 10, 2025
@gbubemismith gbubemismith merged commit 459fb1b into main Jan 13, 2025
89 checks passed
@gbubemismith gbubemismith deleted the vault/pm-5718/free-org-totp-generation-fix branch January 13, 2025 17:58
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.

5 participants