Skip to content

Commit ee7e74d

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr-825
2 parents 061a259 + 4477a1f commit ee7e74d

125 files changed

Lines changed: 6973 additions & 2377 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/LogSchema.json‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "Stellabill Log Schema",
4-
"description": "JSON schema for structured log entries",
4+
"description": "JSON schema for structured log entries. The project accepts both legacy `time` and canonical `timestamp` names for compatibility while requiring a timestamp, level, and msg payload.",
55
"type": "object",
6-
"required": ["time", "level", "msg", "request_id", "trace_id", "tenant_id"],
6+
"required": ["level", "msg"],
7+
"anyOf": [
8+
{ "required": ["time"] },
9+
{ "required": ["timestamp"] }
10+
],
711
"properties": {
812
"time": {
913
"type": "string",
1014
"format": "date-time",
11-
"description": "Timestamp of the log entry"
15+
"description": "Legacy timestamp field for structured log entries"
16+
},
17+
"timestamp": {
18+
"type": "string",
19+
"format": "date-time",
20+
"description": "Canonical timestamp field for structured log entries"
1221
},
1322
"level": {
1423
"type": "string",
@@ -55,5 +64,6 @@
5564
"type": "string",
5665
"description": "Client IP address"
5766
}
58-
}
67+
},
68+
"additionalProperties": true
5969
}

‎docs/admin-signing.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All admin API requests must be signed with an HMAC-SHA256 signature to ensure au
1010

1111
Every admin API request must include the following headers:
1212

13-
1. `X-Stellabill-Date`: Unix timestamp in seconds (UTC) when the request was created. The timestamp must be within ±60 seconds of the server's current time.
13+
1. `X-Stellabill-Date`: Unix timestamp in seconds (UTC) when the request was created. The timestamp must be within °60 seconds of the server's current time.
1414
2. `X-Stellabill-Request-ID`: A unique identifier for this request (e.g., a UUID). This is used to prevent replay attacks.
1515
3. `X-Stellabill-Signature`: The HMAC-SHA256 signature of the canonical request, prefixed with `v1=`.
1616

@@ -19,17 +19,17 @@ Every admin API request must include the following headers:
1919
The canonical request is a string constructed as follows:
2020

2121
```
22-
<Method>
23-
<Path>
24-
<QueryString>
25-
<SignedHeaders>
26-
<SignedHeadersNames>
27-
<BodyHash>
22+
[Method]
23+
[Path]
24+
[QueryString]
25+
[SignedHeaders]
26+
[SignedHeadersNames]
27+
[BodyHash]
2828
```
2929

3030
### Component Details
3131

32-
1. **Method**: The HTTP method in uppercase (e.g., `POST`, `GET`).
32+
1. **Method**: The HTTP method in uppercase (e.g., `Post`, `GET`).
3333
2. **Path**: The URL path (e.g., `/api/admin/purge`). If empty, use `/`.
3434
3. **QueryString**: The sorted, URL-encoded query parameters, joined with `&`. Parameters are sorted lexicographically by key, then by value.
3535
4. **SignedHeaders**: The signed headers in the format `key:value\n` for each header. The keys are lowercase and values are trimmed.
@@ -86,7 +86,7 @@ const secret = "your-admin-signing-secret";
8686
const canonicalRequest = "..."; // as above
8787

8888
const hmac = crypto.createHmac("sha256", secret);
89-
hmac.update(canonicalRequest);
89+
mic,update(canonicalRequest);
9090
const signature = "v1=" + hmac.digest("hex");
9191
```
9292

‎go.mod‎

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/DATA-DOG/go-sqlmock v1.5.2
77
github.com/Masterminds/squirrel v1.5.4
88
github.com/alicebob/miniredis/v2 v2.34.0
9+
github.com/andybalholm/brotli v1.2.3
910
github.com/bytedance/sonic v1.15.0
1011
github.com/docker/docker v28.5.2+incompatible
1112
github.com/docker/go-connections v0.6.0
@@ -14,39 +15,53 @@ require (
1415
github.com/go-playground/validator/v10 v10.30.1
1516
github.com/golang-jwt/jwt/v5 v5.3.1
1617
github.com/google/uuid v1.6.0
18+
github.com/google/wire v0.7.0
1719
github.com/gorilla/websocket v1.5.3
1820
github.com/graphql-go/graphql v0.8.1
1921
github.com/jackc/pgx/v5 v5.9.1
22+
github.com/klauspost/compress v1.18.5
2023
github.com/lestrrat-go/jwx/v2 v2.1.6
2124
github.com/lib/pq v1.12.0
2225
github.com/open-policy-agent/opa v1.18.2
2326
github.com/prometheus/client_golang v1.23.2
2427
github.com/redis/go-redis/v9 v9.7.1
28+
github.com/segmentio/kafka-go v0.4.47
2529
github.com/shopspring/decimal v1.4.0
2630
github.com/sirupsen/logrus v1.9.4
2731
github.com/sony/gobreaker v1.0.0
28-
github.com/spiffe/go-spiffe/v2 v2.6.0
29-
github.com/stretchr/testify v1.11.1
32+
github.com/spiffe/go-spiffe/v2 v2.7.0
33+
github.com/stretchr/testify v1.12.1
3034
github.com/testcontainers/testcontainers-go v0.41.0
3135
github.com/testcontainers/testcontainers-go/modules/postgres v0.41.0
3236
github.com/xeipuuv/gojsonschema v1.2.0
3337
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.67.0
34-
go.opentelemetry.io/otel v1.44.0
35-
go.opentelemetry.io/otel/sdk v1.44.0
36-
go.opentelemetry.io/otel/trace v1.44.0
38+
go.opentelemetry.io/otel v1.46.0
39+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.22.0
40+
go.opentelemetry.io/otel/log v0.22.0
41+
go.opentelemetry.io/otel/sdk v1.46.0
42+
go.opentelemetry.io/otel/sdk/log v0.22.0
43+
go.opentelemetry.io/otel/trace v1.46.0
3744
go.uber.org/zap v1.27.1
38-
golang.org/x/text v0.38.0
45+
golang.org/x/text v0.41.0
3946
golang.org/x/time v0.15.0
47+
google.golang.org/grpc v1.83.1
4048
gopkg.in/yaml.v3 v3.0.1
4149
pgregory.net/rapid v1.1.0
4250
)
4351

52+
require (
53+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect
54+
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
55+
google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect
56+
)
57+
4458
require (
4559
dario.cat/mergo v1.0.2 // indirect
4660
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
4761
github.com/Microsoft/go-winio v0.6.2 // indirect
4862
github.com/agnivade/levenshtein v1.2.1 // indirect
4963
github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect
64+
github.com/andybalholm/brotli v1.2.3
5065
github.com/beorn7/perks v1.0.1 // indirect
5166
github.com/bytedance/gopkg v0.1.3 // indirect
5267
github.com/bytedance/sonic/loader v0.5.0 // indirect
@@ -59,33 +74,31 @@ require (
5974
github.com/containerd/log v0.1.0 // indirect
6075
github.com/containerd/platforms v0.2.1 // indirect
6176
github.com/cpuguy83/dockercfg v0.3.2 // indirect
62-
github.com/davecgh/go-spew v1.1.1 // indirect
6377
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
6478
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
6579
github.com/distribution/reference v0.6.0 // indirect
6680
github.com/docker/go-units v0.5.0 // indirect
6781
github.com/ebitengine/purego v0.10.0 // indirect
68-
github.com/felixge/httpsnoop v1.0.4 // indirect
82+
github.com/felixge/httpsnoop v1.1.0 // indirect
6983
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
7084
github.com/gin-contrib/sse v1.1.0 // indirect
7185
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
72-
github.com/go-logr/logr v1.4.3 // indirect
86+
github.com/go-logr/logr v1.4.4 // indirect
7387
github.com/go-logr/stdr v1.2.2 // indirect
7488
github.com/go-ole/go-ole v1.2.6 // indirect
75-
github.com/go-openapi/jsonpointer v0.21.0 // indirect
76-
github.com/go-openapi/swag v0.23.0 // indirect
89+
github.com/go-openapi/jsonpointer v1.0.0 // indirect
7790
github.com/go-playground/locales v0.14.1 // indirect
7891
github.com/go-playground/universal-translator v0.18.1 // indirect
7992
github.com/gobwas/glob v0.2.3 // indirect
8093
github.com/goccy/go-json v0.10.6 // indirect
8194
github.com/goccy/go-yaml v1.19.2 // indirect
82-
github.com/google/wire v0.7.0 // indirect
95+
github.com/google/wire v0.7.0
8396
github.com/jackc/pgpassfile v1.0.0 // indirect
8497
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
8598
github.com/jackc/puddle/v2 v2.2.2 // indirect
8699
github.com/josharian/intern v1.0.0 // indirect
87100
github.com/json-iterator/go v1.1.12 // indirect
88-
github.com/klauspost/compress v1.18.5 // indirect
101+
github.com/klauspost/compress v1.18.5
89102
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
90103
github.com/kylelemons/godebug v1.1.0 // indirect
91104
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
@@ -125,19 +138,16 @@ require (
125138
github.com/perimeterx/marshmallow v1.1.5 // indirect
126139
github.com/pierrec/lz4/v4 v4.1.15 // indirect
127140
github.com/pkg/errors v0.9.1 // indirect
128-
github.com/pmezard/go-difflib v1.0.0 // indirect
129141
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
130142
github.com/prometheus/client_model v0.6.2 // indirect
131143
github.com/prometheus/common v0.67.5 // indirect
132144
github.com/prometheus/procfs v0.20.1 // indirect
133145
github.com/quic-go/qpack v0.6.0 // indirect
134146
github.com/quic-go/quic-go v0.59.0 // indirect
135147
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
136-
github.com/redis/go-redis/v9 v9.7.1 // indirect
137148
github.com/segmentio/asm v1.2.1 // indirect
138-
github.com/segmentio/kafka-go v0.4.47 // indirect
139149
github.com/shirou/gopsutil/v4 v4.26.2 // indirect
140-
github.com/stretchr/objx v0.5.2 // indirect
150+
github.com/stretchr/objx v0.5.3 // indirect
141151
github.com/tchap/go-patricia/v2 v2.3.3 // indirect
142152
github.com/tklauser/go-sysconf v0.3.16 // indirect
143153
github.com/tklauser/numcpus v0.11.0 // indirect
@@ -151,23 +161,20 @@ require (
151161
github.com/yashtewari/glob-intersection v0.2.0 // indirect
152162
github.com/yuin/gopher-lua v1.1.1 // indirect
153163
github.com/yusufpapurcu/wmi v1.2.4 // indirect
154-
github.com/zeebo/errs v1.3.0 // indirect
155164
go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect
156165
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
157-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
158-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect
159-
go.opentelemetry.io/otel/metric v1.44.0 // indirect
166+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
167+
go.opentelemetry.io/otel/metric v1.46.0 // indirect
160168
go.uber.org/multierr v1.10.0 // indirect
161169
go.yaml.in/yaml/v2 v2.4.4 // indirect
162-
go.yaml.in/yaml/v3 v3.0.4 // indirect
170+
go.yaml.in/yaml/v3 v3.0.5 // indirect
163171
golang.org/x/arch v0.24.0 // indirect
164-
golang.org/x/crypto v0.52.0 // indirect
165-
golang.org/x/net v0.55.0 // indirect
166-
golang.org/x/sync v0.21.0 // indirect
167-
golang.org/x/sys v0.45.0 // indirect
168-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
169-
google.golang.org/grpc v1.81.1 // indirect
170-
google.golang.org/protobuf v1.36.11 // indirect
171-
pgregory.net/rapid v1.1.0 // indirect
172+
golang.org/x/crypto v0.55.0
173+
golang.org/x/net v0.58.0 // indirect
174+
golang.org/x/sync v0.22.0
175+
golang.org/x/sys v0.47.0 // indirect
176+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect
177+
google.golang.org/grpc v1.83.1
178+
google.golang.org/protobuf v1.36.12 // indirect
172179
sigs.k8s.io/yaml v1.6.0 // indirect
173180
)

0 commit comments

Comments
 (0)