middleware tests construct cookie stores by hand, so they no longer match the production store #154
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Disclosed by the review of #132, which judged it below the bar for rework there.
#132 moved the production store onto
store.MaxAge(...)so the securecookie codecs share the 7-day cap.internal/middleware/middleware_test.go:67and:850still build lookalike stores by assigningstore.Optionsdirectly, which leaves their codecs at gorilla's 30-day default.The cause is reachability, not oversight:
NewStoreis exported throughinternal/session/export_test.go, so packagemiddlewarecannot reach the production constructor and has to hand-roll one.No false green today — nothing in
middlewareasserts on codec age — but the divergence is invisible and will silently outlive the next change to store construction.Definition of done
NewStoremoves frominternal/session/export_test.gointo the existinginternal/session/testing.goso other packages can use it.internal/middleware/middleware_test.go:67and:850construct their stores through it.store.Options.Implementation requirements
next, PR based onnext, single commit, title ending(closes #N).TODO.md.make checkplus the Docker lint path with the cache defeated (#119).