-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved the RSA keys into a keys folder. Updated the key generator to a…
…dd them to the keys folder. Updated .gitignore to ignore the keys folder and the .vscode folder too. Tidied up the go.mod file. Updated the types file to make all environment variable keys as variables. Updated the types to also start creating the UserDocument type for use with JWTs Updated main to use the new env variable. Made new function to read the RSA public/private keys and set the string representations as environment variables. Made new function to get RSA key representations for use with JWTs. Added new web route for the public RSA key (for verification) Updated the login post route to return a JWT Removed the time & remoteAddress uniqueness values from the index for authNonces collection. Added new removeUsedNonce function to remove nonces after use. Used removeUsedNonce function immediately after checking the nonce after attempting to login Implemented JWT generation in GetUserByUsername
- Loading branch information
Mathew Thompson
authored and
Mathew Thompson
committed
Jul 3, 2021
1 parent
b2c1456
commit 1456cb0
Showing
7 changed files
with
168 additions
and
66 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
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,6 @@ | ||
echo "Don't Add a passphrase" | ||
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | ||
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | ||
cat jwtRS256.key | ||
cat jwtRS256.key.pub | ||
mkdir keys | ||
ssh-keygen -t rsa -b 4096 -m PEM -f ./keys/jwtRS256.key | ||
openssl rsa -in ./keys/jwtRS256.key -pubout -outform PEM -out ./keys/jwtRS256.key.pub | ||
cat ./keys/jwtRS256.key | ||
cat ./keys/jwtRS256.key.pub |
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
Oops, something went wrong.