-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely review internal implementation & exposed API
- Some stuff exposed from OAuth.Decode didn't make much sense to be exposed, removing the need for having such module prevents us from having to expose them. Plus, it re-enable a clearer division of one module per flow - Also made the 'Token' type opaque - The 'Authentication' ADT has been broke down into 4 different records that are now only exposed in their respective modules. - The Internals of the 'Token' type isn't exposed anymore' - JSON decoders and Querystring parsers have been more-or-less unified. Note that there's still work to do on them to fully capture all possible errors. - We now expose a 'OAuth.Refresh' module, not sure why it wasn't exposed before... - Some documentation quirks have been fixed - Some renaming to increase consistency and readability (e.g. 'use' -> 'useToken', 'Err' -> 'ErrorResponse' etc.) - The 'ParseErr' has been renamed and reviewed into a 'ParseResult' which now contains a 'Success' branch. This avoids the cumbersome 'Result ParseErr a' with 'ParseErr' being an ADT - Mostly, I was wrongly re-using structures for authorization / authentication between flows whereas there is subtles differences (especially about this `state`) parameter. - Put a great amount of efforts in "normalizing" decoders and query parsers to have them more 'pure' and operating at one level at a time - Remove the 'FailedToParse' and 'InvalidResponse' from the parsers results, in favor of Empty. It means that all-in-all, we can't really make the difference between an invalid response from the server and an absence of token. That's a debatable choice. - More renaming for consistency - Fixed an issue where 'ErrorCode' wouldn't parse if provided with a custom code. This commi ditches the 'Unknown' constructor in favor of 'Custom String'. For now, we don't enforce any rules on that 'String' which is wrong since the spec clearly make a statement about the shape of that error code. Will do.
- Loading branch information
Showing
10 changed files
with
993 additions
and
948 deletions.
There are no files selected for viewing
This file contains 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 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
Oops, something went wrong.