Repository navigation
docs: add approved task-1 oauth design (D1-D13) - #3
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an approved design document for “Task 1 — GitHub OAuth Login (End-to-End)”, covering decisions (D1–D13), flow, endpoint contract, failure analysis, testing plan, and scoped implementation file changes.
Changes:
- Introduces the full Task 1 OAuth final design write-up (status, decisions, and sequence flow).
- Documents endpoint contracts for
/auth/github/login,/auth/github/callback, and/users/me. - Captures prerequisites/security gate, failure modes, and a testing/verification plan.
Suppressed comments (3)
task-1-oauth-design.md:15
- The text says "verified in repo" and then cites paths like
internal/auth/service.goandcmd/server/main.go. In this docs repo those paths don't exist; clarify the target repo/directory and avoid hard-coded line ranges that will drift.
Users cannot authenticate. Current state (verified in repo):
- `GET /auth/github/login` redirects to GitHub, but `RedirectURL` points to `/auth/github/callback`, which has **no route** (404).
- OAuth `state` is hardcoded `"aevor-state"` (`internal/auth/service.go:17-20`) — a CSRF hole.
- `internal/auth/jwt.go` and `internal/auth/middleware.go` are empty — no JWT, no auth middleware.
task-1-oauth-design.md:17
- This bullet references
cmd/server/main.go:50, but the design doc doesn't scope paths to a specific repo and hard-coded line numbers are brittle. Prefer a scoped path without line numbers.
- User creation is an unauthenticated `POST /users` (`cmd/server/main.go:50`) — anyone can create arbitrary users.
- `GET /users/:id` and `GET /users/github/:id` are unauthenticated — enumeration risk.
task-1-oauth-design.md:33
- This docs repo doesn't contain a
go.mod, so "Go toolchain per go.mod (1.26.1)" is ambiguous. Scope it to the API service'sgo.mod(or drop the explicit version if it isn't guaranteed).
4. Go toolchain per `go.mod` (1.26.1).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+5
to
+6
| Scope: ONE feature — authenticated identity. Nothing else. | ||
|
|
|
|
||
| ### `GET /auth/github/login` | ||
| - Auth: none. | ||
| - Behavior: generate random `state` + random PKCE `code_verifier` → store both in `aevor_oauth_state` cookie (HttpOnly, SameSite=Lax, Path=/auth, MaxAge 600, Secure only in prod) → `302` to GitHub authorize URL with `code_challenge` derived via S256. |
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.
Adds the approved Task 1 OAuth design document (decisions D1-D13, flow, endpoint contract, file changes, failure analysis, testing plan, docs updates, out-of-scope list).