Compare commits
3
Commits
e1e151a834
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4e430a98f | ||
|
|
a87ea5d64d | ||
|
|
b00391517a |
@@ -1,12 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xIdentityHelper;
|
using xIdentityHelper;
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using IdentityModel.Client;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xIdentityHelper;
|
using xIdentityHelper;
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
|
using IdentityModel.Client;
|
||||||
using xExceptions.Constants;
|
using xExceptions.Constants;
|
||||||
using xIdentityModels.Extensions;
|
using System.Threading.Tasks;
|
||||||
using xIdentityModels.Models;
|
using xIdentityModels.Models;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using static xIdentityHelper.XApiScopeHelper;
|
using xIdentityModels.Extensions;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using static xIdentityHelper.XApiScopeHelper;
|
||||||
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using xModels.Dtos;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using xIdentityHelper;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xExceptions.Constants;
|
|
||||||
using xIdentityHelper;
|
|
||||||
using xIdentityModels.Constants;
|
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
|
using xExceptions.Constants;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using xIdentityModels.Constants;
|
||||||
|
using System.Collections.Generic;
|
||||||
using xIdentityModels.Navigations;
|
using xIdentityModels.Navigations;
|
||||||
using xModels.Dtos;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xCommons.Attributes;
|
|
||||||
using xCommons.Constants;
|
using xCommons.Constants;
|
||||||
|
using xCommons.Attributes;
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using xModels.Dtos;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xIdentityHelper;
|
using xIdentityHelper;
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using xIdentityModels.Models;
|
using xIdentityModels.Models;
|
||||||
using xModels.Dtos;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using xModels.Dtos;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using xIdentityHelper;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xIdentityHelper;
|
using System.Threading.Tasks;
|
||||||
using xModels.Dtos;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xIdentityHelper;
|
using xIdentityHelper;
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xExceptions.Constants;
|
using xExceptions.Constants;
|
||||||
using xIdentityModels.Constants;
|
using System.Threading.Tasks;
|
||||||
using xIdentityModels.Models;
|
using xIdentityModels.Models;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using xIdentityModels.Constants;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using xModels.Dtos;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using xIdentityHelper;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xIdentityHelper;
|
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
using xModels.Dtos;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using xIdentityHelper;
|
using xIdentityHelper;
|
||||||
using xCommons.Attributes;
|
using xCommons.Attributes;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using static IdentityServer4.IdentityServerConstants;
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using xIds.Interfaces;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using xCommons.Configurations;
|
|
||||||
using xCommons.Providers;
|
using xCommons.Providers;
|
||||||
using xIds.Controllers.Base;
|
using xIds.Controllers.Base;
|
||||||
using xIds.Interfaces;
|
using xCommons.Configurations;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,253 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using xModels.Dtos;
|
||||||
|
using System.Threading;
|
||||||
|
using xIdentityHelper;
|
||||||
|
using xCommons.Attributes;
|
||||||
|
using xCommons.Extensions;
|
||||||
|
using xIdentityModels.Dtos;
|
||||||
|
using xExceptions.Constants;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using xIdentityModels.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
public partial class ApplicationsController
|
public partial class ApplicationsController
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
#region ApiKey ...
|
#region ApiKey ...
|
||||||
|
/// <summary>
|
||||||
|
/// Get Specified ApiKey ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/ApiKeys/{id}")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> GetApiKey(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (id.IsDefaultGuid())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetApiKeyAsync(
|
||||||
|
id: id,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified ApiKey ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpDelete("Applications/ApiKeys/{id}")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> RemoveApiKey(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (id.IsDefaultGuid())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RemoveApiKeyAsync(
|
||||||
|
id: id,
|
||||||
|
softDelete: false,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Specified ApiKey ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpPut("Applications/ApiKeys/{id}")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> UpdateApiKey(
|
||||||
|
[FromRoute] Guid id,
|
||||||
|
[FromBody] XApiKeyDto item,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
id.IsDefaultGuid() ||
|
||||||
|
!item.IsValidForAdd()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.UpdateApiKeyAsync(
|
||||||
|
id: id,
|
||||||
|
item: item,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get All Specified ApiKeys ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/ApiKeys")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<IEnumerable<XApiKeyDto>>> GetAllApiKeys(
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetAllApiKeyAsync(
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.CreatedOn)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query ApiKeys ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/ApiKeys/Query")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XQueryResult<XApiKeyDto>>> QueryApiKeys(
|
||||||
|
[FromRoute] XQuery query,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.QueryApiKeyAsync(
|
||||||
|
query: query,
|
||||||
|
predicate: null,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.CreatedOn)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,299 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using xModels.Dtos;
|
||||||
|
using xIdentityHelper;
|
||||||
|
using System.Threading;
|
||||||
|
using xCommons.Attributes;
|
||||||
|
using xCommons.Extensions;
|
||||||
|
using xIdentityModels.Dtos;
|
||||||
|
using xExceptions.Constants;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using xIdentityModels.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
public partial class ApplicationsController
|
public partial class ApplicationsController
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
#region ApiKeyUsage ...
|
#region ApiKeyUsage ...
|
||||||
|
/// <summary>
|
||||||
|
/// Add Api Key Usage ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpPost("Applications/ApiKeys/Usages")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApiKeyUsageDto>> AddApiKeyUsage(
|
||||||
|
[FromBody] XApiKeyUsageDto item,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (item.IsValidForAdd())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.AddApiKeyUsageAsync(
|
||||||
|
item: item,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Specified Api Key Usage ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpGet("Applications/ApiKeys/Usages/{id}")]
|
||||||
|
public async Task<ActionResult<XApiKeyUsageDto>> GetApiKeyUsage(
|
||||||
|
[FromRoute] long id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (id <= 0)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetApiKeyUsageAsync(
|
||||||
|
id: id,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified Api Key Usage ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpDelete("Applications/ApiKeys/Usages/{id}")]
|
||||||
|
public async Task<ActionResult<XApiKeyUsageDto>> RemoveApiKeyUsage(
|
||||||
|
[FromRoute] long id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (id <= 0)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RemoveApiKeyUsageAsync(
|
||||||
|
id: id,
|
||||||
|
softDelete: false,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Specified Api Key Usage ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPut("Applications/ApiKeys/Usages/{id}")]
|
||||||
|
public async Task<ActionResult<XApiKeyUsageDto>> UpdateApiKeyUsage(
|
||||||
|
[FromRoute] long id,
|
||||||
|
[FromBody] XApiKeyUsageDto item,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
id <= 0 ||
|
||||||
|
!item.IsValidForAdd()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.UpdateApiKeyUsageAsync(
|
||||||
|
id: id,
|
||||||
|
item: item,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get All Api Key Usages ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/ApiKeys/Usages")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<IEnumerable<XApiKeyUsageDto>>> GetAllApiKeyUsages(
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetAllApiKeyUsageAsync(
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.RequestedOn)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Api Key Usages ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/ApiKeys/Usages/Query")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XQueryResult<XApiKeyUsageDto>>> QueryApiKeyUsages(
|
||||||
|
[FromRoute] XQuery query,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.QueryApiKeyUsageAsync(
|
||||||
|
query: query,
|
||||||
|
predicate: null,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.RequestedOn)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using xModels.Dtos;
|
||||||
|
using xIdentityHelper;
|
||||||
|
using System.Threading;
|
||||||
|
using xCommons.Attributes;
|
||||||
|
using xCommons.Extensions;
|
||||||
using xIdentityModels.Dtos;
|
using xIdentityModels.Dtos;
|
||||||
|
using xExceptions.Constants;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using xIdentityModels.Extensions;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
namespace xIds.Controllers
|
namespace xIds.Controllers
|
||||||
{
|
{
|
||||||
@@ -6,14 +20,296 @@ namespace xIds.Controllers
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
#region Application ...
|
#region Application ...
|
||||||
[HttpPost]
|
/// <summary>
|
||||||
|
/// Create Application ...
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Sample request:
|
||||||
|
///
|
||||||
|
/// {
|
||||||
|
/// "type": 0,
|
||||||
|
/// "name": "string",
|
||||||
|
/// "description": "string",
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[RequireXPowered]
|
[RequireXPowered]
|
||||||
|
[HttpPost("Applications")]
|
||||||
[Authorize(LocalApi.PolicyName)]
|
[Authorize(LocalApi.PolicyName)]
|
||||||
[Authorize(Policy = XPolicies.EnabledUser)]
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
public async Task<ActionResult<XApplicationDto>> CreateApplication(
|
public async Task<ActionResult<XApplicationDto>> CreateApplication(
|
||||||
[FromBody] XApplicationDto request,
|
[FromBody] XApplicationDto item,
|
||||||
CancellationToken cancellationToken = default
|
CancellationToken cancellationToken = default
|
||||||
) {}
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (!item.IsValidForAdd())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.AddApplicationAsync(
|
||||||
|
item: item,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Specified Application ...
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Sample request:
|
||||||
|
///
|
||||||
|
/// {
|
||||||
|
/// "id": 0,
|
||||||
|
/// "type": 0,
|
||||||
|
/// "name": "string",
|
||||||
|
/// "description": "string",
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[HttpPut("Applications")]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApplicationDto>> UpdateApplication(
|
||||||
|
[FromBody] XApplicationDto item,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (!item.IsValidForAdd())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.UpdateApplicationAsync(
|
||||||
|
item: item,
|
||||||
|
id: item.Id,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified Application ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpDelete("Applications/{id}")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApplicationDto>> RemoveApplication(
|
||||||
|
[FromRoute] int id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (!id.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RemoveApplicationAsync(
|
||||||
|
id: id,
|
||||||
|
softDelete: false,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Specified Application ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/{id}")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XApplicationDto>> GetApplication(
|
||||||
|
[FromRoute] int id,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (!id.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetApplicationAsync(
|
||||||
|
id: id,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get All Application ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<IEnumerable<XApplicationDto>>> GetAllApplications(
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetAllApplicationAsync(
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.Id)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query Applications ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpGet("Applications/Query")]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
public async Task<ActionResult<XQueryResult<XApplicationDto>>> QueryApplications(
|
||||||
|
[FromRoute] XQuery query,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.QueryApplicationAsync(
|
||||||
|
query: query,
|
||||||
|
predicate: null,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.Id)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,484 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using xIdentityHelper;
|
||||||
|
using System.Threading;
|
||||||
|
using xCommons.Attributes;
|
||||||
|
using xCommons.Extensions;
|
||||||
|
using xIdentityModels.Dtos;
|
||||||
|
using xExceptions.Constants;
|
||||||
|
using xIdentityModels.Models;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using xIdentityModels.Extensions;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using static IdentityServer4.IdentityServerConstants;
|
||||||
|
|
||||||
|
namespace xIds.Controllers
|
||||||
|
{
|
||||||
|
public partial class ApplicationsController
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Create Api Key ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPost("Applications/{applicationId}/ApiKeys/Create")]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> CreateApiKey(
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
[FromBody] XCreateApiKeyRequest request,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
!request.IsValid() ||
|
||||||
|
!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.CreateApiKey(
|
||||||
|
userInfo: userInfo,
|
||||||
|
scopes: request.Scopes,
|
||||||
|
applicationId: applicationId,
|
||||||
|
rateLimit: request.RateLimit,
|
||||||
|
allowedIPs: request.AllowedIPs,
|
||||||
|
expiration: request.Expiration,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove Specified Api Key ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyId"></param>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpDelete("Applications/{applicationId}/ApiKeys/{apiKeyId}")]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> RemoveApiKey(
|
||||||
|
[FromRoute] Guid apiKeyId,
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
apiKeyId.IsDefaultGuid() ||
|
||||||
|
!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RemoveApiKeyAsync(
|
||||||
|
id: apiKeyId,
|
||||||
|
softDelete: false,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rotate Specified Api Key ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyId"></param>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPost("Applications/{applicationId}/ApiKeys/{apiKeyId}")]
|
||||||
|
public async Task<ActionResult<XApiKeyDto>> RotateApiKey(
|
||||||
|
[FromRoute] Guid apiKeyId,
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
[FromBody] XRotateApiKeyRequest request,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
apiKeyId.IsDefaultGuid() ||
|
||||||
|
!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
if (
|
||||||
|
request.IsNullOrDefault() ||
|
||||||
|
request.NewExpiration.IsNull() ||
|
||||||
|
!request.NewExpiration.HasValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var timeSpan = TimeSpan.FromMinutes(apiKeyConfiguration.DefaultExpirationMinutes);
|
||||||
|
request = new XRotateApiKeyRequest
|
||||||
|
{
|
||||||
|
NewExpiration = timeSpan
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RotateApiKey(
|
||||||
|
apiKeyId: apiKeyId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
newExpiration: request.NewExpiration,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Revoke Specified Api Key ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyId"></param>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPost("Applications/{applicationId}/ApiKeys/{apiKeyId}/Revoke")]
|
||||||
|
public async Task<ActionResult<bool>> RevokeApiKey(
|
||||||
|
[FromRoute] Guid apiKeyId,
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
apiKeyId.IsDefaultGuid() ||
|
||||||
|
!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.RevokeApiKey(
|
||||||
|
apiKeyId: apiKeyId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Application's Api Keys ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPost("Applications/{applicationId}/ApiKeys")]
|
||||||
|
public async Task<ActionResult<IEnumerable<XApiKeyDto>>> GetApiKeys(
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.GetApplicationApiKeys(
|
||||||
|
userInfo: userInfo,
|
||||||
|
applicationId: applicationId,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve Specified Api Keys Usages ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyId"></param>
|
||||||
|
/// <param name="applicationId"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[Authorize(Policy = XPolicies.EnabledUser)]
|
||||||
|
[HttpPost("Applications/{applicationId}/ApiKeys/{apiKeyId}/Usages")]
|
||||||
|
public async Task<ActionResult<IEnumerable<XApiKeyUsageDto>>> GetApiKeyUsages(
|
||||||
|
[FromRoute] Guid apiKeyId,
|
||||||
|
[FromRoute] int applicationId,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
if (
|
||||||
|
apiKeyId.IsDefaultGuid() ||
|
||||||
|
!applicationId.IsValidIntId())
|
||||||
|
{
|
||||||
|
XException.InvalidArgs.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Application for Validating ...
|
||||||
|
var application = await provider.GetApplicationAsync(
|
||||||
|
id: applicationId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve ApiKey for Validating ...
|
||||||
|
var apiKey = await provider.GetApiKeyAsync(
|
||||||
|
id: apiKeyId,
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true
|
||||||
|
);
|
||||||
|
if (application.IsNullOrDefault())
|
||||||
|
{
|
||||||
|
XException.NotFound.Throw();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.FindManyApiKeyUsageAsync(
|
||||||
|
userInfo: userInfo,
|
||||||
|
includeBuilder: null,
|
||||||
|
ignoreSoftDeleteds: true,
|
||||||
|
cancellationToken: cancellationToken,
|
||||||
|
predicate: x => x.ApiKeyId == apiKeyId,
|
||||||
|
orderBuilder: x => x.OrderBy(y => y.RequestedOn)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Validate Specifed Api Key ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[RequireXPowered]
|
||||||
|
[Authorize(LocalApi.PolicyName)]
|
||||||
|
[HttpPost("Applications/ApiKeys/Validate")]
|
||||||
|
public async Task<ActionResult<XApiKeyValidationResult>> ValidateApiKey(
|
||||||
|
[FromBody] XApiKeyValidationRequest request,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
await ValidationProvider
|
||||||
|
.GroupValidationBuilder()
|
||||||
|
.AddNotNull(request)
|
||||||
|
.AddNotEmpty(request.ApiKey)
|
||||||
|
.AddNotEmpty(request.ClientIP)
|
||||||
|
.ValidateGroupAsync();
|
||||||
|
|
||||||
|
//
|
||||||
|
var userInfo = await GetUserInfo();
|
||||||
|
|
||||||
|
//
|
||||||
|
var result = await provider.ValidateApiKey(
|
||||||
|
userInfo: userInfo,
|
||||||
|
apiKey: request.ApiKey,
|
||||||
|
clientIP: request.ClientIP,
|
||||||
|
requiredScope: request.RequiredScope,
|
||||||
|
cancellationToken: cancellationToken
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return Ok(result.ToDynamicObject());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var result = GetExceptionActionResult(ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using xIds.Interfaces;
|
using xIds.Interfaces;
|
||||||
using xCommons.Providers;
|
using xCommons.Providers;
|
||||||
|
using xIds.Configurations;
|
||||||
using xIds.Controllers.Base;
|
using xIds.Controllers.Base;
|
||||||
using xCommons.Configurations;
|
using xCommons.Configurations;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -13,17 +14,25 @@ namespace xIds.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public partial class ApplicationsController : XIBaseController
|
public partial class ApplicationsController : XIBaseController
|
||||||
{
|
{
|
||||||
|
private readonly IXApplicationProvider provider;
|
||||||
|
private readonly XApiKeyConfiguration apiKeyConfiguration;
|
||||||
|
|
||||||
public ApplicationsController(
|
public ApplicationsController(
|
||||||
ILogger<ApplicationsController> logger,
|
IXApplicationProvider provider,
|
||||||
XAppConfiguration appConfiguration,
|
|
||||||
IXIdentityManager identityManager,
|
IXIdentityManager identityManager,
|
||||||
XValidationProvider validationProvider
|
XAppConfiguration appConfiguration,
|
||||||
|
ILogger<ApplicationsController> logger,
|
||||||
|
XValidationProvider validationProvider,
|
||||||
|
XApiKeyConfiguration apiKeyConfiguration
|
||||||
) : base(
|
) : base(
|
||||||
logger,
|
logger,
|
||||||
appConfiguration,
|
appConfiguration,
|
||||||
identityManager,
|
identityManager,
|
||||||
validationProvider
|
validationProvider
|
||||||
)
|
)
|
||||||
{ }
|
{
|
||||||
|
this.provider = provider;
|
||||||
|
this.apiKeyConfiguration = apiKeyConfiguration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,14 @@ namespace xIds.Providers
|
|||||||
exists = exists.UpdateData(
|
exists = exists.UpdateData(
|
||||||
updateWith: item,
|
updateWith: item,
|
||||||
propertyWhiteList: [],
|
propertyWhiteList: [],
|
||||||
propertyBlackList: []
|
propertyBlackList: [
|
||||||
|
nameof(XApiKey.Id),
|
||||||
|
nameof(XApiKey.KeyHash),
|
||||||
|
nameof(XApiKey.KeyPrefix),
|
||||||
|
nameof(XApiKey.CreatedOn),
|
||||||
|
nameof(XApiKey.Application),
|
||||||
|
nameof(XApiKey.ApplicationId),
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ namespace xIds.Providers
|
|||||||
updateWith: item,
|
updateWith: item,
|
||||||
propertyWhiteList: [],
|
propertyWhiteList: [],
|
||||||
propertyBlackList: [
|
propertyBlackList: [
|
||||||
|
nameof(XApiKeyUsage.Id),
|
||||||
|
nameof(XApiKeyUsage.ApiKeyId),
|
||||||
nameof(XApiKeyUsage.ResponseTimeMs),
|
nameof(XApiKeyUsage.ResponseTimeMs),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -138,7 +138,9 @@ namespace xIds.Providers
|
|||||||
updateWith: item,
|
updateWith: item,
|
||||||
propertyWhiteList: [],
|
propertyWhiteList: [],
|
||||||
propertyBlackList: [
|
propertyBlackList: [
|
||||||
|
nameof(XApiKey.Id),
|
||||||
nameof(XApplication.ApiKeys),
|
nameof(XApplication.ApiKeys),
|
||||||
|
nameof(XApplication.CreatedOn),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -29,13 +29,15 @@
|
|||||||
|
|
||||||
<!-- Local Dependencies -->
|
<!-- Local Dependencies -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xDashboard.xMessageService" Version="1.0.0" />
|
<!-- <PackageReference Include="xDashboard.xMessageService" Version="1.0.0" />
|
||||||
<PackageReference Include="xDashboard.xStorageService" Version="1.0.0" />
|
<PackageReference Include="xDashboard.xStorageService" Version="1.0.0" /> -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Project Dependencies -->
|
<!-- Project Dependencies -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Modules\xIdentityHelper\xIdentityHelper.csproj" />
|
<ProjectReference Include="..\Modules\xIdentityHelper\xIdentityHelper.csproj" />
|
||||||
|
<ProjectReference Include="..\Modules\xMessageService\xMessageService.csproj" />
|
||||||
|
<ProjectReference Include="..\Modules\xStorageService\xStorageService.csproj" />
|
||||||
<ProjectReference Include="..\Modules\xIdentityService\xIdentityService.csproj" />
|
<ProjectReference Include="..\Modules\xIdentityService\xIdentityService.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user