parent
71f26a4c9b
commit
d852bda091
9 changed files with 24 additions and 47 deletions
|
|
@ -1,7 +1,3 @@
|
|||
"""
|
||||
Configurations for <this module>
|
||||
|
||||
Configurations:
|
||||
- List: Description
|
||||
- Configs: Description
|
||||
Configurations for the services module
|
||||
"""
|
||||
|
|
@ -1,7 +1,3 @@
|
|||
"""
|
||||
Constants and error codes for <this module>
|
||||
|
||||
Constants:
|
||||
- List: Description
|
||||
- Consts: Description
|
||||
Constants for the services module
|
||||
"""
|
||||
|
|
@ -1,13 +1,9 @@
|
|||
"""
|
||||
Router dependencies for <this module>
|
||||
Dependencies related to the services module
|
||||
|
||||
Classes:
|
||||
- List: Description
|
||||
- Classes: Description
|
||||
|
||||
Functions:
|
||||
- List: Description
|
||||
- Functions: Description
|
||||
Exports:
|
||||
- service_model_query_dependency: service_model: Gets service model from db, if it exists. Uses service_id from query param.
|
||||
- service_model_body_dependency: service_model: Gets service model from db, if it exists. Uses service_id from request body.
|
||||
"""
|
||||
from typing import Annotated
|
||||
from fastapi import Depends, Query
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
"""
|
||||
Module specific exceptions for <this module>
|
||||
Exceptions related to the services module
|
||||
|
||||
Exceptions:
|
||||
- List: Description
|
||||
- Exceptions: Description
|
||||
- ServiceNotFoundException: Takes an optional service_id int
|
||||
"""
|
||||
from typing import Optional
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
Database models for the services module
|
||||
|
||||
Models:
|
||||
- List: Description
|
||||
- Models: Description
|
||||
- Service:
|
||||
- id[PK], name[U], api_key[U]
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
"""
|
||||
Router endpoints for <this module>
|
||||
Router endpoints for the services module
|
||||
|
||||
Endpoints:
|
||||
- List: Description
|
||||
- Endpoints: Description
|
||||
- [GET](/): [root user]: Get a list of all services(id, name)
|
||||
- [POST](/): [super admin]: Register a new service(name) on the hub, returns the API key for the service to access the hub.
|
||||
- [PATCH](/key): [super_admin]: Refreshes the API key for a service(id), returning a new one.
|
||||
- [DELETE](/): [super_admin]: Removes a service(id) from the hub.
|
||||
"""
|
||||
from fastapi import APIRouter, status
|
||||
from psycopg.errors import UniqueViolation
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
"""
|
||||
Pydantic models for the service module
|
||||
Pydantic models for service module
|
||||
|
||||
Models:
|
||||
- List: Description
|
||||
- Models: Description
|
||||
Models follow the nomenclature of:
|
||||
- Sub-models: "<Resource><Opt:>Schema"
|
||||
- Mixins: "<Attribute>Mixin"
|
||||
- Models: "<Module><Method><Resource><Opt:Resource><Direction>" ie "ServiceGetServiceResponse"
|
||||
"""
|
||||
from pydantic import ConfigDict
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
"""
|
||||
Module specific business logic for <this module>
|
||||
|
||||
Classes:
|
||||
- List: Description
|
||||
- Classes: Description
|
||||
|
||||
Functions:
|
||||
- List: Description
|
||||
- Functions: Description
|
||||
Business logic for the services module
|
||||
"""
|
||||
|
|
@ -1,13 +1,8 @@
|
|||
"""
|
||||
Non-business logic reusable functions and classes for <this module>
|
||||
Non-business logic reusable functions and classes for the services module
|
||||
|
||||
Classes:
|
||||
- List: Description
|
||||
- Classes: Description
|
||||
|
||||
Functions:
|
||||
- List: Description
|
||||
- Functions: Description
|
||||
Exports:
|
||||
- generate_api_key(): returns a new UUID
|
||||
"""
|
||||
import uuid
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue