-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from OWASP/secret-auth
add custom auth type
- Loading branch information
Showing
4 changed files
with
46 additions
and
6 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,2 +1,3 @@ | ||
REDIS_HOST=localhost | ||
REDIS_PORT=6379 | ||
AUTH_SECRET_KEY=E8f_3pHCgScOxTvyYFa1LKeJWLa4KtPKLY.FyLzesj66nHxQ5h1qhCFMQJJ_9eUL56EL3._XbYrYY8c5.foTV_yYHKcySPzBwv8FxIA1p03RFEinbex4EYZ9YvhacAiW |
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,12 @@ | ||
import secrets | ||
import string | ||
|
||
|
||
def generate_random_secret_key_string(length=128): | ||
# Define the characters allowed in the HTTP header | ||
characters = string.ascii_letters + string.digits + "-_." | ||
|
||
# Generate a random string of the specified length | ||
random_string = ''.join(secrets.choice(characters) for _ in range(length)) | ||
|
||
return random_string |
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