Skip to content

Commit

Permalink
more debugging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroves committed Nov 15, 2023
1 parent aaacaff commit 6122580
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
Couchbase__ScanConsistency: ${{ secrets.COUCHBASE__SCANCONSISTENCY }}
JwtSecret__Issuer: ${{ secrets.JWTSECRET__ISSUER }}
JwtSecret__Audience: ${{ secrets.JWTSECRET__AUDIENCE }}
JwtSecret__SecurityKey: "thisishardcodedtryingtofigureouttheissue29mjL7uvnxE6BDqP5aT3bYRg"
JwtSecret__SecurityKey: ${{ secrets.JWTSECRET__SECURITYKEY }}

services:
couchbase:
Expand Down
2 changes: 0 additions & 2 deletions Conduit/Conduit.Tests/Functional/FunctionalTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Conduit.Web;
using Conduit.Web.Users.Services;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;

namespace Conduit.Tests.Functional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void SetUp()
{
Audience = "doesntmatter-audience",
Issuer = "doesntmatter-issuer",
SecurityKey = "doesntmatter-securityKey"
SecurityKey = "doesntmatter-securityKey-doesntmatter-securityKey-doesntmatter-securityKey-doesntmatter-securityKey"
};
_handler = new GetProfileHandler(_userDataServiceMock.Object,
new GetProfileRequestValidator(),
Expand Down
20 changes: 18 additions & 2 deletions Conduit/Conduit.Web/Users/Services/JwtSecrets.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
namespace Conduit.Web.Users.Services;
using System.Text;

namespace Conduit.Web.Users.Services;

public class JwtSecrets
{
public string Issuer { get; set; }
public string Audience { get; set; }
public string SecurityKey { get; set; }

private string _securityKey;

public string SecurityKey
{
get => _securityKey;
set
{
byte[] byteArray = Encoding.UTF8.GetBytes(value);
var numBits = byteArray.Length * 8;
if (numBits <= 256)
throw new ArgumentException($"SecurityKey must be greater than 256 bits. The security key '{value}' is only '{numBits}' bits.");
_securityKey = value;
}
}
}

0 comments on commit 6122580

Please sign in to comment.