Skip to content

Api improvements - #1185

Open
0xfornax wants to merge 5 commits into
masterfrom
api-improvements
Open

Api improvements#1185
0xfornax wants to merge 5 commits into
masterfrom
api-improvements

Conversation

@0xfornax

@0xfornax 0xfornax commented Aug 20, 2026

Copy link
Copy Markdown
Member

Adds configurable Smart Node HTTP API exposure (closed, localhost, or external) and a dedicated API settings category with a new API token. Remote and local clients must authenticate according to a token-requirement mode (all routes, or only mutating ones such as transactions, wallet operations, and validator exits).

Adds a default API rate limit of 5 requests per second.

Request logs now include the client IP.

@github-actions

Copy link
Copy Markdown

Coverage Report

@github-actions

Copy link
Copy Markdown

Coverage Report

@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/rocket-pool/smartnode/rocketpool-cli/cli/prompt 0.00% (ø)
github.com/rocket-pool/smartnode/rocketpool-cli/cli/term 0.00% (ø)
github.com/rocket-pool/smartnode/rocketpool-cli/service 0.00% (ø)
github.com/rocket-pool/smartnode/rocketpool-cli/service/config 0.00% (ø)
github.com/rocket-pool/smartnode/rocketpool/api/response 5.50% (+5.50%) 👍
github.com/rocket-pool/smartnode/rocketpool/node 0.72% (+0.07%) 👍
github.com/rocket-pool/smartnode/shared/services/apitoken 0.68% (+0.68%) 👍
github.com/rocket-pool/smartnode/shared/services/config 3.79% (+0.31%) 👍
github.com/rocket-pool/smartnode/shared/services/config/migration 2.35% (+2.35%) 👍
github.com/rocket-pool/smartnode/shared/services/rocketpool 0.00% (ø)
github.com/rocket-pool/smartnode/shared/types/config 5.45% (+0.36%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/rocket-pool/smartnode/rocketpool-cli/cli/prompt/prompt.go 0.00% (ø) 1079 (+1079) 0 1079 (+1079)
github.com/rocket-pool/smartnode/rocketpool-cli/cli/term/term.go 0.00% (ø) 69 (+69) 0 69 (+69)
github.com/rocket-pool/smartnode/rocketpool-cli/service/config/settings-api.go 0.00% (ø) 496 (+496) 0 496 (+496)
github.com/rocket-pool/smartnode/rocketpool-cli/service/config/settings-home.go 0.00% (ø) 2124 (+789) 0 2124 (+789)
github.com/rocket-pool/smartnode/rocketpool-cli/service/config/settings-native-home.go 0.00% (ø) 1933 (+726) 0 1933 (+726)
github.com/rocket-pool/smartnode/rocketpool-cli/service/service.go 0.00% (ø) 20630 (+8386) 0 20630 (+8386)
github.com/rocket-pool/smartnode/rocketpool/api/response/response.go 5.50% (+5.50%) 981 (+981) 54 (+54) 927 (+927) 👍
github.com/rocket-pool/smartnode/rocketpool/node/http.go 4.56% (+4.56%) 1974 (+1612) 90 (+90) 1884 (+1522) 👍
github.com/rocket-pool/smartnode/rocketpool/node/sensitive.go 8.26% (+8.26%) 363 (+363) 30 (+30) 333 (+333) 👍
github.com/rocket-pool/smartnode/shared/services/apitoken/token.go 0.68% (+0.68%) 2068 (+2068) 14 (+14) 2054 (+2054) 👍
github.com/rocket-pool/smartnode/shared/services/config/api-config.go 8.22% (+8.22%) 292 (+292) 24 (+24) 268 (+268) 👍
github.com/rocket-pool/smartnode/shared/services/config/migration/migration-manager.go 6.15% (+6.15%) 1236 (+475) 76 (+76) 1160 (+399) 👍
github.com/rocket-pool/smartnode/shared/services/config/migration/v1210-manager.go 7.55% (+7.55%) 318 (+318) 24 (+24) 294 (+294) 👍
github.com/rocket-pool/smartnode/shared/services/config/rocket-pool-config.go 2.14% (+1.20%) 15106 (+6362) 323 (+241) 14783 (+6121) 👍
github.com/rocket-pool/smartnode/shared/services/config/smartnode-config.go 0.96% (-0.72%) 2292 (+743) 22 (-4) 2270 (+747) 👎
github.com/rocket-pool/smartnode/shared/services/rocketpool/client.go 0.00% (ø) 15570 (+5828) 0 15570 (+5828)
github.com/rocket-pool/smartnode/shared/types/config/parameter.go 3.73% (-0.14%) 1530 (+598) 57 (+21) 1473 (+577) 👎
github.com/rocket-pool/smartnode/shared/types/config/port-modes.go 11.42% (+4.79%) 254 (+73) 29 (+17) 225 (+56) 👍
github.com/rocket-pool/smartnode/shared/types/config/types.go 21.74% (-2.71%) 69 (+24) 15 (+4) 54 (+20) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/rocket-pool/smartnode/rocketpool/node/http_test.go
  • github.com/rocket-pool/smartnode/rocketpool/node/sensitive_test.go
  • github.com/rocket-pool/smartnode/shared/services/config/api-config_test.go

@0xfornax
0xfornax marked this pull request as ready for review August 21, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant