@abide/abide 0.121.0 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @abide/abide
|
|
2
2
|
|
|
3
|
+
## 0.121.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7d6571d: a pairing link written into an href survives the URL scheme check — abide-bridge: joins the safe set, and the render warning names the set it checked against (RULEBOOK 32.20, 44.40) ([`aaba479`](https://github.com/briancray/abide/commit/aaba479a86b318d2441e920b6f7cfd124cb6c75e))
|
|
8
|
+
|
|
3
9
|
## 0.121.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/docs/RULEBOOK.md
CHANGED
|
@@ -1959,8 +1959,8 @@ body.
|
|
|
1959
1959
|
MUST NOT be built as a string.
|
|
1960
1960
|
|
|
1961
1961
|
32.20 An interpolation in a URL-typed attribute MUST be scheme-checked, and a scheme outside
|
|
1962
|
-
`http:`, `https:`, `mailto:`, `tel:`, `blob:`, `data:` or a relative
|
|
1963
|
-
`abide:render`, naming the attribute and not the value.
|
|
1962
|
+
`http:`, `https:`, `mailto:`, `tel:`, `blob:`, `data:`, `abide-bridge:` (44.40) or a relative
|
|
1963
|
+
reference MUST be dropped and warned on `abide:render`, naming the attribute and not the value.
|
|
1964
1964
|
|
|
1965
1965
|
32.21 A control block MUST bind each reactive read and probe call in its subject once for the body.
|
|
1966
1966
|
|
package/package.json
CHANGED
package/src/server/claudeCode.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// directory, settings — is not an option here at all, and its built-in `tools` are a request the visitor
|
|
9
9
|
// grants or does not: the bridge decides (44.15, 44.16, 44.29).
|
|
10
10
|
|
|
11
|
+
import { BRIDGE_SCHEME } from '#shared/BRIDGE_SCHEME.ts'
|
|
11
12
|
import { mounted } from '#shared/mount.ts'
|
|
12
13
|
import { refuse } from '#shared/refuse.ts'
|
|
13
14
|
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
forwardOf,
|
|
20
21
|
type Provider,
|
|
21
22
|
} from './assistant.ts'
|
|
22
|
-
import { BRIDGE_SCHEME } from './BRIDGE_SCHEME.ts'
|
|
23
23
|
import { BRIDGE_VERSION } from './BRIDGE_VERSION.ts'
|
|
24
24
|
import {
|
|
25
25
|
followSignIn,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// 44.40 — the scheme a pairing link is written in, which the handler `abide-bridge install` registers
|
|
2
|
-
// opens. The bridge spells it out as `PAIRING_SCHEME`, and a test holds the two equal.
|
|
2
|
+
// opens. The bridge spells it out as `PAIRING_SCHEME`, and a test holds the two equal. A leaf in
|
|
3
|
+
// #shared because both seams read it: the server mints the link, and 32.20's `safeUrl` lets a page
|
|
4
|
+
// write it into an `href`.
|
|
3
5
|
export const BRIDGE_SCHEME = 'abide-bridge'
|
|
@@ -10,7 +10,7 @@ import { BOOLEAN_ATTRIBUTES } from './BOOLEAN_ATTRIBUTES.ts'
|
|
|
10
10
|
import { escapeAttribute } from './escapeText.ts'
|
|
11
11
|
import { RENDER_LOG } from './log.ts'
|
|
12
12
|
import { textOf } from './Raw.ts'
|
|
13
|
-
import { safeUrl } from './safeUrl.ts'
|
|
13
|
+
import { SAFE_SCHEMES, safeUrl } from './safeUrl.ts'
|
|
14
14
|
import { URL_ATTRIBUTES } from './URL_ATTRIBUTES.ts'
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -31,7 +31,7 @@ export function attributeText(name: string, value: unknown): string | null {
|
|
|
31
31
|
const safe = safeUrl(text)
|
|
32
32
|
if (safe !== text)
|
|
33
33
|
RENDER_LOG.warning(
|
|
34
|
-
`abide: \`${name}\` was handed a URL whose scheme is not
|
|
34
|
+
`abide: \`${name}\` was handed a URL whose scheme is not one of ${[...SAFE_SCHEMES].join(' ')}, and is written empty. RULEBOOK 32.20.`,
|
|
35
35
|
)
|
|
36
36
|
return safe
|
|
37
37
|
}
|
package/src/shared/safeUrl.ts
CHANGED
|
@@ -6,15 +6,22 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The warning on `abide:render` the clause also asks for is `attributeText`'s, which knows the
|
|
8
8
|
// attribute's name.
|
|
9
|
+
//
|
|
10
|
+
// `abide-bridge:` IS IN THE SET because abide mints it: a pairing's `link` (44.40) is written into an
|
|
11
|
+
// `href` or the visitor cannot open it, and the docs' own pairing page does exactly that. It is the
|
|
12
|
+
// one scheme, not custom schemes generally — what it opens asks the visitor before it does anything,
|
|
13
|
+
// every time, naming the site it pairs with (44.42), so a link from anywhere can do no more than ask.
|
|
14
|
+
import { BRIDGE_SCHEME } from './BRIDGE_SCHEME.ts'
|
|
9
15
|
import { textOf } from './Raw.ts'
|
|
10
16
|
|
|
11
|
-
const SAFE_SCHEMES = new Set([
|
|
17
|
+
export const SAFE_SCHEMES = new Set([
|
|
12
18
|
'http:',
|
|
13
19
|
'https:',
|
|
14
20
|
'mailto:',
|
|
15
21
|
'tel:',
|
|
16
22
|
'blob:',
|
|
17
23
|
'data:',
|
|
24
|
+
`${BRIDGE_SCHEME}:`,
|
|
18
25
|
])
|
|
19
26
|
|
|
20
27
|
/** A URL attribute's text, or `''` where its scheme is outside the safe set. */
|