-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: integrate phenotype-go-kit for auth DRY #822
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,348 @@ | ||||||||||||||||||||||
| // Package claude provides OAuth2 authentication functionality for Anthropic's Claude API. | ||||||||||||||||||||||
| // This package implements the complete OAuth2 flow with PKCE (Proof Key for Code Exchange) | ||||||||||||||||||||||
| // for secure authentication with Claude API, including token exchange, refresh, and storage. | ||||||||||||||||||||||
| package claude | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import ( | ||||||||||||||||||||||
| "context" | ||||||||||||||||||||||
| "encoding/json" | ||||||||||||||||||||||
| "fmt" | ||||||||||||||||||||||
| "io" | ||||||||||||||||||||||
| "net/http" | ||||||||||||||||||||||
| "net/url" | ||||||||||||||||||||||
| "strings" | ||||||||||||||||||||||
| "time" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| "github.com/kooshapari/cliproxyapi-plusplus/v6/internal/config" | ||||||||||||||||||||||
|
Check failure on line 16 in internal/auth/claude/anthropic_auth.go
|
||||||||||||||||||||||
|
||||||||||||||||||||||
| "github.com/kooshapari/cliproxyapi-plusplus/v6/internal/config" | |
| "github.com/kooshapari/cliproxyapi-plusplus/v6/pkg/llmproxy/config" |
Copilot
AI
Mar 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The types ClaudeTokenData, ClaudeAuthBundle, and PKCECodes are used throughout this file but are not defined anywhere in the internal/auth/claude package. They exist in pkg/llmproxy/auth/claude (see pkg/llmproxy/auth/claude/anthropic.go), but that's a different package and these types are not imported. This will cause compilation failure.
Copilot
AI
Mar 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple commented-out debug log statements left in the file. These should be removed before merging, or replaced with proper log.Debugf(...) calls (without the comment marker) since the log package is already imported.
| // log.Debugf("Token response: %s", string(body)) | |
| if resp.StatusCode != http.StatusOK { | |
| return nil, fmt.Errorf("token exchange failed with status %d: %s", resp.StatusCode, string(body)) | |
| } | |
| // log.Debugf("Token response: %s", string(body)) | |
| if resp.StatusCode != http.StatusOK { | |
| return nil, fmt.Errorf("token exchange failed with status %d: %s", resp.StatusCode, string(body)) | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
go.moduses areplacedirective pointing to a relative path../../template-commons/phenotype-go-kit. This is a local filesystem path that will only work if thephenotype-go-kitrepository is checked out at that exact relative location on the developer's machine. Thego.sumfile also has no entry for this module, which meansgo mod tidyhas not been run. For a publishable or deployable build, the dependency should be tagged with a real version and referenced from a VCS (e.g., a GitHub tag), rather than relying on a local replace directive.