-
Notifications
You must be signed in to change notification settings - Fork 11
[WIP] Authorization server with token cache poc #204
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: taniwa <taniwa@lycorp.co.jp>
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: taniwa <taniwa@lycorp.co.jp>
|
|
||
| authService = authorization.NewAuthorizationServer(authConfig, stopChan) | ||
| } | ||
|
|
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.
他と合わせて、main.goは下記のみでinitできるようにしたほうが良いと思いました。
authService, err := authService.New(initCtx, idCfg)
if err != nil {
log.Fatalf("Error initiating authorizer: %s", err.Error())
}
| 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)) | ||
| } | ||
| } |
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.
他と合わせると、if authService != nilは不要となるように実装した方がよさそうです
| } | ||
|
|
||
| // Perform authorization | ||
| ctx := context.Background() |
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.
r.Context()で http.RequestのContextを取得した方が良いと思います
| w.WriteHeader(http.StatusInternalServerError) | ||
| log.Infof("Authorization succeeded but failed to prepare response: %s", err.Error()) | ||
| return | ||
| } |
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.
jsonでのレスポンスは不要かと思います
Description
description_with_details_and_reasoning
Assignees
Assigneesis setType of changes
labelsof the following that fits:bug: Bug fixdependencies: Dependency upgradesdocumentation: Documentation changesenhancement: New Featuregood first issue: First contributionlogging: Log changesrefactor: Refactoring (no functional changes, no api changes)Flags
Checklist
Checklist for maintainer