openapi: 3.2.0 info: title: Sheffield Solar API Auth API version: 0.1.0 tags: - name: API Auth paths: /auth/jwt/login: post: tags: - API Auth summary: Auth:Jwt.Login operationId: auth_jwt_login_auth_jwt_login_post requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Body_auth_jwt_login_auth_jwt_login_post' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BearerResponse' example: access_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOTIyMWZmYzktNjQwZi00MzcyLTg2ZDMtY2U2NDJjYmE1NjAzIiwiYXVkIjoiZmFzdGFwaS11c2VyczphdXRoIiwiZXhwIjoxNTcxNTA0MTkzfQ.M10bjOe45I5Ncu_uXvOmVV8QxnL-nZfcH96U90JaocI token_type: bearer '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorModel' examples: LOGIN_BAD_CREDENTIALS: summary: Bad credentials or the user is inactive. value: detail: LOGIN_BAD_CREDENTIALS LOGIN_USER_NOT_VERIFIED: summary: The user is not verified. value: detail: LOGIN_USER_NOT_VERIFIED '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /auth/jwt/logout: post: tags: - API Auth summary: Auth:Jwt.Logout operationId: auth_jwt_logout_auth_jwt_logout_post responses: '200': description: Successful Response content: application/json: schema: {} '401': description: Missing token or inactive user. security: - OAuth2PasswordBearer: [] - APIKeyCookie: [] /auth/jwt/register: post: tags: - API Auth summary: Register:Register operationId: register_register_auth_jwt_register_post requestBody: content: application/json: schema: $ref: '#/components/schemas/UserCreate' required: true responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UserRead' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorModel' examples: REGISTER_USER_ALREADY_EXISTS: summary: A user with this email already exists. value: detail: REGISTER_USER_ALREADY_EXISTS REGISTER_INVALID_PASSWORD: summary: Password validation failed. value: detail: code: REGISTER_INVALID_PASSWORD reason: Password should beat least 3 characters '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: BearerResponse: properties: access_token: type: string title: Access Token token_type: type: string title: Token Type type: object required: - access_token - token_type title: BearerResponse ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError UserRead: properties: id: type: integer title: Id email: type: string format: email title: Email is_active: type: boolean title: Is Active default: true is_superuser: type: boolean title: Is Superuser default: false is_verified: type: boolean title: Is Verified default: false first_name: anyOf: - type: string - type: 'null' title: First Name last_name: anyOf: - type: string - type: 'null' title: Last Name phone: anyOf: - type: string - type: 'null' title: Phone company: anyOf: - type: string - type: 'null' title: Company tandc: anyOf: - type: boolean - type: 'null' title: Tandc type: object required: - id - email title: UserRead description: Schema returned for user reads. Extends the base with SSF extras. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ErrorModel: properties: detail: anyOf: - type: string - additionalProperties: type: string type: object title: Detail type: object required: - detail title: ErrorModel UserCreate: properties: email: type: string format: email title: Email password: type: string title: Password is_active: anyOf: - type: boolean - type: 'null' title: Is Active default: true is_superuser: anyOf: - type: boolean - type: 'null' title: Is Superuser default: false is_verified: anyOf: - type: boolean - type: 'null' title: Is Verified default: false first_name: type: string maxLength: 100 minLength: 1 title: First Name last_name: type: string maxLength: 100 minLength: 1 title: Last Name phone: anyOf: - type: string pattern: ^\+?[\d\s\-()\[\]]{7,20}$ - type: 'null' title: Phone company: anyOf: - type: string - type: 'null' title: Company tandc: type: boolean title: Tandc default: false type: object required: - email - password - first_name - last_name title: UserCreate description: Schema for new user registration. Body_auth_jwt_login_auth_jwt_login_post: properties: grant_type: anyOf: - type: string pattern: ^password$ - type: 'null' title: Grant Type username: type: string title: Username password: type: string format: password title: Password scope: type: string title: Scope default: '' client_id: anyOf: - type: string - type: 'null' title: Client Id client_secret: anyOf: - type: string - type: 'null' format: password title: Client Secret type: object required: - username - password title: Body_auth_jwt_login_auth_jwt_login_post securitySchemes: OAuth2PasswordBearer: type: oauth2 flows: password: scopes: {} tokenUrl: /auth/jwt/login APIKeyCookie: type: apiKey in: cookie name: ssapi_session HTTPBasic: type: http scheme: basic