linted #2245
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2245/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1665
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1665
Original created: 2025-09-28T21:47:42Z
Original updated: 2025-09-28T21:49:11Z
Original head: carverauto/serviceradar:chore/linter_updates_jwks
Original base: main
Original merged: 2025-09-28T21:48:11Z by @mfreeman451
PR Type
Other
Description
Fix indentation from spaces to tabs throughout file
Add blank lines for better code readability
Remove trailing whitespace and unused code
Diagram Walkthrough
File Walkthrough
server.go
Code formatting and indentation fixespkg/core/api/server.go
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1665#issuecomment-3344291071
Original created: 2025-09-28T21:48:11Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Possible Issue
In NewAPIServer, variable s is now initialized (tabs vs spaces change surfaced it). Ensure s is declared before it's used for kvPutFn/kvGetFn; otherwise this would not compile. Verify that no merge conflict removed the declaration outside of the shown hunk.
Type Assertion Risk
handleJWKS type-asserts s.authService to *auth.Auth to access Config(). If a different implementation is used, JWKS returns an empty set. Confirm Config() exists and exported, and consider a safer interface-based method to obtain public keys to avoid brittle coupling.
Content Construction
handleOIDCDiscovery builds JSON via string concatenation. This risks formatting/escaping issues and is harder to maintain. Prefer struct + json.Marshal to ensure valid JSON and correct escaping.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1665#issuecomment-3344291787
Original created: 2025-09-28T21:49:11Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Automate formatting instead of manual changes
Instead of submitting large manual formatting changes, the project should adopt
an automated formatting tool like
gofmt. This should be enforced via CI orpre-commit hooks to maintain consistency without creating noisy commits.
Examples:
pkg/core/api/server.go [1-2034]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that a large, manual formatting commit is an anti-pattern and proposes the standard, automated solution (
gofmtwith CI/hooks), which would significantly improve repository health and developer workflow.Use struct and JSON marshaling
Refactor
handleOIDCDiscoveryto generate the JSON response using a struct andencoding/jsoninstead of string concatenation for improved safety andreadability.
pkg/core/api/server.go [663-682]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that building JSON via string concatenation is poor practice and replaces it with idiomatic Go using a struct and
json.NewEncoder, which improves code quality, readability, and robustness.