generated from flashbots/go-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Admin API Authentication #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
metachris
wants to merge
6
commits into
main
Choose a base branch
from
codex-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e196051
added AGENTS.md
metachris 7926ee0
Admin API with basic auth
metachris b547550
updated htpasswd instructions and added test
metachris 8e5dcf8
added --disable-admin-auth flag
metachris b84a2ef
cleanup and linter
metachris 12b1924
simplify
metachris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,8 @@ jobs: | |
- name: Run migrations | ||
run: for file in schema/*.sql; do psql "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -f $file; done | ||
|
||
- name: Run unit tests and generate the coverage report | ||
run: RUN_DB_TESTS=1 make test-race | ||
- name: Run unit tests | ||
run: make test-with-db | ||
|
||
lint: | ||
name: Lint | ||
|
@@ -61,7 +61,7 @@ jobs: | |
run: go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
- name: Install golangci-lint | ||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 | ||
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.2 | ||
|
||
- name: Install NilAway | ||
run: go install go.uber.org/nilaway/cmd/[email protected] | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Repository Guidelines | ||
|
||
## Project Structure & Modules | ||
- `cmd/httpserver/`: CLI entrypoint and service startup. | ||
- `httpserver/`: HTTP server, handlers, routing, and tests. | ||
- `application/`, `domain/`, `ports/`, `adapters/`: Clean/hexagonal layers (core logic, interfaces, DB/secrets adapters). | ||
- `schema/`: SQL migrations; `testdata/`: fixtures; `metrics/`: Prometheus metrics; `docker/`: Dockerfiles and compose; `scripts/`: CI/e2e helpers. | ||
|
||
## Build, Test, and Dev Commands | ||
- `make build`: Build the server to `build/builder-hub`. | ||
- `go run cmd/httpserver/main.go`: Run locally (see env flags below). | ||
- `make test`: Run unit tests. Use `RUN_DB_TESTS=1 make test` to include DB/e2e tests. | ||
- `make cover` / `make cover-html`: Coverage summary / HTML report. | ||
- `make fmt`: Format and tidy imports/modules. | ||
- `make lint`: `go vet`, `staticcheck`, `golangci-lint`, and format checks. | ||
- `make docker-httpserver`: Build the Docker image. | ||
- Helpful: `docs/devenv-setup.md`, `scripts/ci/integration-test.sh`. | ||
|
||
## Coding Style & Conventions | ||
- Go formatting is enforced: run `make fmt` (gofmt, gofumpt, gci, go mod tidy). | ||
- Package names: lower-case; exported symbols: PascalCase; locals: camelCase. | ||
- Keep files focused; group handlers in `httpserver`, business logic in `application/domain`. | ||
- Imports: standard → third-party → local (enforced by gci). | ||
- Indentation: Use tab, not spaces | ||
|
||
## Testing Guidelines | ||
- Framework: Go `testing`; tests live in `*_test.go`. Use `testdata/` fixtures. | ||
- Quick run: `make test`; with DB/e2e: `RUN_DB_TESTS=1 make test`. | ||
- Coverage: `make cover`. Prefer table-driven tests and clear Arrange/Act/Assert sections. | ||
|
||
## Commit & Pull Request Guidelines | ||
- Commits: concise, imperative mood (e.g., "Add API spec tests"); optional scope tags (e.g., `[CI]`); reference issues/PRs when relevant. | ||
- PRs: include description, linked issues, testing steps (curl examples for API changes), and screenshots/log snippets when useful. | ||
- Required before merge: `make lt` (lint + tests) green, updated docs in `docs/` when API/behavior changes. | ||
|
||
## Configuration & Security | ||
- Common env flags (via CLI/env): `LISTEN_ADDR`, `ADMIN_ADDR`, `INTERNAL_ADDR`, `METRICS_ADDR`, `POSTGRES_DSN`, `LOG_JSON`, `LOG_DEBUG`, `PPROF`, `MOCK_SECRETS`, `AWS_BUILDER_CONFIGS_SECRET_NAME`/`_PREFIX`. | ||
- Default DSN targets local Postgres; do not commit secrets. Use `MOCK_SECRETS=1` for local dev. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.