Skip to content
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/token wrapping #289

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Feature/token wrapping #289

merged 2 commits into from
Aug 28, 2024

Conversation

johnabass
Copy link
Contributor

@johnabass johnabass commented Aug 26, 2024

This PR implements Token wrapping, a feature very similar to the errors package.

It's often true that authentication needs to augment a Token. This need can arise because of reading from an external database, needing to add attributes for the application layer to process, etc. You can now supply an Unwrap method in custom tokens to communicate nesting. The TokenAs function allows client code to extract custom types from tokens in a way much like errors.As does for errors.

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3e40273) to head (69196cf).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #289   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          733       789   +56     
=========================================
+ Hits           733       789   +56     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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.

@johnabass johnabass merged commit af4b32b into main Aug 28, 2024
19 checks passed
@johnabass johnabass deleted the feature/token-wrapping branch August 28, 2024 04:53
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