simplefancontroller.api package

Subpackages

Submodules

simplefancontroller.api.app module

simplefancontroller.api.app.generate_api()

simplefancontroller.api.jwt_bearer module

class simplefancontroller.api.jwt_bearer.JWTBearer(auto_error: bool = True)

Bases: HTTPBearer

static decode_jwt(token: str) dict
model: SecurityBase
scheme_name: str
static sign_jwt(user_id: str) dict[str, str]
verify_jwt(jwtoken: str) tuple[dict, bool]
simplefancontroller.api.jwt_bearer.token_response(token: str)

simplefancontroller.api.schemas module

class simplefancontroller.api.schemas.User(*, id: str = None, enabled: bool = True, name: str, email: EmailStr, password: str)

Bases: BaseModel

Model for SFC Users.

class Config

Bases: object

schema_extra = {'example': {'email': 'jane.doe@testmail.com', 'name': 'Jane Doe', 'password': 'somepassword'}}
email: EmailStr
enabled: bool
id: str
name: str
password: str
class simplefancontroller.api.schemas.UserAbstractUpdateSchema(*, password: str)

Bases: BaseModel

Abstract model for updating a User.

password: str
class simplefancontroller.api.schemas.UserLoginSchema(*, email: EmailStr, password: str)

Bases: BaseModel

Model for User login

class Config

Bases: object

schema_extra = {'example': {'email': 'jane.doe@testmail.com', 'password': 'somepassword'}}
email: EmailStr
password: str
class simplefancontroller.api.schemas.UserPassUpdateSchema(*, password: str, new_password: str)

Bases: UserAbstractUpdateSchema

new_password: str
class simplefancontroller.api.schemas.UserUpdateSchema(*, password: str, new_email: str)

Bases: UserAbstractUpdateSchema

new_email: str

simplefancontroller.api.user_manager module

class simplefancontroller.api.user_manager.SFCUserManager

Bases: object

add_user(user: User)
check_user_password(email: str, password: str) bool
delete_user(email: str)
get_user_by_mail(email: str)
get_users()
shutdown()
update_user(prev_mail: str, user: User)
simplefancontroller.api.user_manager.check_password(pwd: str, pwd_hash: str) bool
simplefancontroller.api.user_manager.hash_password(pwd: str) str

Module contents