Authentication Module¶
Authentication Functions¶
auth
¶
This module provides authentication utilities for GenAIPot, including password hashing and credential checking.
check_credentials(username, password)
¶
Check if the provided credentials match the stored credentials.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username
|
str
|
The username to check. |
required |
password
|
str
|
The password to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the credentials match, False otherwise. |
Source code in src/auth.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
hash_password(password)
¶
Hash the provided password using SHA-256.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
password
|
str
|
The password to hash. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The hashed password. |
Source code in src/auth.py
35 36 37 38 39 40 41 42 43 44 45 |
|