Skip to content

Commit

Permalink
Fixed broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TTA777 committed Jan 25, 2024
1 parent cdb2cba commit 11099b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public async Task VerifyRegistrationReturnsTrueGivenValidToken()
};
var identitySettings = new IdentitySettings
{
TokenKey = "This is a long test token key"
TokenKey = "SuperLongSigningKeySuperLongSigningKey"
};
var tokenService = new TokenService(identitySettings, new ClaimsUtilities(context));

Expand Down Expand Up @@ -697,7 +697,7 @@ private static string WriteTokenString(IEnumerable<Claim> claims)
{
var tokenHandler = new JwtSecurityTokenHandler();
var key = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes("This is a long test token key"));
Encoding.UTF8.GetBytes("SuperLongSigningKeySuperLongSigningKey"));

var jwt = new JwtSecurityToken("AnalogIO",
"Everyone",
Expand Down
6 changes: 3 additions & 3 deletions coffeecard/CoffeeCard.Tests.Unit/Services/TokenServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public TokenServiceTest()
_identity = new IdentitySettings();

//creates the key for signing the token
const string keyForHmacSha256 = "signingKey";
const string keyForHmacSha256 = "SuperLongSigningKey";
_identity.TokenKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(keyForHmacSha256)).ToString();
}

Expand Down Expand Up @@ -99,7 +99,7 @@ public async Task ValidateTokenGivenInvalidSignedTokenReturnsFalse()
await using (context)
{
var key = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes("Invalid signing key"));
Encoding.UTF8.GetBytes("Super long invalid signing key, longer than 256bytes"));

var jwt = new JwtSecurityToken("AnalogIO",
"Everyone",
Expand Down Expand Up @@ -213,4 +213,4 @@ private CoffeeCardContext GenerateCoffeeCardContext(string uniqueString)
return new CoffeeCardContext(builder.Options, databaseSettings, environmentSettings);
}
}
}
}
4 changes: 2 additions & 2 deletions coffeecard/CoffeeCard.WebApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"SchemaName": "dbo"
},
"IdentitySettings": {
"TokenKey": "local-development-token",
"TokenKey": "super-long-local-development-token",
"AdminToken": "local-development-admintoken",
"ApiKey": "local-development-apikey"
},
Expand Down Expand Up @@ -43,7 +43,7 @@
"Default": "Information",
"Override": {
"System": "Information",
"Microsoft": "Warning"
"Microsoft": "Information"
}
},
"WriteTo": [
Expand Down

0 comments on commit 11099b2

Please sign in to comment.