-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
ca45548
commit ce156b0
Showing
12 changed files
with
48 additions
and
17 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,3 @@ | ||
.DS_Store | ||
.idea | ||
.env | ||
.cache/ | ||
data/ |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
jwt-token-*.hex |
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
2 changes: 1 addition & 1 deletion
2
...network/configs/ec-common/jwtsecret-1.hex → ...etwork/configs/ec-common/jwt-secret-1.hex
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 +1 @@ | ||
ed292c1b8df420f0fed62f9e83e3ca176b88e5723218b83d9e1b36df375e4ac4 | ||
ed292c1b8df420f0fed62f9e83e3ca176b88e5723218b83d9e1b36df375e4ac4 |
2 changes: 1 addition & 1 deletion
2
...network/configs/ec-common/jwtsecret-2.hex → ...etwork/configs/ec-common/jwt-secret-2.hex
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 +1 @@ | ||
a59c7150d727e228fceabfc4497c21d6acbdd083e0063dadcb20e2be661cefb2 | ||
a59c7150d727e228fceabfc4497c21d6acbdd083e0063dadcb20e2be661cefb2 |
2 changes: 1 addition & 1 deletion
2
...network/configs/ec-common/jwtsecret-3.hex → ...etwork/configs/ec-common/jwt-secret-3.hex
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 +1 @@ | ||
2703dcfc67b9a772756c4d354e2943fd7e3d8a2cb95b2129faa497b09662780d | ||
2703dcfc67b9a772756c4d354e2943fd7e3d8a2cb95b2129faa497b09662780d |
File renamed without changes.
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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <hex_secret>" | ||
exit 1 | ||
fi | ||
|
||
hexsecret=$(echo -n "$1" | tr -d '\n') | ||
|
||
# Construct the header | ||
jwt_header=$(echo -n '{"alg":"HS256","typ":"JWT"}' | base64 | sed s/\+/-/g | sed 's/\//_/g' | sed -E s/=+$//) | ||
|
||
# Get the current Unix timestamp (seconds since 1970-01-01) | ||
iat=$(date +%s) | ||
|
||
# Construct the payload with 'iat' claim | ||
payload=$(echo -n "{\"iat\":${iat}}" | base64 | sed s/\+/-/g | sed 's/\//_/g' | sed -E s/=+$//) | ||
|
||
# Calculate hmac signature -- note option to pass in the key as hex bytes | ||
hmac_signature=$(echo -n "${jwt_header}.${payload}" | openssl dgst -sha256 -mac HMAC -macopt hexkey:$hexsecret -binary | base64 | sed s/\+/-/g | sed 's/\//_/g' | sed -E s/=+$//) | ||
|
||
# Create the full token | ||
jwt="${jwt_header}.${payload}.${hmac_signature}" | ||
|
||
# Output the generated JWT token | ||
echo -n $jwt |
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 +1 @@ | ||
244bb704084d2a49b4fc2da3b27a1c1c76329d7cac6fbadfd8c1a615730d6f77 | ||
244bb704084d2a49b4fc2da3b27a1c1c76329d7cac6fbadfd8c1a615730d6f77 |
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 +1 @@ | ||
7c2d9d0bb13ac806701462ab2e1bbcc54eb7b5e8f6658610a6e06dcc30e0aa47 | ||
7c2d9d0bb13ac806701462ab2e1bbcc54eb7b5e8f6658610a6e06dcc30e0aa47 |
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 +1 @@ | ||
dc51ae50601364b0d9354bad516acd16261447f89bde416399fa4ae5f2cbe8ab | ||
dc51ae50601364b0d9354bad516acd16261447f89bde416399fa4ae5f2cbe8ab |