fix(mcp): allowedorigins-removed message says v1.3.0, not v2.0.0

This commit is contained in:
2026-08-08 14:07:39 -06:00
parent 3961ae7175
commit e1802e4c25
6 changed files with 10813 additions and 8 deletions
+6
View File
@@ -6,6 +6,12 @@ This module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html
--- ---
## [1.3.1] — 2026-08-08
Patch. Correct the `web.allowedorigins-removed` rule message and migration docs to name the
real removal version: the field was removed in **v1.3.0** (breaking-in-minor), not v2.0.0.
## [1.3.0] — 2026-08-08 ## [1.3.0] — 2026-08-08
Minor. Tracks the frameworks v1.3.0 removal of `web.Config.AllowedOrigins`. Minor. Tracks the frameworks v1.3.0 removal of `web.Config.AllowedOrigins`.
+1 -1
View File
@@ -1,6 +1,6 @@
# einherjar/mcp # einherjar/mcp
[![version](https://img.shields.io/badge/version-v1.3.0-5C4EE5?style=flat-square)](https://code.nochebuena.dev/einherjar/mcp) [![version](https://img.shields.io/badge/version-v1.3.1-5C4EE5?style=flat-square)](https://code.nochebuena.dev/einherjar/mcp)
[![license](https://img.shields.io/badge/license-AGPL--3.0-22863A?style=flat-square)](LICENSE) [![license](https://img.shields.io/badge/license-AGPL--3.0-22863A?style=flat-square)](LICENSE)
[![go](https://img.shields.io/badge/Go-1.26+-00ADD8?style=flat-square&logo=go&logoColor=white)](https://go.dev) [![go](https://img.shields.io/badge/Go-1.26+-00ADD8?style=flat-square&logo=go&logoColor=white)](https://go.dev)
+1 -1
View File
@@ -23,7 +23,7 @@ import (
const ( const (
serverName = "einherjar-mcp" serverName = "einherjar-mcp"
serverVersion = "v1.3.0" serverVersion = "v1.3.1"
) )
func main() { func main() {
+10800 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -208,7 +208,7 @@ Whichever tier you pick, CORS origins always come from the framework var
> **CORS has one home: `server.Config.CORSOrigins`.** In framework `v1.x`, `web.Config` > **CORS has one home: `server.Config.CORSOrigins`.** In framework `v1.x`, `web.Config`
> carried an `AllowedOrigins` field. It was env-backed through `v1.1.x` and a code-only override > carried an `AllowedOrigins` field. It was env-backed through `v1.1.x` and a code-only override
> in `v1.2.0` — reading it after the env tag moved silently served *no* CORS. **`v2.0.0` removed the > in `v1.2.0` — reading it after the env tag moved silently served *no* CORS. **`v1.3.0` removed the
> field entirely** so the mistake fails at compile time instead of at runtime. If you are migrating > field entirely** so the mistake fails at compile time instead of at runtime. If you are migrating
> code that read `web.Config.AllowedOrigins` or set it in a struct literal, switch to > code that read `web.Config.AllowedOrigins` or set it in a struct literal, switch to
> `cfg.Server.CORSOrigins`: > `cfg.Server.CORSOrigins`:
@@ -218,7 +218,7 @@ Whichever tier you pick, CORS origins always come from the framework var
> // mw.CORS(cfg.Web.AllowedOrigins) > // mw.CORS(cfg.Web.AllowedOrigins)
> // web.New(logger, web.Config{AllowedOrigins: origins}) > // web.New(logger, web.Config{AllowedOrigins: origins})
> >
> // v2.0.0 — the single source of truth: > // v1.3.0 — the single source of truth:
> mw.CORS(cfg.Server.CORSOrigins) // server.New tier > mw.CORS(cfg.Server.CORSOrigins) // server.New tier
> web.New(logger, web.Config{Server: cfg.Server}) // web.New reads it automatically > web.New(logger, web.Config{Server: cfg.Server}) // web.New reads it automatically
> ``` > ```
+3 -3
View File
@@ -29,12 +29,12 @@ func init() {
// checkAllowedOriginsRemoved flags any reference to the removed // checkAllowedOriginsRemoved flags any reference to the removed
// web.Config.AllowedOrigins field — both a selector (cfg.Web.AllowedOrigins) and a // web.Config.AllowedOrigins field — both a selector (cfg.Web.AllowedOrigins) and a
// struct-literal key (web.Config{AllowedOrigins: ...}). It was env-backed through // struct-literal key (web.Config{AllowedOrigins: ...}). It was env-backed through
// v1.1.x, became a code-only override in v1.2.0, and was removed in v2.0.0. Code // v1.1.x, became a code-only override in v1.2.0, and was removed in v1.3.0. Code
// that still reads it compiled but silently served no CORS in v1.2.0; in v2.0.0 it // that still reads it compiled but silently served no CORS in v1.2.0; in v1.3.0 it
// no longer compiles. CORS now lives solely on server.Config.CORSOrigins. // no longer compiles. CORS now lives solely on server.Config.CORSOrigins.
func checkAllowedOriginsRemoved(c *Context) []Finding { func checkAllowedOriginsRemoved(c *Context) []Finding {
const ( const (
msg = "web.Config.AllowedOrigins was removed in v2.0.0 — CORS lives on Server.CORSOrigins (env EINHERJAR_SERVER_CORS_ORIGINS)" msg = "web.Config.AllowedOrigins was removed in v1.3.0 — CORS lives on Server.CORSOrigins (env EINHERJAR_SERVER_CORS_ORIGINS)"
hint = "Read cfg.Server.CORSOrigins (or set it in code); web.New applies it automatically. Never reintroduce a field/var for CORS origins." hint = "Read cfg.Server.CORSOrigins (or set it in code); web.New applies it automatically. Never reintroduce a field/var for CORS origins."
) )
seen := map[int]bool{} seen := map[int]bool{}