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-18496: Propagate prevalidateSso API error message #4759

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

david-livefront
Copy link
Collaborator

@david-livefront david-livefront commented Feb 20, 2025

🎟️ Tracking

PM-18496

📔 Objective

This PR propagates the the API error from the prevalidateSso API to the UI layer.

📸 Screenshots

Before After

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Logo
Checkmarx One – Scan Summary & Details2cf7e120-ead9-404f-8302-f119b3763534

Great job, no security vulnerabilities found in this Pull Request

@david-livefront david-livefront force-pushed the PM-18496-propagate-pre-auth-error branch from 9352e95 to c89a7c4 Compare February 20, 2025 23:09
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.29%. Comparing base (1349165) to head (c89a7c4).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4759      +/-   ##
==========================================
- Coverage   89.33%   89.29%   -0.04%     
==========================================
  Files         490      492       +2     
  Lines       41455    41644     +189     
  Branches     5897     5919      +22     
==========================================
+ Hits        37032    37186     +154     
- Misses       2388     2411      +23     
- Partials     2035     2047      +12     

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

message = R.string.organization_sso_identifier_required.asText(),
),
orgIdentifierInput = authRepository.rememberedOrgIdentifier ?: "",
orgIdentifierInput = authRepository.rememberedOrgIdentifier.orEmpty(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

val bitwardenError = throwable.toBitwardenError()
bitwardenError
.parseErrorBodyOrNull<PrevalidateSsoResponseJson.Error>(
code = 400,
Copy link
Collaborator

Choose a reason for hiding this comment

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

💭 Def not a blocker just a thought, would it make sense to represent the code as constants or even like an enum. Only benefit would be removing the magic number suppression. The counter point is the HTTP error codes for 4XX/5XX are pretty standard really.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about making a bunch of constants for it but an enum could work as well

Copy link
Collaborator

@dseverns-livefront dseverns-livefront left a comment

Choose a reason for hiding this comment

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

@david-livefront
Copy link
Collaborator Author

Thanks @dseverns-livefront

@david-livefront david-livefront merged commit 80bd1bf into main Feb 21, 2025
9 checks passed
@david-livefront david-livefront deleted the PM-18496-propagate-pre-auth-error branch February 21, 2025 14:34
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