Skip to content

v0.8 Alpha

Compare
Choose a tag to compare
@Hawxy Hawxy released this 03 Jan 04:03
· 11 commits to main since this release
4d03308

Breaking Changes

  • Updated OpenFga.Sdk to 0.2.0
  • Obsoleted AddOpenFga, use AddOpenFgaClient & AddOpenFgaMiddleware instead:
- builder.Services.AddOpenFga(clientConfig =>
{
    clientConfig.WithAuth0FgaDefaults(builder.Configuration["Auth0Fga:ClientId"], builder.Configuration["Auth0Fga:ClientSecret"]);
    clientConfig.StoreId = builder.Configuration["Auth0Fga:StoreId"];  
- }, middlewareConfig =>
{
    middlewareConfig.UserIdentityResolver = principal => principal.Identity!.Name!;
});

+ builder.Services.AddOpenFgaClient(clientConfig =>
{
    clientConfig.WithAuth0FgaDefaults(builder.Configuration["Auth0Fga:ClientId"], builder.Configuration["Auth0Fga:ClientSecret"]);
    clientConfig.StoreId = builder.Configuration["Auth0Fga:StoreId"];  
});

+ builder.Services.AddOpenFgaMiddleware(middlewareConfig =>
{
    middlewareConfig.UserIdentityResolver = principal => principal.Identity!.Name!;
});

New Features

  • FgaPropertyObjectAttribute now parses JSON asynchronously.
  • Dual-targeted .NET 6 & .NET 7

Note about DSL v1.1

In order to use the built-in attributes with DSL v1.1, you must pass in a user type via the resolver:

    config.UserIdentityResolver = principal => $"user:{principal.Identity!.Name!}";

This is a bit clunky, so expect this syntax to change in a future release. If you encounter any other rough edges with v1.1, please open an issue.