You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e8422d9
Browse filesBrowse the repository at this point in the historyBrowse files
feat(spec): `alipay-v3` joins the `signed` connector-instance auth schemes, with response verification (ADR-0143 D2.3, #26710)
7
+
8
+
Clause-②: yes (widening)
9
+
Metadata-protocol: added
10
+
11
+
<!-- adr-0087: not-required (no-migration-prescription) One member is added to the closed signing-scheme list and one shape to the `signed` union. The signer registry's third parameter changes from the key string to an object carrying the key and an optional vendor public key; that function is internal to the automation service and in no release yet (it ships with the pending `26710-signed-connector-auth-aliyun` changeset). Nothing an author wrote before is refused or re-shaped, so there is nothing for a migration to rewrite. -->
12
+
13
+
A declarative connector instance can now declare Alipay's OpenAPI v3 signature as its signing scheme. Its responses are verified too. It joins the Alibaba Cloud and Tencent Cloud schemes.
- The `signed` union gains its closed shape: `{ type: 'signed', scheme: 'alipay-v3', keyId, credentialRef, vendorPublicKeyRef }`.
18
+
-`keyId` is the app id.
19
+
-`credentialRef` names the application private key.
20
+
-`vendorPublicKeyRef` names the Alipay public key that every response is verified with. It is required.
21
+
- The same publish refusals apply as for the other schemes: inline key spellings by name, an authored `signature`, and `signed` on `provider: 'mcp'`. Also refused:
22
+
-`appPrivateKey`, by name;
23
+
-`alipayPublicKey`, which is answered with `vendorPublicKeyRef`.
24
+
25
+
`appId` is answered with `keyId`. An unknown scheme's refusal now lists all three schemes.
26
+
-**`@objectstack/service-automation`**
27
+
- Every request is signed `ALIPAY-SHA256withRSA` with a fresh nonce and timestamp.
28
+
- Every response below status 400 must carry a valid Alipay signature, an empty body included. A signed error response is verified too. A response that fails either check fails the dispatch, and its body is never returned.
29
+
- The vendor public key resolves through the same chain as `credentialRef`. An instance whose public key is missing is degraded with that reference named. The credential door lists both references against the instance.
30
+
- A key that is not an RSA key fails boot, naming which reference, never the value.
keyId: '2021000000000000', // the app id: public, stays in metadata
513
+
credentialRef: 'ALIPAY_APP_PRIVATE_KEY', // the application private key (RSA)
514
+
vendorPublicKeyRef: 'ALIPAY_PUBLIC_KEY', // the Alipay public key responses are verified with
515
+
}
505
516
```
506
517
518
+
Both of an `alipay-v3` instance's references are listed against it by the
519
+
credential door, and setting or replacing either one re-materializes it. The
520
+
keys are accepted as Alipay's console issues them (the bare base64 body) or as
521
+
PEM.
522
+
507
523
What the platform does with it:
508
524
509
525
-**Every request is signed, each attempt fresh.** A retry is signed again with
@@ -515,7 +531,8 @@ What the platform does with it:
515
531
(`external.connector` is refused with `422`): a driver cannot sign per
516
532
request.
517
533
-**Schemes that sign their responses are verified** before a result is
518
-
returned; a response that does not verify fails the dispatch.
534
+
returned; a response that does not verify fails the dispatch, and its body
535
+
never reaches the flow.
519
536
-**`aliyun-acs3-hmac-sha256`** signs `host`, `content-type` and every
520
537
`x-acs-*` header, and sets `x-acs-date`, `x-acs-signature-nonce`,
521
538
`x-acs-content-sha256` and `Authorization`. The API's own action and version
@@ -526,9 +543,16 @@ What the platform does with it:
526
543
the first label of the endpoint host (`cvm.tencentcloudapi.com`, or a
527
544
regional `cvm.ap-guangzhou.tencentcloudapi.com`, is `cvm`), so point
528
545
`baseUrl` at the product's own endpoint. `X-TC-Action`, `X-TC-Version` and
529
-
`X-TC-Region` are yours to send and are not signed. A request without a body
530
-
is sent with `Content-Type: application/x-www-form-urlencoded`, the type it
531
-
is signed with.
546
+
`X-TC-Region` are yours to send and are not signed. A request without a
547
+
content type is sent with `Content-Type: application/x-www-form-urlencoded`,
548
+
the type it is signed with.
549
+
-**`alipay-v3`** signs the method, the path and query as sent and the body,
550
+
with a fresh nonce and millisecond timestamp, and sets `Authorization:
551
+
ALIPAY-SHA256withRSA app_id=…,nonce=…,timestamp=…,sign=…`. Every response
552
+
below status 400 must carry a valid `alipay-signature` (an empty body too),
553
+
checked against the key `vendorPublicKeyRef` names; an error response is
554
+
verified when it is signed, and an unsigned one fails as the error it is.
555
+
Public-key mode only: Alipay's certificate mode is not supported.
532
556
533
557
What the publish door refuses:
534
558
@@ -537,9 +561,11 @@ What the publish door refuses:
537
561
signer and its test vectors, so a scheme the server cannot run is never
538
562
accepted.
539
563
-**An inline key**: `secret`, `privateKey`, `secretKey` or `accessKeySecret`
540
-
is refused by name, pointing at `credentialRef`. The vendors' words for the
541
-
key id (`accessKeyId`, `secretId`) are answered with `keyId`. An authored `signature` is
542
-
refused too: it is computed for every request.
564
+
is refused by name, pointing at `credentialRef` (on `alipay-v3`,
565
+
`appPrivateKey` too, and `alipayPublicKey` points at `vendorPublicKeyRef`).
566
+
The vendors' words for the key id (`accessKeyId`, `secretId`, `appId`) are
567
+
answered with `keyId`. An authored `signature` is refused too: it is computed
568
+
for every request.
543
569
-**`provider: 'mcp'`**, at `auth.type`: an MCP server is not signed per
544
570
request. Declare `provider: 'rest'` or `provider: 'openapi'`.
545
571
@@ -601,7 +627,9 @@ retry):
601
627
| Invalid `providerConfig` (missing `baseUrl` / `spec` / `transport`, wrong shape) |**Hard boot error** from the provider factory |
602
628
|`auth` is a grant-bearing kind (`oauth2`, `app-credential`) on a server that does not yet run its per-dispatch resolution |**Not fatal**: the instance registers **degraded**, naming the kind, and the upstream is never called without its credential; a datasource borrowing it is refused with `422`|
603
629
|`auth` is `signed` on a provider that does not say it applies the request signer |**Hard boot error** naming the instance, the scheme and the provider: its calls would go out unsigned — declare it through `rest` or `openapi`|
604
-
|`credentialRef` resolves to nothing |**Not fatal**: the instance registers **degraded**, naming the reference — set it (`PUT …/credential-refs/:ref`), and it materializes without a restart |
630
+
|`credentialRef` (or a `signed` instance's `vendorPublicKeyRef`) resolves to nothing |**Not fatal**: the instance registers **degraded**, naming the reference — set it (`PUT …/credential-refs/:ref`), and it materializes without a restart |
631
+
| A `signed` reference resolves to something that is not a key of the scheme's kind (an `alipay-v3` key that is not RSA) |**Hard boot error** naming the instance and which reference cannot sign or verify, never the value |
632
+
| A response to an `alipay-v3` call is unsigned (below status 400) or its signature does not verify | The dispatch **fails** naming the instance and the status; the response's body is never returned |
605
633
| The upstream refuses the credential (`401` / `403`) |**Not fatal**: the instance registers **degraded**. A stored credential is marked `rejected` and waits until it is set again (or a restart); an environment or vault credential is retried on the backoff |
606
634
| Instance `name` collides with a plugin-registered connector |**Hard boot error** — there is no silent precedence between the two worlds |
607
635
| stdio transport without host opt-in |**Hard boot error** with the `declarativeStdio` fix inline — a security rejection is never retried |
0 commit comments