Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
44,509 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
**/bin/ | ||
**/obj/ | ||
**/out/ | ||
Dockerfile* | ||
**/*.trx | ||
|
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
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
47 changes: 47 additions & 0 deletions
47
Covenant/Controllers/ViewControllers/CovenantUserController.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,47 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using System.Security.Cryptography.X509Certificates; | ||
|
||
using Microsoft.Rest; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
using Covenant.Core; | ||
using Covenant.API; | ||
using Covenant.API.Models; | ||
|
||
namespace Covenant.Controllers | ||
{ | ||
[Authorize] | ||
public class CovenantUserController : Controller | ||
{ | ||
private readonly CovenantAPI _client; | ||
|
||
public CovenantUserController(IConfiguration configuration) | ||
{ | ||
X509Certificate2 covenantCert = new X509Certificate2(Common.CovenantPublicCertFile); | ||
HttpClientHandler clientHandler = new HttpClientHandler | ||
{ | ||
ServerCertificateCustomValidationCallback = (sender, cert, chain, errors) => | ||
{ | ||
return cert.GetCertHashString() == covenantCert.GetCertHashString(); | ||
} | ||
}; | ||
_client = new CovenantAPI( | ||
new Uri("https://localhost:7443"), | ||
new TokenCredentials(configuration["CovenantToken"]), | ||
clientHandler | ||
); | ||
} | ||
|
||
// GET: /users/ | ||
public async Task<IActionResult> Index() | ||
{ | ||
return View(await _client.ApiUsersGetAsync()); | ||
} | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Covenant/Controllers/ViewControllers/CredentialController.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,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using System.Security.Cryptography.X509Certificates; | ||
using Microsoft.Rest; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
using Covenant.Core; | ||
using Covenant.API; | ||
using Covenant.API.Models; | ||
|
||
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 | ||
|
||
namespace Covenant.Controllers | ||
{ | ||
[Authorize] | ||
public class CredentialController : Controller | ||
{ | ||
private readonly CovenantAPI _client; | ||
|
||
public CredentialController(IConfiguration configuration) | ||
{ | ||
X509Certificate2 covenantCert = new X509Certificate2(Common.CovenantPublicCertFile); | ||
HttpClientHandler clientHandler = new HttpClientHandler | ||
{ | ||
ServerCertificateCustomValidationCallback = (sender, cert, chain, errors) => | ||
{ | ||
return cert.GetCertHashString() == covenantCert.GetCertHashString(); | ||
} | ||
}; | ||
_client = new CovenantAPI( | ||
new Uri("https://localhost:7443"), | ||
new TokenCredentials(configuration["CovenantToken"]), | ||
clientHandler | ||
); | ||
} | ||
|
||
// GET: /credential/ | ||
public async Task<IActionResult> Index() | ||
{ | ||
ViewBag.PasswordCredentials = await _client.ApiCredentialsPasswordsGetAsync(); | ||
ViewBag.HashCredentials = await _client.ApiCredentialsHashesGetAsync(); | ||
ViewBag.TicketCredentials = await _client.ApiCredentialsTicketsGetAsync(); | ||
return View(await _client.ApiCredentialsGetAsync()); | ||
} | ||
} | ||
} |
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,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
|
||
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 | ||
|
||
namespace Covenant.Controllers | ||
{ | ||
[Authorize] | ||
public class EventController : Controller | ||
{ | ||
// GET: /<controller>/ | ||
public IActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
Oops, something went wrong.