Marks Zen Free's api method keyless and its auth single, so magpie's host (yetone/magpie#2695, 5871f02dd) signs it in with no key field and Sign in again instead of another account. authorize is unchanged; older hosts and OpenCode keep the public-key flow. Run at the PR head 29f0e9b38: bun test in packages/zen-free under a sandbox HOME, 175 pass, 0 fail. Checked against magpie main: host.js reads m.keyless (api method with authorize) and auth.single, the two fields this sets. Co-authored-by: LoKi <317300729+lokic7123-star@users.noreply.github.com>
11 lines
568 B
JavaScript
11 lines
568 B
JavaScript
import {test,expect} from "bun:test"
|
|
import {ZenFreePlugin} from "./index.mjs"
|
|
|
|
test("Zen Free declares one keyless public identity without changing authorize",async()=>{
|
|
const hooks=await ZenFreePlugin({client:{auth:{set:async()=>{throw Error("unexpected auth write")}}}})
|
|
expect(hooks.auth.single).toBe(true)
|
|
expect(hooks.auth.methods[0].keyless).toBe(true)
|
|
expect(await hooks.auth.methods[0].authorize({})).toEqual({type:"success",key:"public"})
|
|
expect(await hooks.auth.methods[0].authorize({key:"personal-fixture"})).toEqual({type:"success",key:"public"})
|
|
})
|