feat(resolvemcp)!: make the server read-only by default
Tests / Integration Tests (push) Skipped
Build , Vet Test, and Lint / Build (push) Successful in 1m33s
Tests / Unit Tests (push) Successful in 2m1s
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Successful in 2m36s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in 2m38s
Build , Vet Test, and Lint / Lint Code (push) Successful in 2m49s
Tests / Race Detector (push) Successful in 4m31s

BREAKING CHANGE: Config.ReadOnly is now a *bool and unset means read-only.
Use ReadOnly: resolvemcp.Bool(false) to enable insert/update/delete,
annotations and function calls. Adds the Bool helper and updates docs.
This commit is contained in:
Hein
2026-10-07 14:17:56 +02:00
parent 4ed9506ad2
commit 5a3a1df3c8
9 changed files with 62 additions and 28 deletions
+3 -3
View File
@@ -145,8 +145,8 @@ func (h *Handler) BuildCatalog() Catalog {
GeneratedAt: time.Now().UTC(),
Server: h.name,
Version: h.version,
ReadOnly: h.config.ReadOnly,
Guide: guideFor(h.config.ReadOnly, h.config.AllowFunctionCalls),
ReadOnly: h.config.readOnly,
Guide: guideFor(h.config.readOnly, h.config.AllowFunctionCalls),
Limits: CatalogLimits{
DefaultLimit: h.config.DefaultLimit,
MaxLimit: h.config.MaxLimit,
@@ -179,7 +179,7 @@ func (h *Handler) BuildCatalog() Catalog {
for mt != nil && (mt.Kind() == reflect.Pointer || mt.Kind() == reflect.Slice) {
mt = mt.Elem()
}
if !h.config.ReadOnly && mt != nil && mt.Kind() == reflect.Struct {
if !h.config.readOnly && mt != nil && mt.Kind() == reflect.Struct {
for k := range reflectionJSONColumns(mt) {
writable[k] = true
}