-
Notifications
You must be signed in to change notification settings - Fork 0
fix: resolve CWE-665 — make xurl importable as a Go library #1
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 3 commits
9001ab8
608dba5
a7071f6
ad5449d
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| xurl | ||
| /xurl | ||
| .xurl_test | ||
| .DS_Store# Added by goreleaser init: | ||
| dist/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,13 +11,13 @@ import ( | |
| "time" | ||
|
|
||
| "bufio" | ||
| "mime/multipart" | ||
| "os" | ||
| "path/filepath" | ||
| "github.com/xdevplatform/xurl/auth" | ||
| "github.com/xdevplatform/xurl/config" | ||
| xurlErrors "github.com/xdevplatform/xurl/errors" | ||
| "github.com/xdevplatform/xurl/version" | ||
| "mime/multipart" | ||
| "os" | ||
| "path/filepath" | ||
| ) | ||
|
Comment on lines
15
to
21
|
||
|
|
||
| // RequestOptions contains common options for API requests | ||
|
|
@@ -346,7 +346,8 @@ func (c *ApiClient) getAuthHeader(method, url string, authType string, username | |
| } | ||
|
|
||
| // If no auth type is specified, try to use the first OAuth2 token | ||
| token := c.auth.TokenStore.GetFirstOAuth2Token() | ||
| // Use ForApp variants so the active app name (set via --app) is respected. | ||
| token := c.auth.TokenStore.GetFirstOAuth2TokenForApp(c.auth.AppName()) | ||
| if token != nil { | ||
| accessToken, err := c.auth.GetOAuth2Header(username) | ||
| if err == nil { | ||
|
|
@@ -355,7 +356,7 @@ func (c *ApiClient) getAuthHeader(method, url string, authType string, username | |
| } | ||
|
|
||
| // If no OAuth2 token is available, try to use the first OAuth1 token | ||
| token = c.auth.TokenStore.GetOAuth1Tokens() | ||
| token = c.auth.TokenStore.GetOAuth1TokensForApp(c.auth.AppName()) | ||
| if token != nil { | ||
| authHeader, err := c.auth.GetOAuth1Header(method, url, nil) | ||
| if err == nil { | ||
|
|
||
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 README suggests
import "xurl"will work withrequire xurl v0.0.0+replace xurl => ../xurl, but this repo’s packages import each other via the full module path (github.com/xdevplatform/xurl/...). Using the short module path will break those internal imports unless they’re rewritten too. Consider removing theimport "xurl"guidance or instead documentingreplace github.com/xdevplatform/xurl => ../xurl(while keepingimport "github.com/xdevplatform/xurl").