ogdc_runner.service.user module¶
Module containing code for managing OGDC users.
- class ogdc_runner.service.user.User(*, id=None, name, password_hash)¶
Bases:
SQLModelModel representing the users table in the OGDC database.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'read_from_attributes': True, 'read_with_orm_mode': True, 'registry': PydanticUndefined, 'table': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- ogdc_runner.service.user.create_admin_user() None¶
Create the admin user if it does not already exist.
Requires that the OGDC_ADMIN_PASSWORD envvar be set.
- Return type:
- ogdc_runner.service.user.create_user(*, session: Session, username: str, password: str) User¶
Create a user with the given username and password.
Raises OgdcUserAlreadyExists if the given username is already in use.
- ogdc_runner.service.user.get_user_with_password(*, session: Session, name: str, password: str) None | User¶
Get the user record by name and password.
Returns None if no matching user is found.