mirror of
https://github.com/certd/certd.git
synced 2026-06-26 21:43:27 +08:00
4755216505
refactor(ui): 将分散的auto-*模块整合为统一命名的auto-register模块 perf(plugin-cert): 增强EAB授权功能,支持账号私钥刷新和类型选择 test: 添加EAB授权服务和ACME账号配置的单元测试 docs: 更新AGENTS.md补充ACME/EAB使用注意事项 chore: 统一各package.json中的测试脚本配置
31 lines
743 B
TypeScript
31 lines
743 B
TypeScript
import assert from "assert";
|
|
import { AccessService } from "./access-service.js";
|
|
|
|
describe("AccessService", () => {
|
|
it("does not write id into access setting when updating selected fields", async () => {
|
|
let updateParam: any;
|
|
const service = new AccessService();
|
|
service.info = async () => ({
|
|
id: 12,
|
|
type: "eab",
|
|
} as any);
|
|
service.decryptAccessEntity = () => ({
|
|
kid: "kid-1",
|
|
});
|
|
service.update = async (param: any) => {
|
|
updateParam = param;
|
|
return param;
|
|
};
|
|
|
|
await service.updateAccess({
|
|
id: 12,
|
|
accountKey: "account-key",
|
|
});
|
|
|
|
assert.deepEqual(JSON.parse(updateParam.setting), {
|
|
kid: "kid-1",
|
|
accountKey: "account-key",
|
|
});
|
|
});
|
|
});
|