Released: TBD Compare: v0.12.0-alpha.17…v0.12.0-alpha.18
This tag is the whole of planning spec #101 — Go 1.27 adoption — landed as ten
slices (#270–#279) in one PR (#280), plus two randomness-hygiene fixes (#267,
#268) that preceded it. The toolchain moved from Go 1.26.5 to 1.27.0 and
go.mod now declares go 1.27.0; everything else in the release is the audit of
what that makes possible or newly requires — stdlib uuid, crypto/mldsa,
encoding/json/v2 under the v1 API, testing/synctest, the runtime’s
goroutineleak profile, and the removal of the asynctimerchan GODEBUG escape
hatch that used to make time.After in a loop survivable.
Two of the ten carry impact a consumer should read before upgrading.
RS256 / RSA-2048
remains every stream’s default, an issuer with any ML-DSA stream publishes
both keys in one JWKS, and a receiver that has never heard of the AKP key
type skips it and verifies its RS256 stream exactly as before. The reason the
opt-in is per stream is the wire cost — a representative SCIM SET grows from
1,113 bytes to 5,188 (4.7×), because an ML-DSA-65 signature is 3,309 bytes
against RSA-2048’s 256. CPU moves both ways: signing is 2.3× faster
(827 µs → 352 µs), verification 3.2× slower (31.1 µs → 99.3 µs). An
operator enabling it should expect a poll maxEvents that was comfortable
before to move considerably more bytes.pkg/dao/ids is the one
place the server mints ids: uuid v7 for stream ids, inbound SSTP SIDs and
SET jti values, v4 for secret-bearing values such as OAuth state, and
the Mongo-shaped 24-hex form only where a DAO converts it back to a
bson.ObjectID. github.com/segmentio/ksuid is gone from go.mod. Anything
that assumed a 27-character ksuid jti, or the urn:i2-open:ssf:aud:<ksuid>
shape of a transmitter-minted aud (ADR 0024), sees 36-character UUIDs on
new records. Existing rows are untouched and there is no migration step.The measured claim behind the toolchain bump is also worth stating plainly:
the reported Go 1.27 slowdown does not reproduce. Under controlled conditions
— identical source, a private empty build cache per toolchain, test result
caching disabled — 1.27.0 runs this suite within ±1% of 1.26.5, race detector
on or off, while JSON decode paths improve by −17% to −70%. The method and
the full tables are in docs/perf/go127-baseline.md.
And this alpha finally closes the gap the v0.12.0-alpha.16 and -alpha.17
notes both flagged: there is now a make qa gate (#270, absorbing #266), and
its goroutine-leak stage found two real production leaks on its first run
(#279).
make qa (#270)docs/perf/go127-baseline.md records the suite measured under go1.26.5 and
go1.27.0 with a private empty build cache per toolchain and test caching
disabled, and names the reference benchmark set — pkg/goSet,
pkg/goSetValidate, pkg/goSetPoll, internal/eventRouter/buffer — that every
later slice reports a delta against. Each slice’s row states its worst
benchmark delta, not an average, so a regression cannot hide behind a set of
improvements; the documented noise band on sub-microsecond benchmarks is 4–7%.
The headline table, 1.27.0 against 1.26.5 (GOEXPERIMENT=nojsonv2 returns each
row to roughly its 1.26.5 timing, which is what attributes them):
| Path | 1.27.0 vs 1.26.5 |
|---|---|
| Poll response decode (100 SETs) | −70% (318 → 214 allocs/op) |
| Poll response encode (100 SETs) | −66% |
| Poll request decode | −48% |
| SET JSON unmarshal | −33% |
SET Peek (unverified parse) |
−17% (96 → 76 allocs/op) |
One genuine regression: BenchmarkSetJsonBytes was +11% on 1.27.0 in
exchange for a 16% allocation reduction; #273 gives most of it back (−6.2%).
make qa is now the gate — fmt-check vet tidy-check test leak-check bench,
ordered cheapest-first so an obvious failure reports in seconds. tidy-check
diffs what go mod tidy would change rather than applying it, and restores
go.mod/go.sum on every exit path.
pkg/goSet/mldsa — the ML-DSA-65 jwt.SigningMethod and the RFC 9964
kty:"AKP" JWK codec. Both are community-local because golang-jwt/jwt/v5
(v5.3.1), MicahParks/keyfunc/v2 and MicahParks/jwkset have no ML-DSA
support; they plug into the extension points those libraries already publish
(jwt.RegisterSigningMethod, keyfunc.NewGivenCustom), so the swap when
golang-jwt #519 ships is an
import change rather than a rewrite of the signing or verify paths.StreamConfiguration.signing_alg ("" / RS256 / ML-DSA-65) selects
the algorithm for one stream. "" and RS256 are the same thing, and the tag
is omitzero, so a stream configured before this field existed is
byte-identical on the wire to one configured after.kids and publishes both. The key store’s records gained an
Alg discriminator whose empty value means RSA, so existing rows decode
unchanged ("" → PKCS#1; ML-DSA-65 → a 32-byte seed and the 1952-byte public
encoding).KeyService.GetSigner(ctx, issuer,
alg) is the acquisition seam, and the router caches per (issuer, alg) —
keyed on issuer alone, whichever stream loaded first would pin the wrong key
for the other. Invalidation stays issuer-level and evicts both.goSet.NewJwksWithAKP /
AKPGivenKeys, which hand AKP entries to keyfunc as given keys merged back
in on every background refresh; nothing forks the library. AllowedAlgs()
gains ML-DSA-65 on every node, whether or not it transmits ML-DSA, and
the given key declares its own Algorithm so keyfunc refuses to hand it to a
token claiming anything else.cmd/genTlsKeys accepts
CERT_KEY_ALG=ML-DSA-65 and issues an ML-DSA leaf from an ML-DSA CA;
RSA-4096 remains the default. It is deliberately separate from
signing_alg — the cluster CA is trusted by every node, so flipping its
default would invalidate every existing deployment’s certificates on upgrade.SigningMethodOrRS256
(not MustSigningMethodFor), and its downgrade diagnostic now goes through the
package sub-logger at ERROR, because reaching it means stream-config
validation admitted an unknown alg.X25519MLKEM768 group, so a toolchain change cannot
silently drop post-quantum key agreement. The invariant is held by omission —
goSignals does not constrain CurvePreferences — which is exactly the kind a
well-meaning “let’s pin the curve list” change breaks quietly.CurvePreferences is now written in exactly one place, tlsSupport.Harden,
which every TLS config in pkg/tlsSupport and pkg/oauthClient routes
through. New environment variable I2SIG_TLS_PQ_KEM: X25519MLKEM768
(default) leaves the choice to the toolchain; MLKEM1024 additionally offers
standalone ML-KEM-1024 for deployments whose policy requires NIST category 5.
It widens the offered set — it cannot reorder it — and an unrecognised value
logs a WARN and falls back.tls.Config states MinVersion: tls.VersionTLS12 explicitly. Left
unset, crypto/tls permits TLS 1.0 server-side, and the omission is invisible
at the call site; a source-scan guard test fails the build when a new
tls.Config literal omits it or bypasses the policy helper.jwt.WithValidMethods on the SET parse path. goSet.Parse restricts the
accepted alg to goSet.AllowedAlgs() — {RS256, ES256, ML-DSA-65} after
#278 — checked before the JWKS is consulted, so alg: none or an HMAC forged
against the issuer’s public modulus is refused without any key handling at all.
goSet.Peek is deliberately unaffected: it is the explicitly unverified
counterpart and its result is never an accepted token.docs/security_model.md gains SET signature verification (algorithm
allow-list) and Transport security floor sections recording both.
pkg/dao/ids (#274)pkg/dao/ids offers three shapes and states which a caller should reach for —
NewObjectID for a record id a DAO converts back into a bson.ObjectID,
NewV7 where mint order is useful, NewSecret where an embedded timestamp or an
ordering would be a leak. A tree-walking test fails the build if the Mongo
driver’s own ObjectID constructor reappears anywhere but the Mongo provider
packages — including in _test.go files, which is how the ~50 test-file calls it
just removed accumulated. model.NewRecordId carries the Mongo-shaped group
across the type boundary and only re-types it.
Which sites moved, and why it is a semantic decision rather than a rename:
GenerateJti, the inbound SSTP SID and the CLI’s SET txn become UUIDv7
(all want ordering; the inbound SID resolves through a string index, never as a
document _id). OAuth state at both receiver verification sites becomes
UUIDv4 — a v7 would publish the moment it was minted. Stream, client and
server record _ids, the tx-side pair id and the key rotation suffix stay
Mongo-shaped, because the Mongo stream DAO looks records up with ParseObjectID
and a UUID there would be a not-found rather than a slow lookup.
Removing the ksuid jti removed the last use of github.com/segmentio/ksuid,
and SecurityEventToken.IsBefore — a jti string comparison with no callers —
went with it. ADR 0024 and the ADR index were corrected to say UUIDv7 where they
said ksuid.
crypto.Signer at the nine signing sites (#277)Key plumbing generalises from *rsa.PrivateKey to crypto.Signer at all nine
SET and OAuth signing sites, so #278 could add a lattice key without touching a
call site. Behaviour is unchanged in this slice — RSA-2048 / RS256 remains the
default, and the narrowings that remain are at key load, rotation and JWKS build,
not per SET. dao.KeyPairData.PrivateKey is a crypto.Signer; its public half
stays *rsa.PublicKey because the stored JWK encoding is the RSA n/e form.
omitzero, golden fixtures, compact poll (#273)Golden-JSON conformance fixtures were pinned first — 33 files across
pkg/ssfModels and pkg/goSetPoll, in zero / mixed / populated triples — and
then the retags landed against them:
json tags move omitempty → omitzero. Under
encoding/json v1 the two are identical for these kinds and every pinned byte is
unchanged; the reason to do it anyway is that they are not identical under
json/v2, where omitempty reverts to meaning “empty” (len 0) and would start
emitting "returnImmediately": false and "maxEvents": 0 on every poll
request.time.Time fields move the same way, and here it is a
real wire change: omitempty on a time.Time is silently inert, so
SubjectFilterEntry.EnforceAt, the two subject-filter lookup views and the
CLI session’s LoggedInAt all shipped a meaningless
"0001-01-01T00:00:00Z" whenever unset. Absent now carries exactly the
meaning the epoch stamp carried, and every reader decodes a missing member
back to the zero instant.bson tags are deliberately untouched throughout — persistence is a separate
contract, and the sparse Mongo index on enforce_at depends on the current
behaviour.WritePollResponse and PollRaw
used json.MarshalIndent once per poll return and once per polling interval
per stream; RFC 8936 says nothing about whitespace and no receiver reads it.
SecurityEventToken.JsonBytes no longer builds through a json.Encoder, whose
trailing newline became a byte of JWS payload carrying no meaning that every
receiver had to tolerate. TestPollWireIsCompact pins the actual HTTP bodies
so a returning MarshalIndent fails a test rather than reaching a peer.Across #274–#279 the goldens moved by exactly one member — signing_alg, in
the two populated fixtures only, with the zero and mixed fixtures
byte-identical, which is the omitzero guarantee holding.
jsontext scan over raw
name bytes with a pooled decoder: 1933 → 933 ns/op and 73 → 0 allocs/op.aud normaliser decoded the whole stream configuration into a map and
re-encoded it — reordering the transmitter’s members as a side effect. It is
now a two-byte splice that returns the caller’s slice untouched when there is
nothing to rewrite: −94.9% on both string and array aud.encoding/json/v2 pilot ran in goSetValidate and was
adopted for normalizePayload (−32%/−34%); the superseded v1 form is kept
in normalize_pilot_test.go so the A/B stays re-runnable. This is a scoped
adoption, not a json/v2 API migration. One behaviour moves with the encoder:
v2 reports invalid UTF-8 in a string as Malformed where v1 silently
substituted U+FFFD — reachable only from an in-process Go string, never off
the wire.Go 1.27 removes the asynctimerchan GODEBUG escape hatch, so time.After inside
a loop now leaks an armed timer per iteration until it fires. Every such use is
replaced with an owned *time.Timer stopped on all exit paths behind one
ctx-aware sleep helper; a dead idle-drain path is deleted; Mongo coordinator
heartbeats are scoped to the server lifecycle context so they stop at
shutdown instead of outliving it. internal/timerlint keeps the rule from
decaying.
#279 names the lease-heartbeat and T3-keepalive loops as seams and covers them
with testing/synctest suites that make lease, backoff and T3 idle timing
deterministic rather than sleep-based, then adds a leak-check stage to
make qa running Go 1.27’s goroutineleak runtime profile over the four
timer-owning packages (pkg/goSetPoll/..., pkg/goSetPush/...,
internal/eventRouter/..., internal/server). It is a proof, not the old
count-before-and-after heuristic, so there is no tolerance to tune. It found
two real production goroutine leaks on its first run, both fixed here:
Shutdown did not close poll buffers at all.The gate is inert unless I2SIG_GOROUTINE_LEAK_CHECK is set, so the ordinary
go test ./... edit loop is unchanged.
authSupport.GenerateAlias draws from crypto/rand with rejection
sampling for a uniform letter distribution. The package-level time-seeded
math/rand Source that minted projectId values is gone — it was both
predictable and raced under concurrent IssueProjectIat calls. Covered by a
32-goroutine concurrency test under -race.ksuid.New() call in GenerateJti is removed, halving CSPRNG
reads and allocations per jti and per stream-audience mint. The CLI’s private
math/rand alias copy is deleted in favour of the shared helper.go.mod declares go 1.27.0.github.com/segmentio/ksuid (#274) and
golang.org/x/exp (#272, the last user was a log/slog import in
cmd/genTlsKeys, now stdlib).go.mongodb.org/mongo-driver/v2 2.8.0 → 2.8.1; google.golang.org/grpc
1.83.1 → 1.83.2.make gains qa, fmt-check, vet, test, tidy-check, bench and
leak-check, with BENCH_PKGS / BENCHTIME / LEAK_PKGS as knobs.console-build now emits the goSignals console binary into bin/ instead
of the repo root.pkg/constants/version.txt → 0.12.0-alpha.18.Go 1.27.0 is required to build this tag. go.mod declares it, and the code
uses the stdlib uuid package, crypto/mldsa, testing/synctest and the
goroutineleak profile. A consumer still on 1.26.x cannot compile against
v0.12.0-alpha.18.
The key-handling surface is source-breaking for anything that binds an
*rsa.PrivateKey. crypto.Signer replaces it on KeyService.CreateKeyPair,
RotateKey, AddKey, GetPrivateKey, GetPrivateKeyWithKeyname and
GetPrivateKeyByKid, on dao.KeyPairData.PrivateKey, on
AuthIssuer.UpdateTokenKey, and on goSet.SecurityEventToken.JWS. Enterprise’s
only call sites discard the returned key, so it recompiles unchanged; a caller
that assigns the result to an *rsa.PrivateKey needs a type assertion.
SecurityEventToken.IsBefore was removed (dropped with ksuid; it had no
callers).
New exported surface, all additive: package pkg/goSet/mldsa (SigningMethodMLDSA,
AKPKey, ParseAKPJWK, GenerateKey, Params); goSet.AllowedAlgs,
SigningMethodFor, SigningMethodOrRS256, NewJwksWithAKP, AKPGivenKeys;
ids.NewV7 / ids.NewSecret; model.NewRecordId;
ssfModels.StreamConfiguration.SigningAlg; KeyService.GetSigner and
EnsureSigningKeyForAlg; dao.JwkKeyRec.Alg; tlsSupport.Harden;
authSupport.GenerateAlias; and package pkg/goroutineleak.
Behavioural changes an operator should know about:
goSet.Parse accepts only
RS256, ES256 and ML-DSA-65. A peer signing SETs with any other algorithm
— PS256, RS512, an HS variant — is now rejected at the header, before key
lookup. AllowedAlgs() is the single place that widens.jti goes from a 27-character ksuid to a
36-character UUIDv7, and a transmitter-minted aud is now
urn:i2-open:ssf:aud:<uuidv7>. Existing records keep their existing ids; there
is no backfill and no migration step. Anything that validated the shape of a
goSignals-minted id needs to accept both.enforce_at no longer appears as "0001-01-01T00:00:00Z" when unset — it is
simply absent, which carries the same meaning. Poll responses are compact JSON
rather than indented, and the JWS payload no longer carries a trailing
newline. Everything else on the RFC 8936 / SSF wire is byte-identical.ML-DSA-65 has
to be asked for per stream, and internal mTLS still defaults to RSA-4096.crypto/mldsa errors under the
v1.0.0 module (v1.26.0+ is fine); a deployment pinned to the older module fails
loudly at key generation when a stream is opted in.kid, so an issuer’s RSA and
ML-DSA keys rotate independently — two keys per issuer to operate once any
stream is opted in.New configuration: I2SIG_TLS_PQ_KEM (§TLS) and CERT_KEY_ALG (§genTlsKeys) in
docs/configuration_properties.md, plus the
signing_alg member on a stream configuration.
v0.12.0-alpha.18 bucket; no
sister repo carries a slice of it.v0.12.0-alpha.17. Nothing here requires action from them on re-pin — RS256
remains every stream’s default and the JWKS keeps advertising the RSA key — but
they must be on Go 1.27.0 to build against this tag.make qa is now the gate — fmt-check vet tidy-check test leak-check bench
— which closes the “no test or quality gate” gap the v0.12.0-alpha.16 and
-alpha.17 notes both called out (#266, closed as absorbed into #270). Green on
571e5fb: gofmt clean, go vet clean, go mod tidy clean, go test -race
./... 53 packages ok / 0 FAIL, goroutine-leak profile clean over the four
timer-owning packages, benchmark set runs. The spec baseline
(release-0.12.0 @ fe5a799) was 40 packages ok / 0 FAIL; the growth is
packages these slices added, and there are no new failures.