Skip to content

Conversation

@t4niwa
Copy link
Contributor

@t4niwa t4niwa commented Dec 26, 2025

Description

description_with_details_and_reasoning

Assignees

  • Assignees is set

Type of changes

  • Apply one or more labels of the following that fits:
    • bug: Bug fix
    • dependencies: Dependency upgrades
    • documentation: Documentation changes
    • enhancement: New Feature
    • good first issue: First contribution
    • logging: Log changes
    • refactor: Refactoring (no functional changes, no api changes)

Flags

- [ ] Breaks backward compatibility
- [ ] Requires a documentation update
- [ ] Has untestable code

Checklist

- [ ] Followed the guidelines in the CONTRIBUTING document
- [ ] Added prefix `[skip ci]`/`[ci skip]`/`[no ci]`/`[skip actions]`/`[actions skip]` in the PR title if necessary
- [ ] Tested and linted the code
- [ ] Commented the code
- [ ] Made corresponding changes to the documentation

Checklist for maintainer

- [ ] Use `Squash and merge`
- [ ] Double-confirm the merge message has prefix `[skip ci]`/`[ci skip]`/`[no ci]`/`[skip actions]`/`[actions skip]`
- [ ] Delete the branch after merge

Signed-off-by: taniwa <taniwa@lycorp.co.jp>
Signed-off-by: taniwa <taniwa@lycorp.co.jp>
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 0% with 211 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.10%. Comparing base (128fc50) to head (aa0bc66).

Files with missing lines Patch % Lines
pkg/authorization/server.go 0.00% 129 Missing ⚠️
cmd/athenz-sia/main.go 0.00% 32 Missing ⚠️
pkg/config/config.go 0.00% 30 Missing ⚠️
pkg/config/model.go 0.00% 14 Missing ⚠️
pkg/config/default.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #204      +/-   ##
========================================
- Coverage   9.50%   9.10%   -0.40%     
========================================
  Files         34      35       +1     
  Lines       3326    2812     -514     
========================================
- Hits         316     256      -60     
+ Misses      2988    2534     -454     
  Partials      22      22              
Flag Coverage Δ
unittests 9.10% <0.00%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


authService = authorization.NewAuthorizationServer(authConfig, stopChan)
}

Copy link
Contributor

@fsul7o fsul7o Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他と合わせて、main.goは下記のみでinitできるようにしたほうが良いと思いました。

	authService, err := authService.New(initCtx, idCfg)
	if err != nil {
		log.Fatalf("Error initiating authorizer: %s", err.Error())
	}

Comment on lines +198 to +203
if authService != nil {
if err := authService.Start(runCtx); err != nil {
log.Errorf("Error starting authorization server: %s", err.Error())
cancelRun(fmt.Errorf("%w: %w", causeByStartFailed, err))
}
}
Copy link
Contributor

@fsul7o fsul7o Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他と合わせると、if authService != nilは不要となるように実装した方がよさそうです

}

// Perform authorization
ctx := context.Background()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r.Context()で http.RequestのContextを取得した方が良いと思います

w.WriteHeader(http.StatusInternalServerError)
log.Infof("Authorization succeeded but failed to prepare response: %s", err.Error())
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonでのレスポンスは不要かと思います

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants