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-16788] revise generator metadata #12757

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

Conversation

audreyality
Copy link
Member

@audreyality audreyality commented Jan 8, 2025

๐ŸŽŸ๏ธ Tracking

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

๐Ÿ“” Objective

Refactor generator metadata (data and type folders in @bitwarden/generator-core) to improve code clarity and make the dependencies easier to follow.

Note: this logic is part of a larger work and split out for more efficient review. The logic that cuts over from the existing code to the new code will land at the end of these PRs.

๐Ÿฆ– System Evolution

The refactoring builds from "core" logic up to "domain" logic.

The core logic resides in several files:

  • metadata/data.ts - these are enum-alike data structures used to derive and conveniently access type information
  • metadata/type.ts - root data structures used to identify extensions and interact with extension data

Domain metadata then build on top of this:

  • Algorithm metadata - describes algorithms and capabilities
  • Profile metadata - describes a use-case for the generator
    • At present all generators share the "account" profile.
    • This was introduced to enable a secondary profile for master password generation.
    • Profiles also enable settings to be provided by the generator ("core") or to be delegated to a secondary system. The first use-case enables the extension system to provide settings (future PR). It could also be used to create collection-bound or autofill-provided profiles.
  • Generator metadata - combines algorithm metadata, profile metadata, and engine creation logic for use by the credential generator service.

At present there isn't a system managing this data; it's all hard-coded in email,
password, and username subfolders. Management systems will be introduced in a
followup PR.

๐Ÿฆฎ 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

@audreyality audreyality requested a review from a team as a code owner January 8, 2025 17:11

This comment was marked as resolved.

This comment was marked as resolved.

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.

1 participant