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

🎨 Refactor auth middleware as function #117

Merged

Conversation

dmihalcik-virtru
Copy link
Member

@dmihalcik-virtru dmihalcik-virtru commented Dec 2, 2022

  • Unify on a middleware method, withCreds
  • Previously, the OIDC middleware only could return one value, Authorization header, which means we can't also set the DPoP header
  • The appID middleware updates HttpRequest in place, but that isn't best practice; instead, return a copy-and-modified version
  • Related fixes to use the middeware where needed
  • This pre-work simplifies adding DPoP headers in the middleware
  • Adds validation that access token is present in CLI tool

- Unify on a middleware method, `withCreds`
- Previously, the OIDC middleware only could return one value, Authorization header, which means we can't also set the DPoP header
- The appID middleware updates HttpRequest in place, but that isn't best practice; instead, return a copy-and-modified version
- Related fixes to use the middeware where needed
- This pre-work simplifies adding DPoP headers in the middleware
@dmihalcik-virtru dmihalcik-virtru requested a review from a team as a code owner December 2, 2022 20:14
pflynn-virtru
pflynn-virtru previously approved these changes Dec 15, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.1% 0.1% Duplication

@dmihalcik-virtru dmihalcik-virtru merged commit c8a8d6e into opentdf:main Dec 16, 2022
@dmihalcik-virtru dmihalcik-virtru deleted the feature/refactor-middleware branch December 16, 2022 20:22
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.

2 participants