-
Notifications
You must be signed in to change notification settings - Fork 744
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
Reorganize and cleanup auth stdlib #13808
Reorganize and cleanup auth stdlib #13808
Conversation
I see your point and this is certainly easier to understand, but I would have expected something like that public type AuthConfig record {
OutboundAuthScheme scheme;
BasicAuthConfig|OAuth2AuthConfig|JwtAuthConfig config;
!...;
}; Why do you prefer 3 optional fields in place of a union? |
@davebaol Thank you for the feedback. Yes you have a valid point here and I do not have any strong point to defend using separate optional config records. There were some implementation complications related to record ambiguity that prevented using an union initially. We are working on reorganizing and improving OAuth2 related logic, targeting March end. Initial idea was to do this with OAuth2 related changes. However, I agreed with you that will change will look very neat and clean with a single union for configuration. I had some time to further look at record ambiguity problem, and I have now used union for configuration, as you have suggested. Updated PR description accordingly. @davebaol thanks again for the valuable input! |
Codecov Report
@@ Coverage Diff @@
## master #13808 +/- ##
============================================
- Coverage 65.14% 64.52% -0.62%
Complexity 426 426
============================================
Files 2116 2150 +34
Lines 94178 95356 +1178
Branches 12492 12699 +207
============================================
+ Hits 61349 61531 +182
- Misses 27844 28817 +973
- Partials 4985 5008 +23
Continue to review full report at Codecov.
|
Purpose
Resolve following
auth
stdlib related improvements and feature additions.In addition, this PR reorganize the client and server endpoint
auth
configurations, to make it easier to understand. Previously, configuration for all the authentication mechanisms were put in record, which confused uses on which configurations to use for each authentication mechanism. Now the clientauth
configuration has been separated as follows:In addition, improve the
crypto
andencoding
stdlib to provide operations that are required for internal workings ofauth
stdlib. This limits to:Update 1
AuthConfig
was changed to use union for configuration.