Skip to content

Commit

Permalink
removed some build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Duft committed Apr 29, 2024
1 parent 636afb8 commit d522be0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ dotnet_diagnostic.CA1848.severity = none
# CA1852: Type 'Program' can be sealed because it has no subtypes in its containing assembly and is not externally visible
dotnet_diagnostic.CA1852.severity = none

# IDE0005
dotnet_diagnostic.IDE0005.severity = none
# IDE0290: Use primary constructor (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0290)
dotnet_diagnostic.IDE0290.severity = none

Expand Down
28 changes: 14 additions & 14 deletions samples/Server/ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ string environmentName
});
}

services.AddOpenIddict()
// Register the OpenIddict core components.
services.AddOpenIddict()
// Register the OpenIddict core components.
.AddCore(options =>
{
options.UseEntityFrameworkCore();
if (!Helpers.Constants.IsTestingEnvironment(environmentName))
{
options.UseQuartz();
}
})
// Register the OpenIddict server components.
})
// Register the OpenIddict server components.
.AddServer(options =>
{
options.SetIssuer(new Uri("https://localhost:5001/"));
Expand Down Expand Up @@ -139,17 +139,17 @@ string environmentName
{
options.DisableAccessTokenEncryption();
}
})
// Register the OpenIddict validation components.
})
// Register the OpenIddict validation components.
.AddValidation(options =>
{
// Import the configuration from the local OpenIddict server instance.
options.UseLocalServer();

// Register the ASP.NET Core host.
options.UseAspNetCore();
})
// Register the EF based UI Store for OpenIddict related entities.
})
// Register the EF based UI Store for OpenIddict related entities.
.AddUIStore(options =>
{
options.OpenIddictUIContext = builder =>
Expand All @@ -164,8 +164,8 @@ string environmentName
.Name);
});
};
})
// Register the APIs for the EF based UI Store based on OpenIddict.
})
// Register the APIs for the EF based UI Store based on OpenIddict.
.AddUIApis(options =>
{
// Tell the system about the allowed Permissions it is built/configured for.
Expand All @@ -185,8 +185,8 @@ string environmentName
Permissions.Prefixes.Scope + "server_scope",
Permissions.Prefixes.Scope + "api_scope"
];
})
// Register the EF based UI Store for the ASP.NET Identity related entities.
})
// Register the EF based UI Store for the ASP.NET Identity related entities.
.AddUIIdentityStore<ApplicationUser>(options =>
{
options.OpenIddictUIIdentityContext = builder =>
Expand All @@ -201,8 +201,8 @@ string environmentName
.Name);
});
};
})
// Register the APIs for the EF based UI Store based on ASP.NET Identity.
})
// Register the APIs for the EF based UI Store based on ASP.NET Identity.
.AddUIIdentityApis<ApplicationUser>();

if (!Helpers.Constants.IsTestingEnvironment(environmentName))
Expand Down
16 changes: 9 additions & 7 deletions src/identity/OpenIddict.UI.Identity.Api/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static IServiceCollection AddAuthorizationServices(
Action<AuthorizationPolicyBuilder> policy
)
{
services.AddAuthorizationBuilder()
services.AddAuthorizationBuilder()
.AddPolicy(Policies.OpenIddictUiIdentityApiPolicy, policy
);

Expand All @@ -85,12 +85,14 @@ string routePrefix
{
builder.Services.AddControllers(options =>
{
options.UseOpenIddictUIRoutePrefix(routePrefix, new List<Type>
{
typeof(AccountController),
typeof(ClaimTypeController),
typeof(RoleController)
});
options.UseOpenIddictUIRoutePrefix(
routePrefix,
[
typeof(AccountController),
typeof(ClaimTypeController),
typeof(RoleController)
]
);
});

return builder;
Expand Down
14 changes: 8 additions & 6 deletions src/openiddict/OpenIddict.UI.Api/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static IServiceCollection AddAuthorizationServices(
Action<AuthorizationPolicyBuilder> policy
)
{
services.AddAuthorizationBuilder()
services.AddAuthorizationBuilder()
.AddPolicy(Policies.OpenIddictUiApiPolicy, policy
);

Expand All @@ -61,11 +61,13 @@ string routePrefix
{
builder.Services.AddControllers(options =>
{
options.UseOpenIddictUIRoutePrefix(routePrefix, new List<Type>
{
typeof(ApplicationController),
typeof(ScopeController)
});
options.UseOpenIddictUIRoutePrefix(
routePrefix,
[
typeof(ApplicationController),
typeof(ScopeController)
]
);
});

return builder;
Expand Down

0 comments on commit d522be0

Please sign in to comment.