Skip to content

Commit 11d2d74

Browse files
committed
wip(spec): changesets and upgrade-guide entries for the connector entry narrowings
Claude-Session: https://claude.ai/code/session_01Q4EjjP1K353tLKWRMajLsE Co-authored-by: Claude <noreply@anthropic.com>
1 parent c0dac17 commit 11d2d74

4 files changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec)!: an authored connector entry refuses a key `retryConfig` or an `actions` element does not declare
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: narrowed
9+
10+
<!-- adr-0087: registered connector-entry-nested-undeclared-key-refused -->
11+
12+
**BREAKING** accept-set narrowing on an authored connector entry (`DeclarativeConnectorEntrySchema`), at every door that parses it: `defineConnector()`, `defineStack({ connectors })`, `os validate` / `os compile`, the metadata plugin's artifact load at boot and on reload, and the metadata save door `PUT /api/v1/meta/connector/:name`.
13+
14+
- **Before.** The entry refused an undeclared top-level key, but its two nested shapes were plain objects: an undeclared key inside `retryConfig` or inside an `actions` element parsed green and meant nothing to the runtime.
15+
- **Now.** Each is refused by name, in one `unrecognized_keys` issue located at the container (`retryConfig`, `actions.N`) that lists every undeclared key; at the save door `422 INVALID_METADATA`, and nothing is stored. An execution binding on an action (`method`, `path`, `url`) is refused the same way: an action carries none (ADR-0097 §5).
16+
- **Unchanged.** The published open shapes — `ConnectorSchema`, `RetryConfigSchema`, `ConnectorActionSchema` — keep their posture: the def a plugin hands to `registerConnector`, the actions a provider derives, and the retry policy the runtime parses at materialization. A row stored before this refusal keeps working: the read withholds the undeclared key, and a save of the served form keeps it at rest.
17+
18+
## FROM → TO
19+
20+
```ts
21+
// before — parsed green; `secret` was read by nothing
22+
retryConfig: { strategy: 'exponential_backoff', maxAttempts: 3, secret: '…' },
23+
actions: [{ key: 'get_invoice', label: 'Get invoice', method: 'GET', path: '/invoices/{id}' }],
24+
25+
// after — refused at retryConfig and at actions.0; keep the declared keys only
26+
retryConfig: { strategy: 'exponential_backoff', maxAttempts: 3 },
27+
actions: [{ key: 'get_invoice', label: 'Get invoice', effect: 'read' }],
28+
```
29+
30+
A credential moves to the secrets layer under the name `auth.credentialRef` gives; an execution binding has no home on an action (a provider-bound instance derives its actions from the upstream). The upgrade guide entry is `connector-entry-nested-undeclared-key-refused`.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec)!: an authored connector URL holds no credential part; the connector read withholds the credential parts of an `auth` endpoint too
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: narrowed
9+
10+
<!-- adr-0087: registered connector-entry-url-credential-refused -->
11+
12+
**BREAKING** accept-set narrowing on an authored connector entry (`DeclarativeConnectorEntrySchema`), at every door that parses it: `defineStack({ connectors })`, `os validate` / `os compile`, the metadata plugin's artifact load at boot and on reload, and the metadata save door `PUT /api/v1/meta/connector/:name`.
13+
14+
- **Before.** A URL under `providerConfig` or `auth` parsed green whatever it held.
15+
- **Now.** A URL holding a userinfo (`user@` or `user:password@` before the host) or a credential query parameter with a value (`api_key`, `token`, `access_token`, `key`, `secret`, `signature` and the rest of the connector redactor's list, matched case-insensitively on the decoded name, plus the instance's own `auth.paramName`) is refused: one issue per URL, located at the URL (`providerConfig.baseUrl`, `providerConfig.transport.url`, `providerConfig.spec`, `auth.tokenUrl`, `auth.authorizationUrl`, `auth.resource`, and any other URL at any depth under `providerConfig`, array elements included), naming the parts it holds and prescribing `auth: { type, credentialRef }`; at the save door `422 INVALID_METADATA`, and nothing is stored. There is no rule per provider: a URL is recognised by its value.
16+
- **One judgement, both doors.** The write door and the read redactor share one definition of a URL credential part, so the door refuses exactly what the read withholds. A URL inside a header or environment map (`providerConfig.headers`, `defaultHeaders`, `transport.headers`, `transport.env`) is judged by neither: the read withholds those maps whole.
17+
- **Read half.** The built-in `connector` redactor now also rewrites the credential parts out of the `auth` endpoints (`tokenUrl`, `authorizationUrl`, `resource`), the rest of each URL served byte for byte and the position named in `redactedKeys`, as it already did under `providerConfig`.
18+
- **Unchanged.** `ConnectorSchema` — the def a plugin hands to `registerConnector` — keeps its posture. A stored row is never re-judged at materialization, so a connector stored before this refusal keeps dispatching; a save of its served form keeps the stored URL (the metadata protocol's carry-forward), and an edit of the served URL stores exactly the edit.
19+
20+
## FROM → TO
21+
22+
```ts
23+
// before — parsed green; the secret lived in the URL
24+
{ name: 'billing_api', label: 'Billing API', type: 'api', provider: 'rest',
25+
providerConfig: { baseUrl: 'https://billing.example.com/v1?api_key=…' },
26+
auth: { type: 'none' } },
27+
28+
// after — refused at providerConfig.baseUrl; the URL is credential-free and the key is a reference
29+
{ name: 'billing_api', label: 'Billing API', type: 'api', provider: 'rest',
30+
providerConfig: { baseUrl: 'https://billing.example.com/v1' },
31+
auth: { type: 'api-key', credentialRef: 'BILLING_API_KEY', paramName: 'api_key' } },
32+
```
33+
34+
Set the secret under the name `credentialRef` gives (an environment variable in the open tier, or Setup → Connector credentials) and delete it from the URL. There is deliberately no automatic rewrite: the value in the URL may be the only copy of the secret. The upgrade guide entry is `connector-entry-url-credential-refused`.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { SemanticMigration } from '../../types.js';
4+
5+
export const entry: SemanticMigration = {
6+
id: 'connector-entry-nested-undeclared-key-refused',
7+
surface: 'connector entries AUTHORED through `defineConnector()`, defineStack `connectors:`, `os validate` / ' +
8+
'`os compile`, the artifact load and `PUT /meta/connector/:name` — a key `retryConfig` or an `actions` element ' +
9+
'does not declare',
10+
replacement: 'keep only the keys `RetryConfigSchema` declares inside `retryConfig` (`strategy`, `maxAttempts`, ' +
11+
'`initialDelayMs`, `maxDelayMs`, `backoffMultiplier`, `retryableStatusCodes`, `retryOnNetworkError`, `jitter`) ' +
12+
'and only the keys `ConnectorActionSchema` declares inside each `actions` element (`key`, `label`, ' +
13+
'`description`, `inputSchema`, `outputSchema`, `effect`). A credential goes into the secrets layer under the ' +
14+
'name `auth.credentialRef` gives and the key is deleted; an execution binding (`method`, `path`, `url`) has no ' +
15+
'home on an action (ADR-0097 §5) — a provider-bound instance derives its actions from the upstream.',
16+
reason:
17+
'The entry closed its top level; its two nested shapes were still plain objects, so an undeclared key inside ' +
18+
'`retryConfig` or an `actions` element parsed green at every door and meant nothing to the runtime. Each is ' +
19+
'refused now, by name, in one `unrecognized_keys` issue located at the container (`retryConfig`, `actions.N`) ' +
20+
'that lists every undeclared key. There is deliberately no mechanical rewrite, for the top-level entry\'s ' +
21+
'reason: an undeclared key may be a misplaced setting or the only copy of a secret. The open shapes ' +
22+
'(`ConnectorSchema`, `RetryConfigSchema`, `ConnectorActionSchema` — the def a plugin hands to ' +
23+
'`registerConnector`, and the policy the runtime parses) are unchanged. A row stored before this refusal keeps ' +
24+
'working: the read withholds the undeclared key, and a save of the served form keeps it at rest.',
25+
acceptanceCriteria:
26+
'Every authored connector entry parses through `DeclarativeConnectorEntrySchema` with no `unrecognized_keys` ' +
27+
'issue at `retryConfig` or at an `actions` element; each secret that sat at such a key is set under its ' +
28+
'`credentialRef` name.',
29+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { SemanticMigration } from '../../types.js';
4+
5+
export const entry: SemanticMigration = {
6+
id: 'connector-entry-url-credential-refused',
7+
surface: 'connector entries AUTHORED through defineStack `connectors:`, `os validate` / `os compile`, the artifact ' +
8+
'load and `PUT /meta/connector/:name` — a URL under `providerConfig` (`baseUrl`, `transport.url`, a URL `spec`, ' +
9+
'any other URL a provider keeps there) or under `auth` (`tokenUrl`, `authorizationUrl`, `resource`) that holds a ' +
10+
'userinfo or a credential query parameter',
11+
replacement: 'keep every authored connector URL credential-free and name the secret with `auth: { type, ' +
12+
'credentialRef }`: `bearer` for a token, `api-key` for a key (with `paramName` when the API takes it as a query ' +
13+
'parameter, which the provider then adds to every request), `basic` for a user and password. Set the value under ' +
14+
'the name `credentialRef` gives — an environment variable in the open tier, or Setup → Connector credentials — ' +
15+
'and delete it from the URL.',
16+
reason:
17+
'Connector metadata holds no credential at any position, and the read already withheld the credential parts of ' +
18+
'a URL under `providerConfig`. The write door now holds the same line: a URL holding a userinfo (`user@` or ' +
19+
'`user:password@`) or a credential query parameter (the datasource names, the conventional HTTP key and token ' +
20+
'names, and the instance\'s own `auth.paramName`) is refused with `422 INVALID_METADATA`, one issue per URL ' +
21+
'located at the URL, naming the parts it holds. The judgement is the read redactor\'s own, so the door refuses ' +
22+
'exactly what the read withholds, and the read now applies it to the `auth` endpoints too. A URL inside a header ' +
23+
'or environment map is judged by neither (the read withholds those maps whole). There is deliberately no ' +
24+
'mechanical rewrite: the value in the URL may be the only copy of the secret, and where it goes next is the ' +
25+
'administrator\'s act. A row stored before this refusal keeps working: a save of the served form keeps the ' +
26+
'stored URL, and an edit of the served URL stores the edit.',
27+
acceptanceCriteria:
28+
'Every authored connector entry parses through `DeclarativeConnectorEntrySchema` with no issue located at a ' +
29+
'URL under `providerConfig` or `auth`; each secret that sat in a URL is set under its `credentialRef` name and ' +
30+
'the instance still materializes (`GET /api/v1/automation/connectors` reports it `ready`).',
31+
};

0 commit comments

Comments
 (0)