@synopackageland/cli 0.42.1 → 0.42.2
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 +12 -0
- package/README.md +1 -1
- package/assets/go/route-audit/main.go +23 -3
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.42.2 (2026-11-01)
|
|
4
|
+
|
|
5
|
+
- Pin SDK 0.42.0 for CLI-owned runtime defaults (daemon controllers, Compose
|
|
6
|
+
planning and installer context); it reuses the executor/v0.39.0 inventory.
|
|
7
|
+
Explicit App SDK declarations still take precedence; templates stay ~0.37.0.
|
|
8
|
+
- The route audit accepts `api.WithObserver` (SDK 0.42.0) around the CGI root,
|
|
9
|
+
like `api.WithRequestDeadline`; only its handler argument is followed, and a
|
|
10
|
+
private handler wrapped in it is still refused.
|
|
11
|
+
- The route audit no longer resolves the selected name of a selector
|
|
12
|
+
(`pkg.Config`, `value.Method`) as a name of the App's own package, which
|
|
13
|
+
made an App type and all its methods look reachable from a private handler.
|
|
14
|
+
|
|
3
15
|
## 0.42.1 (2026-11-01)
|
|
4
16
|
|
|
5
17
|
- Add `--version` and `-V` to report the installed CLI version.
|
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ alongside npm lockfiles. Do not disable checksum verification for public SDK
|
|
|
89
89
|
packages. Private mirrors can use explicitly configured Go authentication and
|
|
90
90
|
checksum settings; a failed fetch reports `SDK_DOWNLOAD_FAILED`.
|
|
91
91
|
|
|
92
|
-
The CLI pins SDK 0.
|
|
92
|
+
The CLI pins SDK 0.42.0 for its daemon controllers, Compose planning and installer
|
|
93
93
|
context. Explicit App SDK declarations take precedence. Templates use ~0.37.0
|
|
94
94
|
and retain their own scaffold SDK pins; none declare daemon ingress.
|
|
95
95
|
Every App method must be declared in the permissions table. Dynamic names and
|
|
@@ -118,6 +118,21 @@ type source struct {
|
|
|
118
118
|
file *ast.File
|
|
119
119
|
path, pkg string
|
|
120
120
|
imports map[string]string
|
|
121
|
+
// selected are the Sel identifiers of selector expressions (pkg.Name,
|
|
122
|
+
// value.Field, value.Method). They name nothing in this package: the
|
|
123
|
+
// selector itself is resolved through imports, never as a local name.
|
|
124
|
+
selected map[*ast.Ident]bool
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
func selectedNames(file *ast.File) map[*ast.Ident]bool {
|
|
128
|
+
out := map[*ast.Ident]bool{}
|
|
129
|
+
ast.Inspect(file, func(n ast.Node) bool {
|
|
130
|
+
if sel, ok := n.(*ast.SelectorExpr); ok {
|
|
131
|
+
out[sel.Sel] = true
|
|
132
|
+
}
|
|
133
|
+
return true
|
|
134
|
+
})
|
|
135
|
+
return out
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
// Follow the handler argument through local declarations and factories. A
|
|
@@ -176,6 +191,9 @@ func boundaryHandlers(sources []source) map[ast.Node]bool {
|
|
|
176
191
|
key := ""
|
|
177
192
|
switch v := n.(type) {
|
|
178
193
|
case *ast.Ident:
|
|
194
|
+
if s.selected[v] {
|
|
195
|
+
return true
|
|
196
|
+
}
|
|
179
197
|
key = s.pkg + "." + v.Name
|
|
180
198
|
if v.Obj != nil {
|
|
181
199
|
// A parameter or receiver carries a value built elsewhere.
|
|
@@ -242,7 +260,9 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
242
260
|
switch sel.Sel.Name {
|
|
243
261
|
case "NewServerWithPermissions":
|
|
244
262
|
return false
|
|
245
|
-
case "WithRequestDeadline", "WithDescription":
|
|
263
|
+
case "WithRequestDeadline", "WithDescription", "WithObserver":
|
|
264
|
+
// WithObserver's callback runs after the SDK answered; only its
|
|
265
|
+
// handler argument can serve the request.
|
|
246
266
|
return len(call.Args) > 0 && reusesBoundary(call.Args[0], owner, sources, safe, seen)
|
|
247
267
|
}
|
|
248
268
|
}
|
|
@@ -298,7 +318,7 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
298
318
|
}
|
|
299
319
|
}
|
|
300
320
|
return false
|
|
301
|
-
} else {
|
|
321
|
+
} else if !owner.selected[id] {
|
|
302
322
|
targetPackage, targetName = owner.pkg, id.Name
|
|
303
323
|
}
|
|
304
324
|
}
|
|
@@ -502,7 +522,7 @@ func main() {
|
|
|
502
522
|
}
|
|
503
523
|
imports[alias] = module
|
|
504
524
|
}
|
|
505
|
-
sources = append(sources, source{file, path, pkg, imports})
|
|
525
|
+
sources = append(sources, source{file, path, pkg, imports, selectedNames(file)})
|
|
506
526
|
}
|
|
507
527
|
safe := boundaryHandlers(sources)
|
|
508
528
|
for _, src := range sources {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { goPrivateCovers } from './go-env.js';
|
|
2
2
|
import { type ExecutorManifest } from './sdk-executor-manifest.js';
|
|
3
3
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
4
|
-
export declare const DEFAULT_SDK_VERSION = "0.
|
|
4
|
+
export declare const DEFAULT_SDK_VERSION = "0.42.0";
|
|
5
5
|
export declare const SDK_PACKAGE = "@synopackageland/sdk";
|
|
6
6
|
export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
|
|
7
7
|
export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
|
|
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
|
|
7
7
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
8
|
-
export const DEFAULT_SDK_VERSION = '0.
|
|
8
|
+
export const DEFAULT_SDK_VERSION = '0.42.0';
|
|
9
9
|
export const SDK_PACKAGE = '@synopackageland/sdk';
|
|
10
10
|
export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
|
|
11
11
|
export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
|