@absolutejs/e2ee

中文文档
0.8.0发布于 2026/08/27Apache-2.0TypeScriptES Module近 30 天下载 3112

Provider-neutral E2EE contracts, security modes, assurance manifests, and conformance tools for AbsoluteJS.

原始使用文档
文档目录6 节
  1. Install
  2. Select a provider explicitly
  3. Explicit modes
  4. Scope
  5. Version-bound certification
  6. License

@absolutejs/e2ee

Provider-neutral E2EE contracts, explicit security modes, assurance manifests, provider selection, and conformance tools for AbsoluteJS.

This package is the stable seam between applications and implementations in the e2ee-providers repository. It does not invent cryptography, silently select a provider, or claim that unlike providers have equivalent security.

This is an early 0.x release. The core package does not itself encrypt data, and no provider is production-approved until its published assurance and audit gates pass.

Install

bun add @absolutejs/e2ee

Select a provider explicitly

import { selectE2EEProvider } from "@absolutejs/e2ee";

const selected = selectE2EEProvider(providers, {
  minimumAssurance: "reviewed",
  operatorCanDecrypt: false,
  protocols: ["MLS-1.0"],
  roles: ["messaging"],
  runtime: "browser",
  securityMode: "strict-e2ee",
});

console.log(selected.manifest.packageName);

Selection fails closed and explains why each provider was rejected. Applications may pin a provider ID when they need deterministic deployment rather than accepting the highest compatible assurance level.

Explicit modes

  • strict-e2ee: only verified participant devices can decrypt conversation history. Losing all verified devices and exports may permanently lose history.
  • managed-recovery: a visibly identified recovery authority may authorize a new verified device to replace lost device leaves. It is never enabled silently, and the authority does not receive serialized live MLS state through this API.

Sensitive agent exchange additionally declares whether a value is tool-confined, endpoint-visible, or model-visible. tool-confined is the recommended default.

Scope

The 0.2.x line adds the application boundaries required around an MLS engine: device credentials, KeyPackages, membership changes, delivery, durable compare-and-set state, and an explicit recovery authority. These are contracts, not hosted services. Implementations remain in provider packages.

MLS deliberately does not define an application's Authentication Service or Delivery Service. AbsoluteJS keeps those dependencies visible so a cryptographic engine cannot silently become the identity authority, transport, or recovery authority. Strict E2EE never receives a RecoveryAuthority; managed recovery must identify and configure a RecoveryGrantVerifier explicitly. Recovery after state loss follows RFC 9750's rejoin-and-remove model: bind a short-lived grant to the replacement credential, add it, and remove the lost leaves in one commit.

Changing modes is not a session mutation. Call planSecurityModeTransition(), create a new conversation in the requested mode, re-add verified devices, and visibly retire the prior conversation. New conversations begin with their creator only; add every other device through addMembers() so its Welcome message cannot be accidentally discarded. Joining a Welcome requires expectedSecurityMode, and the returned session exposes the mode authenticated by provider state. Callers must reject any strict/managed mismatch instead of trusting delivery metadata.

Public TypeScript contracts use type aliases rather than interfaces so unions, intersections, and provider capability composition stay explicit.

See SECURITY.md before relying on this package for protected data.

Version-bound certification

Provider capability claims and provider certification are separate. A certification report binds the provider ID, package name, exact package version, runtime, suite, scenarios, implementation identities, vector sources, and an evidence digest. checkE2EECertification() rejects stale reports, reports for another release or runtime, and missing policy claims.

An independent-audit claim additionally requires an HTTPS report and SHA-256 digest, an exact package/version scope, an auditor identity, a future validity date, and zero unresolved critical or high findings. Deployments can set trustedAuditorIds; the library does not pretend that a provider's self-declaration proves reviewer independence. Any provider release or scoped engine change requires new audit evidence.

The claims deliberately distinguish shared conformance, known-answer vectors, and cross-implementation testing. Passing the MLS Working Group vectors does not by itself prove application interoperability: RFC 9750 leaves Authentication Service, Delivery Service, identity, and application framing choices to deployments.

License

Apache-2.0

版本与发布记录

@absolutejs/e2ee 共发布 8 个版本,首次发布于 2026/08/26;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.8.0latest2026/08/272 个月前
0.7.02026/08/272 个月前
0.6.02026/08/272 个月前
0.5.02026/08/272 个月前
0.4.02026/08/272 个月前
0.3.02026/08/272 个月前

关于 @absolutejs/e2ee 的常见问题

@absolutejs/e2ee 是什么?

Provider-neutral E2EE contracts, security modes, assurance manifests, and conformance tools for AbsoluteJS.

如何安装 @absolutejs/e2ee?

在项目目录运行 npm install @absolutejs/e2ee,或使用 pnpm add / yarn add / bun add。

@absolutejs/e2ee 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@absolutejs/e2ee 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@absolutejs/e2ee 可以商用吗?

@absolutejs/e2ee 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@absolutejs/e2ee 的下载量有多少?

根据 npm 官方下载统计,@absolutejs/e2ee 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,112 次,日均约 104 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@absolutejs/e2ee 还在维护吗?

最新版本 0.8.0 发布于 2026/08/27(2 个月前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/08/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。