Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
Notable changes to this service, newest first, per release. This file is written for whoever
runs the service or integrates against it.

## v0.1.3

A security release. A token exchanged on a caller's behalf is no longer reused for a different token of the same
person, and **the service now builds with Go 1.27.3**. Nothing about the API, the configuration or the database
changes.

### Security

- **The authentication library moves to `go-authbyte` v0.31.1.** It caches a token exchanged on a caller's behalf
under the caller's own token, not under the person alone, and stops reusing it once that token has expired.
Before, a person whose token was renewed with different claims (another organisation, a stronger sign-in) could
have this service's onward calls carried for a few minutes by the token exchanged for the earlier one. Nothing to
configure; one more exchange per renewed token.
- **Go 1.27.3** (was 1.27.2), in `go.mod` and as the image's default build toolchain (`ARG GO_VERSION` in the
`Dockerfile`). Go 1.27.3 fixes GO-2026-6809 in `crypto/x509`, which code making TLS calls reaches. **Rebuild the
image to pick the fix up.**

### Changed

- **Libraries:** azugo → v0.40.1, `fasthttp` → v1.76.0, `valkey-go` → v1.0.79, `go-jose` → v4.1.6, `go-pdfium` → v1.21.4,
plus their indirect modules.
- **Go 1.27.4 and azugo v0.50.2** (go-authbyte v0.46.0, go-platform-kit v1.13.0, go-sec-events v1.3.0), in `go.mod`
and as the image's default build toolchain (`ARG GO_VERSION` in the `Dockerfile`). **Rebuild the image to pick
them up.** Request bodies the framework reads are held to its limit (413 over 4 MiB); this service's routes take
no request body, so nothing changes for callers.

## v0.1.2

A security release. **The service now builds with Go 1.27.2**, and its libraries move to their Go
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.27.2
ARG GO_VERSION=1.27.4

FROM golang:${GO_VERSION} AS build
WORKDIR /src
Expand Down
14 changes: 12 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ type App struct {

// New constructs the application.
func New(cmd *cobra.Command, version string) (*App, error) {
return newApp(cmd, version, true)
}

// newApp constructs the application. With startRenderer false no renderer is
// started, for a caller that injects its own: starting one compiles the whole
// WebAssembly engine.
func newApp(cmd *cobra.Command, version string, startRenderer bool) (*App, error) {
config := NewConfiguration()

a, err := server.New(cmd, server.Options{
Expand All @@ -74,14 +81,14 @@ func New(cmd *cobra.Command, version string) (*App, error) {
}

app := &App{App: a, config: config}
if err := app.init(); err != nil {
if err := app.init(startRenderer); err != nil {
return nil, err
}

return app, nil
}

func (a *App) init() error {
func (a *App) init(startRenderer bool) error {
cfg := a.config

// Platform glue FIRST: logging + redaction, tracing, correlation.
Expand Down Expand Up @@ -129,6 +136,9 @@ func (a *App) init() error {
// to PDF via that converter and delegates rendering to the same PDF path; when
// it's unset, Office MIME types are simply absent from what this instance can
// preview — no failure mode, the same as any other unconfigured type.
if !startRenderer {
return nil
}
a.renderer, err = render.NewDispatch(cfg.RenderConfig())
if err != nil {
return fmt.Errorf("previewbyte: renderer: %w", err)
Expand Down
56 changes: 28 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
module github.com/go-make-bytes/previewbyte

go 1.27.2
go 1.27.4

require (
azugo.io/azugo v0.40.0
azugo.io/core v0.40.0
github.com/gmb-lib/go-authbyte v0.29.1
github.com/gmb-lib/go-platform-kit v1.11.4
github.com/gmb-lib/go-sec-events v1.2.2
azugo.io/azugo v0.50.2
azugo.io/core v0.50.1
github.com/gmb-lib/go-authbyte v0.46.0
github.com/gmb-lib/go-platform-kit v1.13.0
github.com/gmb-lib/go-sec-events v1.3.0
github.com/go-quicktest/qt v1.102.0
github.com/klippa-app/go-pdfium v1.21.3
github.com/klippa-app/go-pdfium v1.21.4
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
github.com/valyala/fasthttp v1.75.0
github.com/valyala/fasthttp v1.79.0
go.uber.org/zap v1.28.0
golang.org/x/image v0.47.0
)

require (
azugo.io/opentelemetry v0.40.0 // indirect
github.com/VictoriaMetrics/metrics v1.44.1 // indirect
azugo.io/opentelemetry v0.50.0 // indirect
github.com/VictoriaMetrics/metrics v1.45.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cenkalti/backoff/v7 v7.0.1 // indirect
github.com/cenkalti/backoff/v7 v7.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.4.2 // indirect
github.com/dustin/go-humanize v1.1.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
github.com/go-jose/go-jose/v4 v4.1.5 // indirect
github.com/gabriel-vasile/mimetype v1.4.16 // indirect
github.com/go-jose/go-jose/v4 v4.1.9 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.2 // indirect
github.com/go-playground/universal-translator v0.18.2 // indirect
github.com/go-playground/validator/v10 v10.30.5 // indirect
github.com/go-playground/validator/v10 v10.30.6 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/goccy/go-json v0.11.2 // indirect
github.com/goccy/go-json v0.12.0 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.31.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jolestar/go-commons-pool/v2 v2.1.2 // indirect
github.com/klauspost/compress v1.20.1 // indirect
github.com/klauspost/compress v1.20.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lafriks/http2 v0.6.1 // indirect
github.com/lafriks/pkcs8 v1.2.4 // indirect
github.com/leodido/go-urn v1.5.0 // indirect
github.com/mattn/go-colorable v0.1.16 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/molecule-man/go-brrr v1.2.0 // indirect
github.com/molecule-man/go-brrr v1.3.1 // indirect
github.com/oklog/ulid/v2 v2.1.2 // indirect
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -59,10 +59,10 @@ require (
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/pflag v1.1.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tetratelabs/wazero v1.12.0 // indirect
github.com/valkey-io/valkey-go v1.0.78 // indirect
github.com/valkey-io/valkey-go v1.0.80 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fastrand v1.1.0 // indirect
github.com/valyala/histogram v1.2.0 // indirect
Expand All @@ -86,13 +86,13 @@ require (
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
go.uber.org/atomic v1.12.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/crypto v0.58.0 // indirect
golang.org/x/net v0.61.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/text v0.43.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261005182115-fad411399dd8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8 // indirect
google.golang.org/grpc v1.84.0 // indirect
go.yaml.in/yaml/v3 v3.0.6 // indirect
golang.org/x/crypto v0.59.0 // indirect
golang.org/x/net v0.62.0 // indirect
golang.org/x/sys v0.50.0 // indirect
golang.org/x/text v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261116203732-fd2c7689a808 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261116203732-fd2c7689a808 // indirect
google.golang.org/grpc v1.85.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
)
Loading
Loading