-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer Api Poc: Public Relationship Template References (#941)
* feat: Add method to IUserContext to get the client id * feat: Add method to IUserContext to get client id * feat: Add endpoint, controller and bruno files for querying the public relationship template references * chore: Add example references to appsettings override * chore: Make public relationship template references optional in appsettings --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2d129ee
commit 42987e3
Showing
10 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ttp/PublicRelationshipTemplateReferences/List Public Relationship Template References.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
meta { | ||
name: List Public Relationship Template References | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
get { | ||
url: {{pocUrl}}/PublicRelationshipTemplateReferences | ||
body: none | ||
auth: inherit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...c/Relationships.ConsumerApi/Controllers/PublicRelationshipTemplateReferencesController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Backbone.BuildingBlocks.API.Mvc; | ||
using Backbone.BuildingBlocks.Application.Abstractions.Infrastructure.UserContext; | ||
using MediatR; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace Backbone.Modules.Relationships.ConsumerApi.Controllers; | ||
|
||
[Route("api/poc/[controller]")] | ||
[Authorize("OpenIddict.Validation.AspNetCore")] | ||
public class PublicRelationshipTemplateReferencesController : ApiControllerBase | ||
{ | ||
private readonly Configuration _options; | ||
|
||
public PublicRelationshipTemplateReferencesController(IMediator mediator, IOptions<Configuration> options) : base(mediator) | ||
{ | ||
_options = options.Value; | ||
} | ||
|
||
[HttpGet] | ||
public IActionResult ListPublicRelationshipTemplateReferences(IUserContext userContext) | ||
{ | ||
var clientId = userContext.GetClientId(); | ||
var response = _options.PublicRelationshipTemplateReferences.GetValueOrDefault(clientId) ?? []; | ||
|
||
return Ok(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters