35 Commits
Author SHA1 Message Date
Trong Huu Nguyen 4d67da8e61 test(crypto): generate JWK fixtures for any signature algorithm
Client assertion signing is algorithm-agnostic, but the fixtures only
produced RS256 keys, so nothing proved it. Covers RSA, ECDSA and Ed25519,
including both RFC 9864 identifiers.

Also drops a kty assignment that jwx ignores and that would have mislabelled
non-RSA keys had it taken effect.
2026-08-10 12:34:22 +02:00
Trong Huu Nguyen aa74b67a33 refactor: remove unreachable functions
Both were reported by deadcode: retry.WithBase was never used, and
PrometheusMiddleware.Initialize is a leftover from the chi-prometheus
code this middleware was adapted from.
2026-07-28 12:52:45 +02:00
Trong Huu Nguyen 0d6d4a0dff fix(http): encode the unauthenticated response as JSON
The response was built by concatenating the request path into a JSON
string. The path is percent-decoded, so it can contain quotes and
backslashes, which produced malformed JSON and let a caller inject
arbitrary keys into the object.
2026-07-28 11:43:54 +02:00
Trong Huu Nguyen c56625d842 fix: check or explicitly ignore returned errors
Satisfies errcheck. Errors that carry no actionable information are
ignored explicitly: writes to an already-committed response, and closing
a fully read response body or file.

Test fixture setup asserts with require.NoError instead, since a failure
there means the fixture itself is broken.
2026-07-28 09:04:59 +02:00
Trong Huu Nguyen f8b672549a fix(otel): use NewSchemaless to avoid semconv schema URL conflicts 2026-05-29 08:34:27 +02:00
Trong Huu Nguyen 0ca1c2425c fix(otel): disable internal logs from otel libraries
These logs are often seen only due to timeouts, connection errors or other downstream errors, which aren't actionable as consumers.
2026-03-18 08:43:07 +01:00
Trong Huu Nguyen 8fba8ec5eb build(deps): bump various dependencies 2026-03-10 08:33:50 +01:00
Trong Huu Nguyen 02842773d3 style: go fix 2026-03-03 08:35:11 +01:00
Trong Huu Nguyen d82186481c build(deps): otel@v1.40.0 2026-02-10 08:59:18 +01:00
Trong Huu Nguyen 78f9a82cf4 build(deps): bump otel 2025-09-23 09:17:28 +02:00
Trong Huu Nguyen 75ff84ba28 refactor: suppress some noisy startup logs 2025-07-09 13:33:40 +02:00
Trong Huu Nguyen a3f0350629 build(deps): bump otel dependencies 2025-07-01 14:03:05 +02:00
Trong Huu Nguyen 4bf3b1bdd4 refactor: move string generator to crypto package 2025-06-16 09:55:44 +02:00
Trong Huu Nguyen 1a138c66a3 refactor: move retry package 2025-06-16 09:55:42 +02:00
Trong Huu Nguyen 259bf635d1 chore(deps): bump github.com/lestrrat-go/jwx from v2 to v3 2025-05-21 10:38:26 +02:00
Trong Huu Nguyen 126db31d25 feat: restrict non-navigational requests to oauth2-routes for all modes 2025-04-02 11:53:29 +02:00
Trong Huu Nguyen 2e8c7075ff fix: set content-type header before status 2025-02-03 11:38:35 +01:00
Trong Huu Nguyen ed02b782fe refactor(http): inline navigation check in middleware 2025-02-03 08:41:59 +01:00
Trong Huu Nguyen e70fb00318 refactor(http): rename attribute keys for consistency 2025-01-31 16:50:07 +01:00
Trong Huu Nguyen 4b1bdef5cd feat: disallow non-navigational requests to login and logout endpoints 2025-01-31 16:42:24 +01:00
Trong Huu Nguyenandsindrerh2 787b54beeb refactor(crypto): move to internal
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:36 +01:00
Trong Huu Nguyenandsindrerh2 85230d5403 feat(session): add trace spans and attributes
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:35 +01:00
Trong Huu Nguyenandsindrerh2 a157a13b9c refactor(o11y): separate logging and otel packages
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:34 +01:00
Trong Huu Nguyenandsindrerh2 21b85c4b54 feat(handler/reverseproxy): add trace spans with attributes
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:34 +01:00
Trong Huu Nguyenandsindrerh2 dc4c563b26 feat(otel): set more resource attributes
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:33 +01:00
Sindre Rødseth HansenandTrong Huu Nguyen 1ed1b611af refactor(otel): clean up shutdown hook
Co-authored-by: tronghn <trong.huu.nguyen@nav.no>
2025-01-30 14:03:32 +01:00
Trong Huu Nguyenandsindrerh2 bd2ec2dcf2 refactor(otel): move logrus hook to otel
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:31 +01:00
Sindre Rødseth HansenandTrong Huu Nguyen ca77435d6a feat(http): propagate traceparent for httpclient
Co-authored-by: tronghn <trong.huu.nguyen@nav.no>
2025-01-30 14:03:30 +01:00
Trong Huu Nguyenandsindrerh2 e1ed2033cf refactor(middleware): extract tracing to separate handler
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:29 +01:00
Trong Huu Nguyenandsindrerh2 10360958c0 feat(middleware): clean up logging middleware, add span attributes
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:29 +01:00
Trong Huu Nguyenandsindrerh2 1f730a3d68 refactor: move logging to observability package
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:27 +01:00
Trong Huu Nguyenandsindrerh2 81058458e0 feat: add logrus hook for opentelemetry
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:27 +01:00
Trong Huu Nguyen 3fd8e3f3f3 refactor(otel): clean up error handling 2025-01-30 14:03:24 +01:00
Trong Huu Nguyenandsindrerh2 b7524f516d refactor(otel): move to observability package
Co-authored-by: sindrerh2 <sindre.rodseth.hansen@nav.no>
2025-01-30 14:03:21 +01:00
Trong Huu Nguyen 39207677b5 feat(middleware/logentry): add fields for sec-fetch headers 2025-01-24 09:13:59 +01:00