Work on websockets end points and management

This commit is contained in:
Scott Idem
2023-03-30 19:27:39 -04:00
parent 224aaed969
commit cff165d9d9
5 changed files with 160 additions and 77 deletions

View File

@@ -123,6 +123,9 @@ class Common_Route_Params:
@logger_reset # This breaks things for some reason when the function is async. Do not use async def common_route_params()!
def common_route_params(
x_account_id: str = Header(..., min_length=11, max_length=22),
# x_aether_api_key: Optional[str] = Header(..., min_length=11, max_length=22),
# x_aether_api_token: Optional[str] = Header(..., min_length=11, max_length=22),
# x_aether_jwt_token: Optional[str] = Header(..., min_length=11, max_length=50),
enabled: str = 'enabled', # all, enabled, disabled
limit: int = 100,
offset: int = 0,
@@ -246,12 +249,14 @@ def verify_secure_hash_string(string: str, string_hash: str):
@logger_reset
def sign_jwt(
secret_key: str, # Secret/Private/Password
public_key: str, # Will be part of the token. Use to look up secret when verifying.
ttl: int = 60, # Default to 60 seconds
max_renew: int = 0, # Default to 0
public_key: str = None, # Will be part of the token. Use to look up secret when verifying.???
account_id: str = None,
person_id: str = None,
user_id: str = None,
json_str: str = None,
b64_str: str = None,
) -> Dict[str, str]:
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -264,6 +269,8 @@ def sign_jwt(
'account_id': account_id,
'person_id': person_id,
'user_id': user_id,
'json_str': json_str,
'b64_str': b64_str,
}
secret = secret_key
algorithm = 'HS256'