Skip to content

Commit

Permalink
Make ISentryUserFactory public (#2719)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell authored and vaind committed Oct 14, 2023
1 parent 35c269a commit 69bef53
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ API Changes:
- The `DiagnosticLogger` signature for `LogError` and `LogFatal` changed to take the `exception` as the first parameter. That way it does no longer get mixed up with the TArgs. The `DiagnosticLogger` now also received an overload for `LogError` and `LogFatal` that accepts a message only. ([#2715](https://github.com/getsentry/sentry-dotnet/pull/2715))

## Unreleased
## Unreleased

### Fixes

- ISentryUserFactory is now public so users can register their own implementations via DI ([#2719](https://github.com/getsentry/sentry-dotnet/pull/2719))

## 3.40.0

### Obsoletion
Expand All @@ -44,6 +50,7 @@ API Changes:
- Release of Azure Functions (Isolated Worker/Out-of-Process) support ([#2686](https://github.com/getsentry/sentry-dotnet/pull/2686))

### Fixes

- Scope is now correctly applied to Transactions when using OpenTelemetry on ASP.NET Core ([#2690](https://github.com/getsentry/sentry-dotnet/pull/2690))

### Dependencies
Expand Down
9 changes: 8 additions & 1 deletion src/Sentry/ISentryUserFactory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
namespace Sentry;

internal interface ISentryUserFactory
/// <summary>
/// Sentry User Factory
/// </summary>
public interface ISentryUserFactory
{
/// <summary>
/// Creates a Sentry <see cref="User"/> representing the current principal.
/// </summary>
/// <returns>The protocol user</returns>
public User? Create();
}
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ namespace Sentry
{
void Apply(Sentry.Scope scope, object state);
}
public interface ISentryUserFactory
{
Sentry.User? Create();
}
public interface ISession
{
string? DistinctId { get; }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ namespace Sentry
{
void Apply(Sentry.Scope scope, object state);
}
public interface ISentryUserFactory
{
Sentry.User? Create();
}
public interface ISession
{
string? DistinctId { get; }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ namespace Sentry
{
void Apply(Sentry.Scope scope, object state);
}
public interface ISentryUserFactory
{
Sentry.User? Create();
}
public interface ISession
{
string? DistinctId { get; }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ namespace Sentry
{
void Apply(Sentry.Scope scope, object state);
}
public interface ISentryUserFactory
{
Sentry.User? Create();
}
public interface ISession
{
string? DistinctId { get; }
Expand Down

0 comments on commit 69bef53

Please sign in to comment.