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

feat(api): jwt verification #339

Merged
merged 12 commits into from
Feb 13, 2024
Merged

feat(api): jwt verification #339

merged 12 commits into from
Feb 13, 2024

Conversation

timonmasberg
Copy link
Member

@timonmasberg timonmasberg commented Aug 11, 2023

Description

Since we have to move away from Azure Web Apps, and cannot rely on the OAuth Proxy provided by it, we need to verify the token ourselves. This PR introduces an auth strategy that verifies the JWT against keys from AADB2C and decodes into an AuthUser. The current strategy is now the dev strategy, not verifying the token, but only decoding it. Whenever we move completely to the on-prem system, we have to set the strategy to aadb2c to run the JWT verify strategy.

Checklist:

  • The title of this PR and the commit history is conform with
    the Conventional Commits specification.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings, SonarCloud reports no Vulnerabilities, Bugs or Code Smells.
  • I have added tests (unit and E2E if user-facing) that prove my fix is effective or that my feature works,
    Coverage > 80% and not less than the current coverage of the main branch.
  • The PR branch is up-to-date with the base branch. In case you merged main into your feature branch, make sure you have run the latest NX migrations (nx migrate --run-migrations).

@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 0 Code Smells

92.9% 92.9% Coverage
0.0% 0.0% Duplication

# Conflicts:
#	package-lock.json
#	package.json
# Conflicts:
#	package-lock.json
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
93.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

# Conflicts:
#	.github/actions/build-and-deploy-api/action.yml
#	.github/workflows/next-deployment.yml
#	apps/api/.env.template
#	apps/api/src/app/app.module.ts
#	package-lock.json
@timonmasberg timonmasberg force-pushed the main branch 2 times, most recently from 9b697ff to 99a715d Compare January 23, 2024 13:07
@timonmasberg timonmasberg requested a review from JSPRH February 13, 2024 13:00
Copy link

Copy link
Contributor

@JSPRH JSPRH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@timonmasberg timonmasberg merged commit 3afd227 into main Feb 13, 2024
10 checks passed
@timonmasberg timonmasberg deleted the feat/user-auth branch February 13, 2024 19:03
@timonmasberg
Copy link
Member Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants