Skip to content

Implement SDK generator engines #14654

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

Closed
wants to merge 72 commits into from
Closed

Implement SDK generator engines #14654

wants to merge 72 commits into from

Conversation

adudek-bw
Copy link
Contributor

🎟️ Tracking

📔 Objective

📸 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

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 5.76%. Comparing base (382528d) to head (6a0be69).

❗ There is a different number of reports uploaded between BASE (382528d) and HEAD (6a0be69). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (382528d) HEAD (6a0be69)
2 1
Additional details and impacted files
@@                                        Coverage Diff                                         @@
##           tools/pm-18793/port-credential-generator-service-to-providers   #14654       +/-   ##
==================================================================================================
- Coverage                                                          36.34%    5.76%   -30.59%     
==================================================================================================
  Files                                                               3183       28     -3155     
  Lines                                                              92565     1736    -90829     
  Branches                                                           16676        0    -16676     
==================================================================================================
- Hits                                                               33645      100    -33545     
+ Misses                                                             56491     1636    -54855     
+ Partials                                                            2429        0     -2429     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adudek-bw adudek-bw changed the base branch from main to tools/pm-18793/port-credential-generator-service-to-providers May 6, 2025 17:56
Copy link
Contributor

github-actions bot commented May 6, 2025

Logo
Checkmarx One – Scan Summary & Detailsaf10e35d-bb13-46b4-96dc-ab1d5b6d96c0

Fixed Issues (63)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
CRITICAL CVE-2024-40643 Npm-htmlparser2-3.10.1
CRITICAL CVE-2025-0611 Npm-electron-34.0.0
CRITICAL CVE-2025-3069 Npm-electron-34.0.0
CRITICAL CVE-2025-4052 Npm-electron-34.0.0
CRITICAL CVE-2025-5280 Npm-electron-34.0.0
HIGH CVE-2025-0451 Npm-electron-34.0.0
HIGH CVE-2025-0612 Npm-electron-34.0.0
HIGH CVE-2025-0762 Npm-electron-34.0.0
HIGH CVE-2025-0995 Npm-electron-34.0.0
HIGH CVE-2025-0997 Npm-electron-34.0.0
HIGH CVE-2025-0999 Npm-electron-34.0.0
HIGH CVE-2025-1426 Npm-electron-34.0.0
HIGH CVE-2025-1914 Npm-electron-34.0.0
HIGH CVE-2025-1915 Npm-electron-34.0.0
HIGH CVE-2025-1916 Npm-electron-34.0.0
HIGH CVE-2025-1918 Npm-electron-34.0.0
HIGH CVE-2025-1919 Npm-electron-34.0.0
HIGH CVE-2025-1920 Npm-electron-34.0.0
HIGH CVE-2025-2135 Npm-electron-34.0.0
HIGH CVE-2025-2136 Npm-electron-34.0.0
HIGH CVE-2025-2137 Npm-electron-34.0.0
HIGH CVE-2025-2476 Npm-electron-34.0.0
HIGH CVE-2025-2783 Npm-electron-34.0.0
HIGH CVE-2025-3066 Npm-electron-34.0.0
HIGH CVE-2025-3067 Npm-electron-34.0.0
HIGH CVE-2025-3068 Npm-electron-34.0.0
HIGH CVE-2025-3619 Npm-electron-34.0.0
HIGH CVE-2025-3620 Npm-electron-34.0.0
HIGH CVE-2025-4050 Npm-electron-34.0.0
HIGH CVE-2025-4096 Npm-electron-34.0.0
HIGH CVE-2025-4372 Npm-electron-34.0.0
HIGH CVE-2025-4609 Npm-electron-34.0.0
HIGH CVE-2025-47935 Npm-multer-1.4.5-lts.2
HIGH CVE-2025-47944 Npm-multer-1.4.5-lts.2
HIGH CVE-2025-5063 Npm-electron-34.0.0
HIGH CVE-2025-5283 Npm-electron-34.0.0
HIGH Cxdca8e59f-8bfe Npm-inflight-1.0.6
MEDIUM CVE-2025-0444 Npm-electron-34.0.0
MEDIUM CVE-2025-0445 Npm-electron-34.0.0
MEDIUM CVE-2025-0996 Npm-electron-34.0.0
MEDIUM CVE-2025-1917 Npm-electron-34.0.0
MEDIUM CVE-2025-1921 Npm-electron-34.0.0
MEDIUM CVE-2025-1922 Npm-electron-34.0.0
MEDIUM CVE-2025-1923 Npm-electron-34.0.0
MEDIUM CVE-2025-3070 Npm-electron-34.0.0
MEDIUM CVE-2025-3071 Npm-electron-34.0.0
MEDIUM CVE-2025-3072 Npm-electron-34.0.0
MEDIUM CVE-2025-3073 Npm-electron-34.0.0
MEDIUM CVE-2025-3074 Npm-electron-34.0.0
MEDIUM CVE-2025-4051 Npm-electron-34.0.0
MEDIUM CVE-2025-4664 Npm-electron-34.0.0
MEDIUM CVE-2025-5064 Npm-electron-34.0.0
MEDIUM CVE-2025-5065 Npm-electron-34.0.0
MEDIUM CVE-2025-5066 Npm-electron-34.0.0
MEDIUM CVE-2025-5067 Npm-electron-34.0.0
MEDIUM CVE-2025-5281 Npm-electron-34.0.0
MEDIUM Cxbb85e86c-2fac Npm-esbuild-0.23.0
MEDIUM Cxbb85e86c-2fac Npm-esbuild-wasm-0.23.0
MEDIUM Cxbb85e86c-2fac Npm-esbuild-0.21.5
LOW CVE-2024-6531 Npm-bootstrap-4.6.0
LOW Cx8bc4df28-fcf5 Npm-debug-2.6.9
LOW Cx8bc4df28-fcf5 Npm-debug-3.2.7
LOW Cxda14f253-4e52 Npm-bluebird-3.7.2

return new GeneratedCredential(
password,
"password",
Date.now(),
Copy link
Member

Choose a reason for hiding this comment

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

⛏️ This should use an injected date method; it shouldn't call Date.now() directly.


return new GeneratedCredential(
password,
"password",
Copy link
Member

Choose a reason for hiding this comment

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

⛏️ This should be Type.password, not a hard-coded string.


return new GeneratedCredential(
passphrase,
"password",
Copy link
Member

Choose a reason for hiding this comment

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

⛏️ This should be Type.password, not a hard-coded string.

Comment on lines 11 to 16
/** A password composed of random characters, retrieved from SDK */
sdkPassword: "sdkpassword",

/** A password composed of random words from the EFF word list, retrieved from SDK */
sdkPassphrase: "sdkpassphrase",

Copy link
Member

Choose a reason for hiding this comment

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

⛏️ Make sure the casing is consistent between the name and value

Comment on lines 221 to 225
getGeneratorDependencies(sdk: BitwardenClient): GeneratorDependencyProvider {
const provider = this.provide.generator;
provider.sdk = sdk;
return provider;
}
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ This is incorrect. this.provide.generator is a dependency that may be shared across generator instances. Assigning sdk to it makes the SDK instance visible across all providers.

🎨 It's likely that you'll need to change CredentialGeneratorProviders so that it uses a method to create a specialized GeneratorDependencyProvider with the SDK instance.

Think broadly about how that design might work. Something that produces an observable dependency you can inject on line 114 is probably best.

Base automatically changed from tools/pm-18793/port-credential-generator-service-to-providers to main May 27, 2025 13:51
Copy link

@adudek-bw
Copy link
Contributor Author

Closing and switching over to #15063

@adudek-bw adudek-bw closed this Jun 3, 2025
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.

3 participants