This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'saga-rm' of https://github.com/ZA-PT/Obsidian into saga-rm
- Loading branch information
Showing
16 changed files
with
109 additions
and
325 deletions.
There are no files selected for viewing
11 changes: 0 additions & 11 deletions
11
src/Obsidian.Application/ClientManagement/ClientCreationResult.cs
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/Obsidian.Application/ClientManagement/ClientSecretUpdateResult.cs
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/Obsidian.Application/ClientManagement/ClientService.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,44 @@ | ||
using Obsidian.Domain; | ||
using Obsidian.Domain.Repositories; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Obsidian.Application.ClientManagement | ||
{ | ||
public class ClientService | ||
{ | ||
private readonly IClientRepository _repo; | ||
public ClientService(IClientRepository repo) | ||
{ | ||
_repo = repo; | ||
} | ||
|
||
public async Task<Client> CreateClient(string displayName,string redirectUri) | ||
{ | ||
var client = Client.Create(Guid.NewGuid(), redirectUri); | ||
client.DisplayName = displayName; | ||
client.UpdateSecret(); | ||
await _repo.AddAsync(client); | ||
return client; | ||
} | ||
|
||
public async Task<Client> UpdateClientSecret(Guid clientId) | ||
{ | ||
var client = await _repo.FindByIdAsync(clientId); | ||
client.UpdateSecret(); | ||
await _repo.SaveAsync(client); | ||
return client; | ||
} | ||
|
||
public async Task<Client> UpdateClient(Guid clientId,string displayName,string redirectUri) | ||
{ | ||
var client = await _repo.FindByIdAsync(clientId); | ||
client.DisplayName = displayName; | ||
client.RedirectUri = new Uri(redirectUri); | ||
await _repo.SaveAsync(client); | ||
return client; | ||
} | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
src/Obsidian.Application/ClientManagement/CreateClientCommand.cs
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
src/Obsidian.Application/ClientManagement/CreateClientSaga.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/Obsidian.Application/ClientManagement/UpdateClientCommand.cs
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
src/Obsidian.Application/ClientManagement/UpdateClientSaga.cs
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/Obsidian.Application/ClientManagement/UpdateClientSecretCommand.cs
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/Obsidian.Application/ScopeManagement/CreateScopeCommand.cs
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
src/Obsidian.Application/ScopeManagement/CreateScopeSaga.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Obsidian.Application/ScopeManagement/ScopeCreationResult.cs
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
using Obsidian.Domain; | ||
using Obsidian.Domain.Repositories; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Obsidian.Application.ScopeManagement | ||
{ | ||
public class ScopeService | ||
{ | ||
private readonly IPermissionScopeRepository _repo; | ||
public ScopeService(IPermissionScopeRepository repo) | ||
{ | ||
_repo = repo; | ||
} | ||
|
||
public async Task<PermissionScope> CreateScope(string scopeName,string displayName,string description,IList<ObsidianClaim> claims) | ||
{ | ||
var scope = PermissionScope.Create(Guid.NewGuid(),scopeName,displayName, description); | ||
scope.Claims = claims; | ||
await _repo.AddAsync(scope); | ||
return scope; | ||
} | ||
|
||
public async Task<PermissionScope> UpdateScope(Guid Id, string displayName, string description, IList<ObsidianClaim> claims) | ||
{ | ||
var scope = await _repo.FindByIdAsync(Id); | ||
scope.Description = description; | ||
scope.DisplayName = displayName; | ||
scope.Claims = claims; | ||
await _repo.SaveAsync(scope); | ||
return scope; | ||
} | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/Obsidian.Application/ScopeManagement/UpdateScopeCommand.cs
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
src/Obsidian.Application/ScopeManagement/UpdateScopeSaga.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.