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

Encoding trait #142

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Encoding trait #142

wants to merge 8 commits into from

Conversation

MGibson1
Copy link
Member

@MGibson1 MGibson1 commented Feb 4, 2025

📔 Objective

Add encoding trait. This trait will reduce code as more types are convertable to/from EncString. Additionally, this common crate will be useful to define things like type-safe base64 encoded string types, which can then be used to explicitly define API expectations.

⏰ 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

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Logo
Checkmarx One – Scan Summary & Details34936b9c-6976-49f5-8978-7fa73546a5f7

Great job, no security vulnerabilities found in this Pull Request

@MGibson1 MGibson1 marked this pull request as draft February 5, 2025 17:32
MGibson1 and others added 5 commits February 5, 2025 09:32
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.

Project coverage is 65.67%. Comparing base (8d47784) to head (d9b8b39).

Files with missing lines Patch % Lines
crates/bitwarden-common/src/encoding.rs 75.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   65.69%   65.67%   -0.03%     
==========================================
  Files         193      194       +1     
  Lines       14933    14941       +8     
==========================================
+ Hits         9810     9812       +2     
- Misses       5123     5129       +6     

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

@MGibson1 MGibson1 marked this pull request as ready for review February 5, 2025 18:17
@Hinton
Copy link
Member

Hinton commented Feb 6, 2025

Common is a really bad name and tells nothing about what it contains. Can this be a part of crypto or is it more generic than that?

@MGibson1
Copy link
Member Author

@Hinton it's more generic. For this improvement, we could probably move to crypto, but eventually we should create a Base64 struct that explicitly marks a base64 encoded string. The same would be true of any non-utf8 encoded string data. That kind of thing would live in a common crate. However, if we're interested in a many-small-crates model, I could get behind something like bitwarden-encoding 🤷

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