Skip to content

Refactor/shared edition foundation - #6

Open
asimawdah wants to merge 16 commits into
OpenSelfHosting:mainfrom
asimawdah:refactor/shared-edition-foundation
Open

asimawdah wants to merge 16 commits into
OpenSelfHosting:mainfrom
asimawdah:refactor/shared-edition-foundation

Conversation

@asimawdah

@asimawdah asimawdah commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR establishes the shared-package boundary and extracts reusable implementation used by both OpenKey editions.

  • Add packages/openkey_shared as the shared Flutter package.
  • Keep the FeatureAccess abstraction and edition capability identifiers in the package.
  • Move the generic Either<L, R>, Left, and Right result types into the package.
  • Move the existing password-strength scoring and weak-password heuristic into the package.
  • Move the dependency-light vault entry domain model into the package:
    • VaultEntry
    • TotpConfig
    • AttachmentMeta
    • PasskeyPayload
    • EntryExtraField
  • Add unit tests for the shared primitives and vault-entry payload compatibility.
  • Wire the open-source OpenKey app to the package through a local path dependency.
  • Preserve existing app-local imports as thin re-exports for compatibility.
  • Keep Flutter CI strict on warnings/errors without failing on informational lint notes alone.

Commercial app integration

The private commercial app is being connected through OpenKey_app PR #24. It consumes this package through a Git dependency pinned to the exact commit produced by this PR, rather than a floating branch.

The private app retains its subscription, purchase, restore, paywall, and Pro-only product code. Those billing integrations do not belong in the shared package.

Compatibility and security

The vault-entry model was identical in both repositories before extraction. Its payload field names, omission rules, defaults, nested TOTP/attachment/passkey serialization, and parsing behavior are covered by package tests.

This extraction does not change encryption algorithms, key-derivation parameters, ciphertext formats, Drift schemas or migrations, secure-storage key names, database paths, backup formats, or server synchronization protocols.

Existing import paths remain as compatibility exports, so this extraction does not require a broad application refactor in this step.

Next stages

Continue with other domain models and pure-Dart logic, then persistence/repositories, followed by crypto/auth/sync services. Each stage must include regression tests against existing user data and formats before duplicate implementations are removed.

Validation

  • Added direct package tests for Either, password strength, and vault-entry payload round-trips / legacy defaults.
  • Existing application import paths are retained through compatibility exports.
  • Shared-package CI runs analysis and tests in the package directory.
  • Full app CI remains responsible for checking app integration.

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