Skip to content

Commit

Permalink
Test & config revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
na-stewart committed Jan 5, 2025
1 parent a15adf0 commit 30c8e49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 9 additions & 0 deletions sanic_security/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
DEFAULT_CONFIG = {
"SECRET": "This is a big secret. Shhhhh",
"PUBLIC_SECRET": None,
"OAUTH_CLIENT": None,
"OAUTH_SECRET": None,
"OAUTH_REDIRECT": None,
"SESSION_SAMESITE": "Strict",
"SESSION_SECURE": True,
"SESSION_HTTPONLY": True,
Expand Down Expand Up @@ -54,6 +57,9 @@ class Config(dict):
Attributes:
SECRET (str): The secret used by the hashing algorithm for generating and signing JWTs. This should be a string unique to your application. Keep it safe.
PUBLIC_SECRET (str): The secret used for verifying and decoding JWTs and can be publicly shared. This should be a string unique to your application.
OAUTH_CLIENT (str): The client ID provided by the OAuth provider, this is used to identify the application making the OAuth request.
OAUTH_SECRET (str): The client secret provided by the OAuth provider, this is used in conjunction with the client ID to authenticate the application.
OAUTH_REDIRECT (str): The redirect URI registered with the OAuth provider, This is the URI where the user will be redirected after a successful authentication.
SESSION_SAMESITE (str): The SameSite attribute of session cookies.
SESSION_SECURE (bool): The Secure attribute of session cookies.
SESSION_HTTPONLY (bool): The HttpOnly attribute of session cookies. HIGHLY recommended that you do not turn this off, unless you know what you are doing.
Expand All @@ -75,6 +81,9 @@ class Config(dict):

SECRET: str
PUBLIC_SECRET: str
OAUTH_CLIENT: str
OAUTH_SECRET: str
OAUTH_REDIRECT: str
SESSION_SAMESITE: str
SESSION_SECURE: bool
SESSION_HTTPONLY: bool
Expand Down
6 changes: 0 additions & 6 deletions sanic_security/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ def test_invalid_registration(self):
assert (
invalid_phone_registration_response.status_code == 400
), invalid_phone_registration_response.text
invalid_username_registration_response = self.register(
"[email protected]", "_inVal!d_", False, True
)
assert (
invalid_username_registration_response.status_code == 400
), invalid_username_registration_response.text
too_many_characters_registration_response = self.register(
"[email protected]",
"this_username_is_too_long_to_be_registered_with",
Expand Down

0 comments on commit 30c8e49

Please sign in to comment.