fix(sdk): DSPX-4607 canonicalize DPoP headers and extract zipstream constants - #3973
Open
dmihalcik-virtru wants to merge 1 commit into
Open
fix(sdk): DSPX-4607 canonicalize DPoP headers and extract zipstream constants#3973dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 3, 2026
Contributor
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Contributor
This was referenced Sep 4, 2026
…onstants
golangci-lint v2.13.2 reports 12 findings in sdk:
- 7 canonicalheader: Header.Set/Get/Values called with non-canonical names.
Cosmetic only, since net/http canonicalizes via
textproto.CanonicalMIMEHeaderKey before the value reaches the wire.
- 2 goconst in the zip segment writer ("segment" x20, "finalize" x13).
- 2 QF1012 in the codegen runner.
- 1 SA1019 for a test that deliberately covers the deprecated
RewrapResponse.EntityWrappedKey field.
Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
dmihalcik-virtru
force-pushed
the
fix/lint-sdk-headers
branch
from
September 4, 2026 13:13
2a3dc4a to
cedc25e
Compare
Contributor
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Contributor
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the DSPX-4607 lint burndown, following the golangci-lint v2.13.2 bump (#3965). Branched from
main, independent of the other burndown PRs.What
12 findings in
sdk:7 ×
canonicalheader— cosmetic onlyNo wire behaviour changes.
http.Header'sSet/Get/Valuesrun every key throughtextproto.CanonicalMIMEHeaderKey, so"dpop","DPoP"and"Dpop"all resolve to the same canonicalDpopentry and serialize identically. This is a readability fix, not a protocol fix.Deliberately not touched:
headers.Set("typ", "dpop+jwt")atoauth.go:241— that's a JWT header, not an HTTP one.2 → 3 ×
goconstin the zip segment writerReported:
"segment"×20 and"finalize"×13. Extracted aserrTypeSegmentandopFinalize.Also extracted
opWriteSegment("write-segment"×7), which the linter didn't report: it first occurs on line 57 alongside"segment", anduniq-by-line: truecollapses the two. Fixing only the reported pair would have surfaced it as a fresh finding on the next run.2 ×
QF1012builder.WriteString(fmt.Sprintf(...))→fmt.Fprintf(&builder, ...)in the connect-wrapper generator. Verified byte-identical output: re-rango run ./sdk/codegen, which rewrites all ofsdk/sdkconnect/*.go, andjj statusshows no change to any generated file.1 ×
SA1019kas_client_test.gosets the deprecatedRewrapResponse.EntityWrappedKey. That's the entire point of the test —upgradeRewrapRequestV1exists to translate that legacy field — so it's annotated rather than migrated.Testing
Clean under both the current
mainconfig and the tuned config in #3968.Given the DPoP surface, this is worth an xtest run before merge even though the header changes are provably cosmetic.
DSPX-4607 burndown index
.golangci.yamlgoconst tuning +gomodguard_v2migration (merged)otdfctl), fix(kas): DSPX-4607 use snake_case slog key in rewrap test fake #3970 (service/kas), chore(core): DSPX-4607 drop stale lib/fixtures nolint directives and reuse keycloakBoolTrue #3971 (lib/fixtures), fix(examples): DSPX-4607 clear goconst and SA1019 lint findings #3974 (examples), fix(ci): DSPX-4607 clear tests-bdd goconst, gosec, nestif and sloglint findings #3975 (tests-bdd), fix(policy): DSPX-4607 clear sloglint and SA1019 lint findings #3977 (service/policy), fix(core): DSPX-4607 clear sloglint, goconst, nolintlint and SA1019 findings #3978 (servicecore)