-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
Fix: set user on transaction #1443
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1443 +/- ##
============================================
- Coverage 75.88% 75.87% -0.02%
- Complexity 1889 1901 +12
============================================
Files 187 189 +2
Lines 6453 6499 +46
Branches 633 640 +7
============================================
+ Hits 4897 4931 +34
- Misses 1261 1272 +11
- Partials 295 296 +1
Continue to review full report at Codecov.
|
sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java
Show resolved
Hide resolved
@@ -54,6 +54,12 @@ public class io/sentry/spring/SentrySpringServletContainerInitializer : javax/se | |||
public fun onStartup (Ljava/util/Set;Ljavax/servlet/ServletContext;)V | |||
} | |||
|
|||
public class io/sentry/spring/SentryUserFilter : javax/servlet/Filter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need to add these to the docs and a note on a migration plan for the next version (should be 5.0 I believe)?
sentry-spring/src/main/java/io/sentry/spring/SentryUserFilter.java
Outdated
Show resolved
Hide resolved
sentry-spring-boot-starter/src/test/kotlin/io/sentry/spring/boot/SentryAutoConfigurationTest.kt
Outdated
Show resolved
Hide resolved
sentry-spring/src/main/java/io/sentry/spring/SentryUserFilter.java
Outdated
Show resolved
Hide resolved
sentry-spring/src/main/java/io/sentry/spring/SentryUserProviderEventProcessor.java
Outdated
Show resolved
Hide resolved
sentry-spring/src/test/kotlin/io/sentry/spring/SentryUserFilterTest.kt
Outdated
Show resolved
Hide resolved
@maciejwalkowiak we need docs for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
📜 Description
Set user on transaction.
User is set on the scope in Servlet filter -
SentryUserFilter
. This filter must run after Spring security (or any other filter verifying authentication details) so thatSentryUserProvider
implementations can access the currently logged in user data.In Spring Boot integration,
SentryUserFilter
is set to run:In Spring integration, filter bean must be created manually and a corresponding
DelegatingFilterProxy
servlet filter must be registered.💡 Motivation and Context
Fixes #1335
💚 How did you test it?
📝 Checklist