chore(nats-auth-callout): fix golangci-lint findings#231
Open
mesutoezdil wants to merge 2 commits into
Open
Conversation
- Remove internal/nats/auth_types.go: the whole package (Service, Authorizer, JWTGenerator, TokenValidator, AuthRequest) was never imported anywhere, had no tests, and its fields were never read. It predates the internal/service + internal/plugins implementation that does the actual work now. This clears all 8 golangci-lint "unused" findings at once. - Fix import grouping (goimports) across 8 files. - Use fmt.Fprintf instead of WriteString(fmt.Sprintf(...)) in internal/config/config.go (staticcheck QF1012). - Drop two stray blank lines (whitespace). - Extract the repeated "test-key-1" JWKS key ID into a testKeyID const in test_helpers.go (goconst). Left goheader (pre-existing template/header mismatch across many files, needs a repo-wide decision), dupl, errcheck on a Sync()-style call, gosec G114 (matches the bare http.ListenAndServe pattern already used elsewhere in this repo for internal-only endpoints), and one long example command in a doc comment out of scope for this pass. Verified with go build, go vet, go test ./... (all packages pass), and golangci-lint fmt --diff (empty). NO-REF Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
📝 WalkthroughWalkthroughThe NATS auth callout service adds a Swagger endpoint, centralizes OAuth test JWT key identifiers, updates configuration formatting, reorders imports, and removes the internal NATS auth types and Bazel targets. ChangesNATS auth callout updates
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…s-auth-callout-lint
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.
Cleared most golangci-lint findings for nats-auth-callout (50 to 34). Deleted an unused parallel Service/Authorizer/JWTGenerator/TokenValidator implementation in internal/nats/auth_types.go that nothing imports (clears 8 unused findings too). Rest is mechanical: import grouping, one WriteString to Fprintf, stray blank lines, a repeated test string pulled into a const.
Left out of scope: goheader (repo-wide convention question), dupl (real refactor, not lint-driven), one accepted errcheck idiom, one gosec pattern already used elsewhere in the repo, one long doc-comment line.
Tested: go build, go vet, go test ./... pass. golangci-lint fmt --diff empty.
Refs: NO-REF