Repository navigation
fix(auth): harden error handling and CI linting #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
45a0039
test(auth): expand service and HTTP flow coverage
Jonathan0823 ce2d191
test(storage): add PostgreSQL user repository integration coverage
Jonathan0823 030b5b7
test(ratelimit): cover limiter configuration and bootstrap paths
Jonathan0823 f2fa8f8
test(observability): cover metrics event and middleware paths
Jonathan0823 7330f9f
chore(sonar): exclude generated artifacts from analysis
Jonathan0823 61c01ea
fix(http): handle gin error returns consistently
Jonathan0823 af6064d
refactor(ratelimit): align limiter and token helper types
Jonathan0823 0bfb4c1
fix(platform): fail fast on server startup errors
Jonathan0823 2532a5e
ci(workflows): add golangci-lint job
Jonathan0823 12459e3
ci(workflows): fix golangci-lint version format
Jonathan0823 3a1f1cc
chore(sqlc): regenerate sqlc
Jonathan0823 6d202e6
ci(workflows): update golangci-lint to v2
Jonathan0823 9d1dc36
fix(ci): satisfy golangci-lint v2 checks
Jonathan0823 2c5d910
fix(gitguardian): ignore test files from the scan
Jonathan0823 19725a7
fix(gitguardian): use v2 test path exclusions
Jonathan0823 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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Required for ggshield v2 configuration. | ||
| version: 2 | ||
|
|
||
| secret: | ||
| ignored_paths: | ||
| - '**/*_test.go' | ||
| - '**/testdata/**' | ||
| - '**/fixtures/**' | ||
| show_secrets: false |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package dto | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/Jonathan0823/auth-go/internal/core/domain" | ||
| ) | ||
|
|
||
| func TestUserResponseMappings(t *testing.T) { | ||
| now := time.Now() | ||
| user := &domain.User{ | ||
| ID: 1, | ||
| OAuthID: "oauth-id", | ||
| Username: "user", | ||
| AvatarURL: "https://example.com/avatar.png", | ||
| Email: "user@example.com", | ||
| IsVerified: true, | ||
| Provider: "github", | ||
| CreatedAt: now, | ||
| UpdatedAt: now, | ||
| } | ||
| response := UserResponseFromDomain(user) | ||
| if response.ID != user.ID || response.Email != user.Email || response.Provider != user.Provider || !response.IsVerified { | ||
| t.Fatalf("response = %#v", response) | ||
| } | ||
| responses := UserResponsesFromDomain([]*domain.User{user}) | ||
| if len(responses) != 1 || responses[0].ID != user.ID { | ||
| t.Fatalf("responses = %#v", responses) | ||
| } | ||
| } |
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.
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Jonathan0823/auth-go
Length of output: 287
🏁 Script executed:
Repository: Jonathan0823/auth-go
Length of output: 4791
🌐 Web query:
actions/checkout v4 persist-credentials default true README💡 Result:
The
persist-credentialsinput for theactions/checkoutGitHub Action has a default value oftrue[1][2][3]. This setting controls whether the action configures the provided GitHub token (or SSH key) within the local git configuration [1][4]. When enabled (the default), it allows your workflow steps to execute authenticated git commands (such asgit fetchorgit push) automatically without requiring additional manual configuration [5][4]. Whilepersist-credentials: trueremains the default, security implementations have evolved. In version 6.0.0 and later, the action was updated to store these credentials in a separate file under$RUNNER_TEMPrather than writing them directly into the.git/configfile [4][3][6]. This change was designed to improve security by isolating the credentials [4][3]. If you wish to opt out of this behavior, you can explicitly setpersist-credentials: falsein your workflow step [5][4]. During post-job cleanup, the action automatically removes the persisted credentials [5][4].Citations:
Do not persist the checkout credential.
actions/checkoutpersistsGITHUB_TOKENby default, and this lint job hands control to a third-party action afterward. The workflow already limits job permissions tocontents: read, so addpersist-credentials: false.🧰 Tools
🪛 zizmor (1.28.0)
[warning] 48-48: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools