-
Notifications
You must be signed in to change notification settings - Fork 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
Feature/on error http response #174
Conversation
Codecov Report
@@ Coverage Diff @@
## main #174 +/- ##
==========================================
+ Coverage 63.20% 63.24% +0.04%
==========================================
Files 16 16
Lines 875 876 +1
==========================================
+ Hits 553 554 +1
Misses 306 306
Partials 16 16
Continue to review full report at Codecov.
|
if logger == nil { | ||
logger = bascule.GetDefaultLoggerFunc | ||
if getLogger == nil { | ||
getLogger = func(ctx context.Context) log.Logger { |
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.
It looks like it might be useful to bring back the GetDefaultLoggerFunc
function (one returning a log.Logger
).
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.
Since we're moving away from log.Logger
, I'm not sure we should put in the work?
}, | ||
}, | ||
fx.Annotated{ | ||
Name: "primary_bearer_validator_type", | ||
Target: func() bascule.Validator { | ||
return bascule.CreateValidTypeCheck([]string{"jwt"}) | ||
return bchecks.ValidType([]string{"jwt"}) |
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.
I thought basculechecks implemented capability checks so I found it a bit surprising these validators got moved there.
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.
But in any case, we'll have both of these packages imported together until we fully transition to touchstone.
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.
basculechecks
is for all checks aka bascule.Validator
s, which is why I moved those there. I didn't think about the double import... 😬 luckily long term this will go away.
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.
Looks good! Just had one question in the constructor setup.
Group: primaryBasculeCOptionsName, | ||
Target: func(in primaryBasculeOnHTTPErrorResponseIn) basculehttp.COption { | ||
if in.OnErrorHTTPResponse == nil { | ||
return 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.
Won't this add nil
to the list? I'm not sure that bascule is equipped to handle that?
A solution might be to use the arrange.IfSet()
function, but I'm not sure.
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.
Yeah, nil will be added to the list but it'll be filtered out before using the options here
Line 95 in 4761625
var filteredOptions []basculehttp.COption |
if logger == nil { | ||
logger = bascule.GetDefaultLoggerFunc | ||
if getLogger == nil { | ||
getLogger = func(ctx context.Context) log.Logger { |
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.
Since we're moving away from log.Logger
, I'm not sure we should put in the work?
SonarCloud Quality Gate failed. |
No description provided.