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-13763 Move ResetPasswordEnrolled to response model #4983

Merged

Conversation

JimmyVo16
Copy link
Contributor

@JimmyVo16 JimmyVo16 commented Nov 6, 2024

Move ResetPasswordEnrolled to the response model to adhere to the Liskov Substitution Principle. Ensures request models inherit only relevant properties.

🎟️ Tracking

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

📔 Objective

  1. Move the ResetPasswordEnrolled property to the response model, as that’s the only class that uses it.
  2. Make it read-only, as it’s not updated after initialization.

⏰ 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

…skov Substitution Principle. Ensures request models inherit only relevant properties.
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.53%. Comparing base (e6c24c3) to head (1329a1d).
Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4983      +/-   ##
==========================================
- Coverage   42.54%   42.53%   -0.02%     
==========================================
  Files        1389     1391       +2     
  Lines       64745    64824      +79     
  Branches     5943     5950       +7     
==========================================
+ Hits        27548    27571      +23     
- Misses      35975    36028      +53     
- Partials     1222     1225       +3     

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

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Logo
Checkmarx One – Scan Summary & Details39b5d9f3-7937-47ff-b808-49bd6d4b5dba

New Issues

Severity Issue Source File / Package Checkmarx Insight
HIGH Passwords And Secrets - Generic Password /test-database.yml: 104 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 184 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 181 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 79 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 91 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 68 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 110 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /test-database.yml: 188 Query to find passwords and secrets in infrastructure code.
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 603 Attack Vector
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 603 Attack Vector
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 581 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 111 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 104 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 547 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 119 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 206 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 514 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 630 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 60 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 60 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 119 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 111 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 581 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 630 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 104 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 514 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 206 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 547 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity Issue Source File / Package
HIGH Passwords And Secrets - Generic Password /test-database.yml: 121
HIGH Passwords And Secrets - Generic Password /test-database.yml: 103
HIGH Passwords And Secrets - Generic Password /test-database.yml: 225
HIGH Passwords And Secrets - Generic Password /test-database.yml: 140
HIGH Passwords And Secrets - Generic Password /test-database.yml: 92
HIGH Passwords And Secrets - Generic Password /test-database.yml: 76
HIGH Passwords And Secrets - Generic Password /test-database.yml: 221
HIGH Passwords And Secrets - Generic Password /test-database.yml: 134
HIGH Passwords And Secrets - Generic Password /test-database.yml: 218
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 218
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 597
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 530
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 563
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 646
LOW Unpinned Actions Full Length Commit SHA /build.yml: 563
LOW Unpinned Actions Full Length Commit SHA /build.yml: 646
LOW Unpinned Actions Full Length Commit SHA /build.yml: 218
LOW Unpinned Actions Full Length Commit SHA /build.yml: 597
LOW Unpinned Actions Full Length Commit SHA /build.yml: 530

public class MemberResponseModelTests
{
[Fact]
public void ResetPasswordEnrolled_ShouldBeTrue_WhenUserHasResetPasswordKey()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following patterns that I’ve seen in the codebase. If anything doesn’t meet standards, please feel free to leave comments, documentation, or suggestions. I’m happy to receive feedback and learn! 😄

@JimmyVo16 JimmyVo16 changed the title PM-13763 Move ResetPasswordEnrolled to response model to adhere to Li… PM-13763 Move ResetPasswordEnrolled to response model Nov 7, 2024
@JimmyVo16 JimmyVo16 marked this pull request as ready for review November 7, 2024 19:19
@JimmyVo16 JimmyVo16 requested a review from a team as a code owner November 7, 2024 19:20
@JimmyVo16 JimmyVo16 requested a review from BTreston November 7, 2024 19:20
@JimmyVo16 JimmyVo16 merged commit aa3d716 into main Nov 8, 2024
52 checks passed
@JimmyVo16 JimmyVo16 deleted the PM-13763-move-ResetPasswordEnrolled-to-response-model branch November 8, 2024 20:02
cyprain-okeke pushed a commit that referenced this pull request Nov 12, 2024
to adhere to Liskov Substitution Principle. Ensures request models inherit only relevant properties.
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
to adhere to Liskov Substitution Principle. Ensures request models inherit only relevant properties.
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
to adhere to Liskov Substitution Principle. Ensures request models inherit only relevant properties.
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