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-16789] introduce extension metadata #12717

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

Conversation

audreyality
Copy link
Member

@audreyality audreyality commented Jan 6, 2025

๐ŸŽŸ๏ธ Tracking

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

๐Ÿ“” Objective

Refactor integration logic (@bitwarden/common/tools/integration) to improve code clarity and make extensions easier to comprehend.

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 3 files:

  • extension/data.ts - these are enum-alike data structures used to derive and conveniently access type information
  • extension/type.ts - root data structures used to identify extensions and interact with extension data
  • extension/metadata.ts - data derived from extension/data.ts that reifies the relationships among core data types.

Domain metadata then build on top of this:

  • Site metadata - denotes a location open for extension.
  • Vendor metadata - denotes the vendors that extend the password manager
    • Includes all forwarder vendors. At present this is hard-coded.
    • Also includes a "Bitwarden" vendor for use in test cases.
  • Extension metadata - denotes an extension made by a vendor to a site.

There are two data-driven systems that manage the domain metadata:

  • Extension registry - tracks the extensions that are live at any given moment
    • The extension must be registered. At present this is hard-coded.
    • The extension must not be prohibited by a rule. This is not presently in use.
  • Extension site - runtime representation of the set of extensions available at a given site.

And there's an (unimplemented) service that exposes the extension sites to the systems they extend.

๐Ÿฆฎ 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 6, 2025 21:16
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 114f9ed0-de23-4eca-8967-0dd00d0b1e4c

No New Or Fixed Issues Found

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