Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Sail.Compass/Management/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public static IServiceCollection AddRetryPolicyUpdater(

public static void UseCompassUpdaters(this IServiceProvider serviceProvider)
{
_ = serviceProvider.GetService<CorsPolicyUpdater>();
_ = serviceProvider.GetService<RateLimiterPolicyUpdater>();
_ = serviceProvider.GetService<AuthenticationPolicyUpdater>();
_ = serviceProvider.GetService<TimeoutPolicyUpdater>();
_ = serviceProvider.GetService<RetryPolicyUpdater>();
serviceProvider.GetService<CorsPolicyUpdater>();
serviceProvider.GetService<RateLimiterPolicyUpdater>();
serviceProvider.GetService<AuthenticationPolicyUpdater>();
serviceProvider.GetService<TimeoutPolicyUpdater>();
serviceProvider.GetService<RetryPolicyUpdater>();
}
}
2 changes: 0 additions & 2 deletions src/Sail.Core/Entities/AuthenticationPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ public class AuthenticationPolicy
public AuthenticationSchemeType Type { get; set; }
public bool Enabled { get; set; } = true;
public string? Description { get; set; }

public JwtBearerConfig? JwtBearer { get; set; }
public OpenIdConnectConfig? OpenIdConnect { get; set; }

public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow;
}
Expand Down
32 changes: 16 additions & 16 deletions src/Sail.Database.MongoDB/Extensions/DbSetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@ namespace Sail.Database.MongoDB.Extensions;

public static class DbSetExtensions
{
public static Task<IChangeStreamCursor<ChangeStreamDocument<T>>> WatchAsync<T>(
this DbSet<T> dbSet,
ChangeStreamOptions? options = null,
CancellationToken cancellationToken = default)
where T : class
{
var context = dbSet.GetService<ICurrentDbContext>().Context;
var mongoClientWrapper = context.GetService<IMongoClientWrapper>();

var entityType = context.Model.FindEntityType(typeof(T))!;
var collectionName = entityType.GetCollectionName();
var collection = mongoClientWrapper.GetCollection<T>(collectionName);

return collection.WatchAsync(options, cancellationToken);
}

public static async IAsyncEnumerable<ChangeStreamEvent<T>> WatchAsync<T>(
this DbSet<T> dbSet,
[EnumeratorCancellation] CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -67,4 +51,20 @@ public static async IAsyncEnumerable<ChangeStreamEvent<T>> WatchAsync<T>(
}
}
}

private static Task<IChangeStreamCursor<ChangeStreamDocument<T>>> WatchAsync<T>(
this DbSet<T> dbSet,
ChangeStreamOptions? options = null,
CancellationToken cancellationToken = default)
where T : class
{
var context = dbSet.GetService<ICurrentDbContext>().Context;
var mongoClientWrapper = context.GetService<IMongoClientWrapper>();

var entityType = context.Model.FindEntityType(typeof(T))!;
var collectionName = entityType.GetCollectionName();
var collection = mongoClientWrapper.GetCollection<T>(collectionName);

return collection.WatchAsync(options, cancellationToken);
}
}
6 changes: 6 additions & 0 deletions src/Sail.Kubernetes.Controller/Client/ResourceSelector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Sail.Kubernetes.Controller.Client;

public class ResourceSelector
{

}
Loading