Skip to content

Commit

Permalink
Added logs for testing
Browse files Browse the repository at this point in the history
Signed-off-by: HimajaDhanyamraju2 <dhanyamraju.himaja2@mindtree.com>
  • Loading branch information
HimajaDhanyamraju2 committed Feb 7, 2024
1 parent d4658f4 commit d3f08d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hub/hub_service.bal
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ service object {
} else {
log:printError("Error in decoding the encryption key", decodedEncryptionKey);
}
byte[32] randomEncKey = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
foreach int i in 0...31 {
randomEncKey[i] = <byte>(check random:createIntInRange(0, 255));
}
string randomEncKeyString = randomEncKey.toBase64();
log:printInfo("Base64 encoded random encryption key for testing", base64EncodedKey = randomEncKeyString);
byte[]|error decodedEncryptionKey2 = array:fromBase64(randomEncKeyString);
if (decodedEncryptionKey2 is byte[]) {
log:printInfo("Length of decoded encryption key", keyLength = decodedEncryptionKey2.length());
} else {
log:printError("Error in decoding the encryption key", decodedEncryptionKey2);
}
return websubhub:SUBSCRIPTION_ACCEPTED;
}

Expand Down

0 comments on commit d3f08d8

Please sign in to comment.