Skip to content

Commit

Permalink
feat: add account dynamic claims api
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnkwlp committed Apr 2, 2024
1 parent e7fbeef commit 4338024
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.*">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 5 additions & 1 deletion host/src/Sample.HttpApi.Host/SampleHttpApiHostModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,12 @@ private void ConfigureConventionalControllers()

private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
{
var authority = configuration["AuthServer:Authority"];
if (string.IsNullOrWhiteSpace(authority))
return;

context.Services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
authority,
new Dictionary<string, string>
{
{"Sample", "Sample API"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("/api/account/admin/settings")]
public class AccountAdminSettingsController : AccountBaseController, IAccountAdminSettingsAppService
public class AccountAdminSettingsController : AbpControllerBase, IAccountAdminSettingsAppService
{
private readonly IAccountAdminSettingsAppService _service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/authentication/logins")]
public class AccountAuthenticationLoginController : AccountBaseController, IAccountAuthenticationLoginAppService
public class AccountAuthenticationLoginController : AbpControllerBase, IAccountAuthenticationLoginAppService
{
protected IAccountAuthenticationLoginAppService Service { get; }

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/claims")]
public class AccountClaimsController : AccountBaseController, IAccountClaimsAppService
public class AccountClaimsController : AbpControllerBase, IAccountClaimsAppService
{
protected IAccountClaimsAppService Service { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("/api/account/dynamic-claims")]
public class AccountDynamicClaimsController : AbpControllerBase, IDynamicClaimsAppService
{
protected IDynamicClaimsAppService DynamicClaimsAppService { get; }

public AccountDynamicClaimsController(IDynamicClaimsAppService dynamicClaimsAppService)
{
DynamicClaimsAppService = dynamicClaimsAppService;
}

[HttpPost]
[Route("refresh")]
public virtual Task RefreshAsync()
{
return DynamicClaimsAppService.RefreshAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
using JetBrains.Annotations;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[ControllerName("AccountExternal")]
[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/external")]
public class AccountExternalController : AccountBaseController, IAccountExternalAppService
public class AccountExternalController : AbpControllerBase, IAccountExternalAppService
{
protected IAccountExternalAppService ExternalAppService { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/impersonation")]
public class AccountImpersonationController : AccountBaseController, IAccountImpersonationAppService
public class AccountImpersonationController : AbpControllerBase, IAccountImpersonationAppService
{
private readonly IAccountImpersonationAppService _service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using Passingwind.Abp.Account;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Identity;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/link-user")]
public class AccountLinkUserController : AccountBaseController, IAccountLinkUserAppService
public class AccountLinkUserController : AbpControllerBase, IAccountLinkUserAppService
{
private readonly IAccountLinkUserAppService _service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[Area(AccountRemoteServiceConsts.RemoteServiceName)]
[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Route("api/account")]
public class AccountLoginController : AccountBaseController, IAccountLoginAppService
public class AccountLoginController : AbpControllerBase, IAccountLoginAppService
{
private readonly IAccountLoginAppService _service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using Passingwind.Abp.Identity;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("/api/account/security-logs")]
public class AccountSecurityLogsController : AccountBaseController, IAccountSecurityLogsAppService
public class AccountSecurityLogsController : AbpControllerBase, IAccountSecurityLogsAppService
{
private readonly IAccountSecurityLogsAppService _service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("/api/account/2fa")]
public class AccountTfaController : AccountBaseController, IAccountTfaAppService
public class AccountTfaController : AbpControllerBase, IAccountTfaAppService
{
protected IAccountTfaAppService TfaAppService { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Passingwind.Abp.Account;

[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area(AccountRemoteServiceConsts.ModuleName)]
[Route("api/account/user-delegation")]
public class AccountUserDelegationController : AccountBaseController, IAccountUserDelegationAppService
public class AccountUserDelegationController : AbpControllerBase, IAccountUserDelegationAppService
{
private readonly IAccountUserDelegationAppService _service;

Expand Down

0 comments on commit 4338024

Please sign in to comment.