The card names a CodeArts account by its masked phone (138****8000), read from IAM once per account (6h cache), while accountId stays the IAM URN, the account's identity. A renewal keeps the phone, reads it once for an account signed in before 0.2.5, never renames a named account, and gives an account stored without an accountId the URN. Reviewed at fa5aaae (round 4). Run on mote (macOS, Node 22, Bun 1.4.2) in a sandbox HOME, at that head: - node --test packages/codearts/index.test.mjs: 125 pass / 0 fail - bun test packages/codearts/index.test.mjs: 125 pass / 0 fail - bun scripts/check.mjs codearts: ok Broken by hand, each red at the test it should hit: - sign-in accountId: identity.id -> identity.name (index.mjs:2746): "a sign-in names the account by its URN while the card shows the phone" red (124/1). - refresh reads no phone (identified = next): "auth.refresh keeps a named account's identity ..." red (124/1). CI (test, on-npm) green at fa5aaae. Version 0.2.4 -> 0.2.5. Not tried: a real Huawei Cloud account.
35 lines
2.5 KiB
JSON
35 lines
2.5 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-codearts-auth",
|
|
"version": "0.2.5",
|
|
"description": "Huawei Cloud CodeArts (码道) in OpenCode and magpie: its models through Huawei Cloud OAuth sign-in, signed requests, credit usage and the daily check-in (unofficial)",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"exports": "./index.mjs",
|
|
"files": [
|
|
"index.mjs",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"test": "bun test"
|
|
},
|
|
"keywords": [
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"magpie",
|
|
"codearts",
|
|
"huaweicloud",
|
|
"oauth"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/codearts"
|
|
},
|
|
"magpie": {
|
|
"maxConcurrency": 3,
|
|
"icon": "data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjQ0YwQTJDIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj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