Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 04:02
· 316 commits to main since this release
fbfff4b

Breaking Changes

Health moved from server.health to a top-level health section This was the last reloadable thing under server, which kept that whole section from being fixed at startup. The SERVER_HEALTH_* environment variables become HEALTH_* and Helm values moved to match.

Custom authentication returns a struct instead of four positional values. validate is now func validate(string) tilegroxy.ValidationResult, carrying Pass, Expiration, UserID, TenantID and AllowedLayers. The old shape had no room for the new tenant ID, and a struct means the next addition won't break anyone.

The Cache interface gained a Remove method. This only affects using tilegroxy as a library.

Error configuration is no longer partially reloadable. Most error message strings could previously be hot reloaded while the mode could not, which made for surprising half-applied reloads. The section is now fixed at startup alongside server.

ClientConfig.UnknownLength is now a *bool so a layer can inherit it like every other client field. Configuration is unchanged, this only affects using tilegroxy as a library.

TTL in AWS Secrets Manager Secreter changed meaning. Previously TTL controlled a cache of secrets, which had little effect because secrets were loaded at startup and never touched again. It now truly reflects how long secrets will live by triggering an automatic reload of secrets when TTL expires. See documentation for more details.

Highlights

Tenants. Authentication can now (optionally) attribute a request to a tenant as well as a user, for multitenant deployments. A new tenant cache that namespaces entries so one organization can't be served another's tile.

Layers can override their cache. The top-level cache can be a list of distinct configurations identified by id, and a layer picks one with cache: SOME_ID, including a cache nested inside another. The cache health check follows suit and covers every configured cache rather than just the default.

Dedicated configuration for critical HTTP headers. Cache-Control and CORS were previously hand-rolled through server.headers. Both are now first-class sections with helpers to make it more powerful than static headers. Cache-Control has an auto mode to infer its directives from the configuration. Both off by default.

Audit logging. A third log stream alongside main and access, carrying only security relevant events: auth_failure for a rejected request and config_reload recording the outcome and what triggered it. Off by default.

Secret rotation without a restart. Secrets gained a watch option that triggers the usual reload when a value changes, plus a ttl for periodic re-reads, so rotated upstream credentials take effect on their own.

Additional CLI commands. seed --purge allows deleting cached tiles over an area. config diff reports what changed in your new configuration and whether changes require a restart.

What's Changed

Features

  • Add support for a tenant ID alongside user ID by @Michad in #877
  • Add a tenant cache for namespacing entries per tenant by @Michad in #879
  • Allow layers to override which cache they use by @Michad in #927
  • Add first-class Cache-Control configuration with an automatic mode by @Michad in #1029
  • Add proper CORS support, including wildcard subdomains by @Michad in #1016
  • Add audit logging for authentication failures and config reloads by @Michad in #919
  • Support reloading when a watched secret rotates by @Michad in #1017
  • Add seed --purge for removing cached tiles by @Michad in #922
  • Add a config diff command by @Michad in #921
  • Add a --max-failures flag to seed and stop discarding per-tile render errors by @Michad in #874
  • Add --user and --tenant to the seed and test commands by @Michad in #939
  • Support a layout in the disk cache so entries aren't all in one directory by @Michad in #1014
  • Check every configured cache in the cache health check by @Michad in #954
  • Log and swallow recoverable errors in the multi cache instead of failing the request by @Michad in #1015
  • Record whether a tile was served from cache in analytics by @Michad in #878
  • Improve coalescing autodetection and include the tenant in the coalescing key by @Michad in #955
  • Make secreters support Close so a reload doesn't leak their cache and goroutines by @Michad in #1006
  • Move health from server to the top level so server is fully non-reloadable by @Michad in #938
  • Make error handling fully non-reloadable and avoid partial reloads by @Michad in #938

Fixes

  • Fix a ref provider bug where a fresh request context dropped auth restrictions, bypassing crop boundsfromauth by @Michad in #875
  • Fix blend preauth filing each child's auth context under the wrong provider index by @Michad in #956
  • Fix blend re-running preauth on every request when a bypass child zeroed the expiration by @Michad in #952
  • Re-order the blend preauth channel flow so a panicking child can't deadlock the layer by @Michad in #913
  • Fix fallback swallowing ProviderAuthError and defeating the credential refresh retry by @Michad in #981
  • Fix a nil pointer dereference in fallback when the secondary provider also fails by @Michad in #910
  • Fix crop dropping the secondary provider's forceskipcache, plus a related nil risk by @Michad in #980
  • Fix static handing out its original image, which permanently disabled caching for it by @Michad in #953
  • Fix goroutine leaks and permanently poisoned tiles when a compositemvt child errors by @Michad in #871
  • Handle 16-bit to 8-bit color conversion properly in transform by @Michad in #1013
  • Clamp negative threads in transform to 1 instead of panicking on every request by @Michad in #903
  • Validate effect intensity values at startup rather than deferring an OOM to the first request by @Michad in #1008
  • Add defensive nil checks in the effect, transform, crop and cropmvt providers by @Michad in #984
  • Avoid unchecked type assertions on Yaegi script functions panicking on a wrong signature by @Michad in #904
  • Log a warning for {X.Y} placeholders that don't resolve instead of silently substituting the literal by @Michad in #982
  • Strip # from #RRGGBB colors, which never parsed by @Michad in #902
  • Guard the package-level image maps with a mutex and stop caching in health checks by @Michad in #869
  • Mitigate a truncated cache payload decoding as a valid empty tile by @Michad in #985
  • Allow Redis ring servers to share a host on different ports by @Michad in #983
  • Add the missing cache ID uniqueness check so a nested ID isn't silently overwritten by @Michad in #957
  • Fix the single-map cache form ignoring name when deriving the ID by @Michad in #951
  • Allow unknownlength to be overridden by the layer client config by @Michad in #1012
  • Avoid coalescing stripping the request deadline and hanging on a wedged upstream query by @Michad in #918
  • Avoid an unrated JWKS refresh on an unknown kid, which let unauthenticated requests amplify to the issuer by @Michad in #907
  • Close the JWKS background poller on a startup fetch failure or a failed reload by @Michad in #978
  • Include the missing value in the unknown kid error message by @Michad in #979
  • Return an error instead of panicking when an AWS secret has no string value by @Michad in #916
  • Stop scanning for secret changes after repeated failed reload attempts by @Michad in #1017
  • Close entities constructed before an aborted reload instead of leaking them by @Michad in #906
  • Stop a failed health rebuild on reload from closing the live generation's entities by @Michad in #872
  • Reload health before everything else by @Michad in #872
  • Recover from panics in the hot reload goroutine so an Initialize panic can't kill a live server by @Michad in #912
  • Recover from panics in the generation teardown goroutine by @Michad in #914
  • Recover from panics in the analytics batcher workers by @Michad in #908
  • Keep the config watcher alive through a delete-and-recreate save by @Michad in #905
  • Guard the analytics registry with a mutex by @Michad in #915
  • Flush analytics on shutdown even when an earlier phase exhausts the budget by @Michad in #909
  • Add write and idle timeouts at the server level so a slow-reading client can't park handler goroutines by @Michad in #1007
  • Reject a server.timeout of 0, which made every request return 503 by @Michad in #901
  • Swap the CORS and timeout handlers so a timeout error still carries CORS headers by @Michad in #1028
  • Handle IPv6 addresses in the access and audit logs by @Michad in #1005
  • Stop MultiHandler.Handle discarding all but the last handler's error by @Michad in #911
  • Error on an empty paramvalidator value instead of panicking on hot reload by @Michad in #873
  • Fail the tile health check when the provider returns a nil image by @Michad in #976
  • Allow health to be disabled by @Michad in #938
  • Fix seed longitude normalization subtracting 180 instead of 360 by @Michad in #950
  • Validate backwards latitude bounds in a bounding box by @Michad in #1011
  • Give a clear error for antimeridian-crossing seed coordinates instead of an absurd tile count by @Michad in #975
  • Unswap the test command's -x and -y flags by @Michad in #870
  • Reject test --threads 0, which silently tested nothing and exited 0 by @Michad in #900
  • Remove an extra argument from three postgismvt error messages by @Michad in #1010
  • Clean up stray characters and missing values in error messages by @Michad in #919
  • Make documentation paths more forgiving so directory doc URLs don't 500 by @Michad in #977
  • Fix gosec suppressions so findings surface properly in CI by @Michad in #868

Documentation

  • Add a how-to for layers that vary by user, covering cache leakage by @Michad in #986
  • Include the examples directory in the deployed docs by @Michad in #928
  • Various doc fixes by @Michad in #958
  • Make the shutdown tests less fragile with timing by @Michad in #909
  • Rework the file watch to avoid a race causing CI failures by @Michad in #917
  • Ensure logs flush before being killed on close by @Michad in #1009

Dependencies

  • security(go): bump go.opentelemetry.io/contrib/bridges/otelslog from 0.20.0 to 0.20.1 by @dependabot[bot] in #848
  • security(go): bump golang.org/x/crypto from 0.55.0 to 0.56.0 by @dependabot[bot] in #849
  • security(go): bump go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp from 0.21.0 to 0.22.0 by @dependabot[bot] in #850
  • security(go): bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.70.0 to 0.71.0 by @dependabot[bot] in #851
  • security(go): bump github.com/aws/aws-sdk-go-v2/credentials from 1.19.37 to 1.20.2 by @dependabot[bot] in #852
  • build(deps): bump js-yaml from 4.1.1 to 5.4.1 in the npm_and_yarn group across 1 directory by @dependabot[bot] in #853
  • security(go): bump google.golang.org/grpc from 1.83.1 to 1.83.2 in the go_modules group across 1 directory by @dependabot[bot] in #867
  • security(go): golang 1.26.5 to 1.26.6 by @Michad in #876
  • security(docker): bump node from 871eb67 to a3024fa by @dependabot[bot] in #880
  • security(go): bump github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager from 0.3.15 to 0.4.6 by @dependabot[bot] in #930
  • security(go): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.45.0 to 1.46.0 by @dependabot[bot] in #931
  • security(go): bump github.com/lestrrat-go/jwx/v3 from 3.2.0 to 3.3.0 by @dependabot[bot] in #932
  • security(go): bump golang.org/x/sync from 0.22.0 to 0.23.0 by @dependabot[bot] in #933
  • security(go): bump github.com/aws/aws-sdk-go-v2 from 1.45.1 to 1.47.0 by @dependabot[bot] in #935
  • security(actions): bump github/codeql-action from 4.37.9 to 4.38.0 by @dependabot[bot] in #940
  • security(actions): bump reviewdog/action-suggester from 1.24.3 to 1.25.0 by @dependabot[bot] in #941
  • security(docker): bump node from a3024fa to 996a99c by @dependabot[bot] in #971
  • security(docker): bump alpine from 3.24.1 to 3.24.2 by @dependabot[bot] in #972
  • security(actions): bump docker/build-push-action from 7.3.0 to 7.4.0 by @dependabot[bot] in #973
  • security(actions): bump docker/setup-buildx-action from 4.3.0 to 4.4.0 by @dependabot[bot] in #974
  • security(actions): bump github/codeql-action/upload-sarif from 4.38.0 to 4.38.1 by @dependabot[bot] in #1021
  • security(go): bump github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager from 0.4.6 to 0.4.7 by @dependabot[bot] in #1022
  • security(actions): bump reviewdog/action-suggester from 1.25.0 to 1.26.0 by @dependabot[bot] in #1024
  • security(go): bump golang.org/x/crypto from 0.56.0 to 0.57.0 by @dependabot[bot] in #1026
  • security(go): bump github.com/anthonynsimon/bild from 0.17.0 to 0.17.1 by @dependabot[bot] in #1027
  • security(actions): bump github/codeql-action from 4.38.0 to 4.38.1 by @dependabot[bot] in #1030

Full Changelog: v0.11.0...v0.12.0