-
-
Notifications
You must be signed in to change notification settings - Fork 460
Hubs/Scopes Merge 12 - Replace IHub with IScopes in Spring 6 / Spring Boot 3 integrations
#3309
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
Merged
adinauer
merged 13 commits into
8.x.x
from
feat/hsm-12-replacements-in-spring-6-boot-3-integrations
Apr 16, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
27f2398
Introduce `IScopes` interface.
adinauer ce3c14f
Replace `IHub` with `IScopes` in core
adinauer ce615f4
Replace `IHub` with `IScopes` in android core
adinauer 22ddc00
Replace `IHub` with `IScopes` in android integrations
adinauer 305c217
Replace `IHub` with `IScopes` in apollo integrations
adinauer da927bc
Replace `IHub` with `IScopes` in okhttp integration
adinauer 8279276
Replace `IHub` with `IScopes` in graphql integration
adinauer 9bfc086
Replace `IHub` with `IScopes` in logging integrations
adinauer b998e50
Replace `IHub` with `IScopes` in more integrations
adinauer 739827a
Replace `IHub` with `IScopes` in OTel integration
adinauer 69f2d63
Replace `IHub` with `IScopes` in Spring 5 / Spring Boot 2 integrations
adinauer 792d482
Replace `IHub` with `IScopes` in Spring 6 / Spring Boot 3 integrations
adinauer 86ac8bc
Merge branch '8.x.x' into feat/hsm-12-replacements-in-spring-6-boot-3…
adinauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,10 @@ | |
| import com.jakewharton.nopen.annotation.Open; | ||
| import graphql.GraphQLError; | ||
| import io.sentry.EventProcessor; | ||
| import io.sentry.HubAdapter; | ||
| import io.sentry.IHub; | ||
| import io.sentry.IScopes; | ||
| import io.sentry.ITransportFactory; | ||
| import io.sentry.Integration; | ||
| import io.sentry.ScopesAdapter; | ||
| import io.sentry.Sentry; | ||
| import io.sentry.SentryIntegrationPackageStorage; | ||
| import io.sentry.SentryOptions; | ||
|
|
@@ -116,7 +116,7 @@ static class HubConfiguration { | |
| } | ||
|
|
||
| @Bean | ||
| public @NotNull IHub sentryHub( | ||
| public @NotNull IScopes sentryHub( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we rename this method? |
||
| final @NotNull List<Sentry.OptionsConfiguration<SentryOptions>> optionsConfigurations, | ||
| final @NotNull SentryProperties options, | ||
| final @NotNull ObjectProvider<GitProperties> gitProperties) { | ||
|
|
@@ -139,7 +139,7 @@ static class HubConfiguration { | |
| // here we make sure that only classes that extend throwable are set on this field | ||
| options.getIgnoredExceptionsForType().removeIf(it -> !Throwable.class.isAssignableFrom(it)); | ||
| Sentry.init(options); | ||
| return HubAdapter.getInstance(); | ||
| return ScopesAdapter.getInstance(); | ||
| } | ||
|
|
||
| @Configuration(proxyBeanMethods = false) | ||
|
|
@@ -239,19 +239,19 @@ static class SentrySecurityConfiguration { | |
| * HttpServletRequest#getUserPrincipal()}. If Spring Security is auto-configured, its order is | ||
| * set to run after Spring Security. | ||
| * | ||
| * @param hub the Sentry hub | ||
| * @param scopes the Sentry scopes | ||
| * @param sentryProperties the Sentry properties | ||
| * @param sentryUserProvider the user provider | ||
| * @return {@link SentryUserFilter} registration bean | ||
| */ | ||
| @Bean | ||
| @ConditionalOnBean(SentryUserProvider.class) | ||
| public @NotNull FilterRegistrationBean<SentryUserFilter> sentryUserFilter( | ||
| final @NotNull IHub hub, | ||
| final @NotNull IScopes scopes, | ||
| final @NotNull SentryProperties sentryProperties, | ||
| final @NotNull List<SentryUserProvider> sentryUserProvider) { | ||
| final FilterRegistrationBean<SentryUserFilter> filter = new FilterRegistrationBean<>(); | ||
| filter.setFilter(new SentryUserFilter(hub, sentryUserProvider)); | ||
| filter.setFilter(new SentryUserFilter(scopes, sentryUserProvider)); | ||
| filter.setOrder(resolveUserFilterOrder(sentryProperties)); | ||
| return filter; | ||
| } | ||
|
|
@@ -263,8 +263,8 @@ static class SentrySecurityConfiguration { | |
| } | ||
|
|
||
| @Bean | ||
| public @NotNull SentryRequestResolver sentryRequestResolver(final @NotNull IHub hub) { | ||
| return new SentryRequestResolver(hub); | ||
| public @NotNull SentryRequestResolver sentryRequestResolver(final @NotNull IScopes scopes) { | ||
| return new SentryRequestResolver(scopes); | ||
| } | ||
|
|
||
| @Bean | ||
|
|
@@ -276,22 +276,23 @@ static class SentrySecurityConfiguration { | |
| @Bean | ||
| @ConditionalOnMissingBean(name = "sentrySpringFilter") | ||
| public @NotNull FilterRegistrationBean<SentrySpringFilter> sentrySpringFilter( | ||
| final @NotNull IHub hub, | ||
| final @NotNull IScopes scopes, | ||
| final @NotNull SentryRequestResolver requestResolver, | ||
| final @NotNull TransactionNameProvider transactionNameProvider) { | ||
| FilterRegistrationBean<SentrySpringFilter> filter = | ||
| new FilterRegistrationBean<>( | ||
| new SentrySpringFilter(hub, requestResolver, transactionNameProvider)); | ||
| new SentrySpringFilter(scopes, requestResolver, transactionNameProvider)); | ||
| filter.setOrder(SENTRY_SPRING_FILTER_PRECEDENCE); | ||
| return filter; | ||
| } | ||
|
|
||
| @Bean | ||
| @ConditionalOnMissingBean(name = "sentryTracingFilter") | ||
| public FilterRegistrationBean<SentryTracingFilter> sentryTracingFilter( | ||
| final @NotNull IHub hub, final @NotNull TransactionNameProvider transactionNameProvider) { | ||
| final @NotNull IScopes scopes, | ||
| final @NotNull TransactionNameProvider transactionNameProvider) { | ||
| FilterRegistrationBean<SentryTracingFilter> filter = | ||
| new FilterRegistrationBean<>(new SentryTracingFilter(hub, transactionNameProvider)); | ||
| new FilterRegistrationBean<>(new SentryTracingFilter(scopes, transactionNameProvider)); | ||
| filter.setOrder(SENTRY_SPRING_FILTER_PRECEDENCE + 1); // must run after SentrySpringFilter | ||
| return filter; | ||
| } | ||
|
|
@@ -300,11 +301,11 @@ public FilterRegistrationBean<SentryTracingFilter> sentryTracingFilter( | |
| @ConditionalOnMissingBean | ||
| @ConditionalOnClass(HandlerExceptionResolver.class) | ||
| public @NotNull SentryExceptionResolver sentryExceptionResolver( | ||
| final @NotNull IHub sentryHub, | ||
| final @NotNull IScopes scopes, | ||
| final @NotNull TransactionNameProvider transactionNameProvider, | ||
| final @NotNull SentryProperties options) { | ||
| return new SentryExceptionResolver( | ||
| sentryHub, transactionNameProvider, options.getExceptionResolverOrder()); | ||
| scopes, transactionNameProvider, options.getExceptionResolverOrder()); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -354,8 +355,8 @@ static class SentrySpanPointcutAutoConfiguration {} | |
| @Open | ||
| static class SentryPerformanceRestTemplateConfiguration { | ||
| @Bean | ||
| public SentrySpanRestTemplateCustomizer sentrySpanRestTemplateCustomizer(IHub hub) { | ||
| return new SentrySpanRestTemplateCustomizer(hub); | ||
| public SentrySpanRestTemplateCustomizer sentrySpanRestTemplateCustomizer(IScopes scopes) { | ||
| return new SentrySpanRestTemplateCustomizer(scopes); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -365,8 +366,8 @@ public SentrySpanRestTemplateCustomizer sentrySpanRestTemplateCustomizer(IHub hu | |
| @Open | ||
| static class SentrySpanRestClientConfiguration { | ||
| @Bean | ||
| public SentrySpanRestClientCustomizer sentrySpanRestClientCustomizer(IHub hub) { | ||
| return new SentrySpanRestClientCustomizer(hub); | ||
| public SentrySpanRestClientCustomizer sentrySpanRestClientCustomizer(IScopes scopes) { | ||
| return new SentrySpanRestClientCustomizer(scopes); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -376,8 +377,8 @@ public SentrySpanRestClientCustomizer sentrySpanRestClientCustomizer(IHub hub) { | |
| @Open | ||
| static class SentryPerformanceWebClientConfiguration { | ||
| @Bean | ||
| public SentrySpanWebClientCustomizer sentrySpanWebClientCustomizer(IHub hub) { | ||
| return new SentrySpanWebClientCustomizer(hub); | ||
| public SentrySpanWebClientCustomizer sentrySpanWebClientCustomizer(IScopes scopes) { | ||
| return new SentrySpanWebClientCustomizer(scopes); | ||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we rename
HubConfigurationinSentryAutoConfiguration?