@harperdb/acl-connect

中文文档
1.0.10发布于 2026/04/30Apache-2.0ES Module零依赖近 30 天下载 1.4万

A component for defining pub/sub (MQTT) topics and their access control lists (ACLs) in HarperDB

此软件包已被标记为弃用

Migrated to @harperfast/acl-connect

原始使用文档

HarperDB ACL-Connect

This component allows you define a set of topics for pub/sub (MQTT) with ACLs specifying permissions.

To use this, add @harperdb/acl-connect to your projects dependencies and then add this extension to your application's config.yaml:

acl-connect:
  package: "@harperdb/acl-connect"
  database: data # The database to use for pub/sub
  file: connect.json

And connect.json should be a JSON file with the following format:

{
  "acls": [
    {
      "topicFilter": "topic/sub-topic/#",
      "publishers": [
        "a-group",
        "another-group"
      ],
      "subscribers": [
        "another-group"
      ]
    },
    ...
  ]
}

Topics support substitution with %u for the user's username and %c for the client id. For example, a topic of user/%u would be translated to user/smith for a user with the username smith.

Anonymous Subscriptions

In order for anonymous subscriptions to work correctly:

requireAuthentication must be set to false in your harper config. For example:

# In harperdb-config.yaml
mqtt:
    requireAuthentication: false

版本与发布记录

@harperdb/acl-connect 共发布 11 个版本,首次发布于 2024/06/04;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.0.10latest2026/04/306 个月前
1.0.92025/09/121.2 年前
1.0.82025/03/251.6 年前
1.0.72025/03/251.6 年前
1.0.62025/03/221.7 年前
1.0.52024/11/152 年前

关于 @harperdb/acl-connect 的常见问题

@harperdb/acl-connect 是什么?

A component for defining pub/sub (MQTT) topics and their access control lists (ACLs) in HarperDB注意:该包已被作者标记为弃用——Migrated to @harperfast/acl-connect

如何安装 @harperdb/acl-connect?

在项目目录运行 npm install @harperdb/acl-connect,或使用 pnpm add / yarn add / bun add。

@harperdb/acl-connect 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/harperdb__acl-connect 是否存在。

@harperdb/acl-connect 支持 ESM 还是 CommonJS?

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

@harperdb/acl-connect 可以商用吗?

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

@harperdb/acl-connect 的下载量有多少?

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

@harperdb/acl-connect 还在维护吗?

最新版本 1.0.10 发布于 2026/04/30(6 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 1 个;首次发布于 2024/06/04。作者已将其标记为弃用,新项目建议寻找替代方案。