added some govno to postgres

This commit is contained in:
Mephimeow
2026-06-13 18:31:22 +00:00
committed by zero@thinky
parent 56ab583223
commit 57ce3dea5f
20 changed files with 2174 additions and 163 deletions
+323 -34
View File
@@ -1,5 +1,5 @@
definitions:
internal_auth.AuthResponse:
auth.AuthResponse:
properties:
refresh_token:
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
@@ -8,15 +8,15 @@ definitions:
example: eyJhbGciOiJIUzI1NiIs...
type: string
user:
$ref: '#/definitions/internal_auth.UserPublic'
$ref: '#/definitions/auth.UserPublic'
type: object
internal_auth.ErrorResponse:
auth.ErrorResponse:
properties:
error:
example: invalid email or password
type: string
type: object
internal_auth.LoginRequest:
auth.LoginRequest:
properties:
email:
example: john@example.com
@@ -28,7 +28,7 @@ definitions:
- email
- password
type: object
internal_auth.LogoutRequest:
auth.LogoutRequest:
properties:
refresh_token:
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
@@ -36,7 +36,20 @@ definitions:
required:
- refresh_token
type: object
internal_auth.RefreshRequest:
auth.PasswordChangeRequest:
properties:
new_password:
example: NewSecret456!
minLength: 8
type: string
old_password:
example: Secret123!
type: string
required:
- new_password
- old_password
type: object
auth.RefreshRequest:
properties:
refresh_token:
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
@@ -44,14 +57,14 @@ definitions:
required:
- refresh_token
type: object
internal_auth.RegisterRequest:
auth.RegisterRequest:
properties:
email:
example: john@example.com
type: string
password:
example: secret123
minLength: 6
example: Secret123!
minLength: 8
type: string
username:
example: john
@@ -63,7 +76,17 @@ definitions:
- password
- username
type: object
internal_auth.UserPublic:
auth.UpdateProfileRequest:
properties:
username:
example: john_updated
maxLength: 30
minLength: 3
type: string
required:
- username
type: object
auth.UserPublic:
properties:
created_at:
type: string
@@ -74,10 +97,68 @@ definitions:
username:
type: string
type: object
internal_auth.UserResponse:
auth.UserResponse:
properties:
user:
$ref: '#/definitions/internal_auth.UserPublic'
$ref: '#/definitions/auth.UserPublic'
type: object
org.CreateOrgRequest:
properties:
name:
example: My Corp
maxLength: 100
minLength: 2
type: string
slug:
example: my-corp
maxLength: 50
minLength: 2
type: string
required:
- name
- slug
type: object
org.ErrorResponse:
properties:
error:
type: string
type: object
org.OrgListResponse:
properties:
organizations:
items:
$ref: '#/definitions/org.Organization'
type: array
total:
type: integer
type: object
org.OrgResponse:
properties:
organization:
$ref: '#/definitions/org.Organization'
type: object
org.Organization:
properties:
created_at:
type: string
id:
type: string
name:
type: string
slug:
type: string
updated_at:
type: string
type: object
org.UpdateOrgRequest:
properties:
name:
example: My Corp Updated
maxLength: 100
minLength: 2
type: string
required:
- name
type: object
info:
contact: {}
@@ -96,23 +177,23 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/internal_auth.LoginRequest'
$ref: '#/definitions/auth.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_auth.AuthResponse'
$ref: '#/definitions/auth.AuthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
$ref: '#/definitions/auth.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
summary: Epta login
$ref: '#/definitions/auth.ErrorResponse'
summary: Login
tags:
- auth
/api/auth/logout:
@@ -126,7 +207,7 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/internal_auth.LogoutRequest'
$ref: '#/definitions/auth.LogoutRequest'
produces:
- application/json
responses:
@@ -139,12 +220,12 @@ paths:
"400":
description: Bad Request
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
$ref: '#/definitions/auth.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
summary: Logout epta
$ref: '#/definitions/auth.ErrorResponse'
summary: Logout
tags:
- auth
/api/auth/me:
@@ -158,14 +239,79 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/internal_auth.UserResponse'
$ref: '#/definitions/auth.UserResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
$ref: '#/definitions/auth.ErrorResponse'
security:
- Bearer: []
summary: Epta get current user
summary: Get current user
tags:
- auth
put:
consumes:
- application/json
description: Update current user's username
parameters:
- description: Profile update
in: body
name: request
required: true
schema:
$ref: '#/definitions/auth.UpdateProfileRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/auth.UserResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/auth.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/auth.ErrorResponse'
security:
- Bearer: []
summary: Update profile
tags:
- auth
/api/auth/password:
put:
consumes:
- application/json
description: Change current user's password
parameters:
- description: Password change details
in: body
name: request
required: true
schema:
$ref: '#/definitions/auth.PasswordChangeRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/auth.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/auth.ErrorResponse'
security:
- Bearer: []
summary: Change password
tags:
- auth
/api/auth/refresh:
@@ -179,23 +325,23 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/internal_auth.RefreshRequest'
$ref: '#/definitions/auth.RefreshRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_auth.AuthResponse'
$ref: '#/definitions/auth.AuthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
$ref: '#/definitions/auth.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
summary: Refresh epta token
$ref: '#/definitions/auth.ErrorResponse'
summary: Refresh token
tags:
- auth
/api/auth/register:
@@ -209,25 +355,168 @@ paths:
name: request
required: true
schema:
$ref: '#/definitions/internal_auth.RegisterRequest'
$ref: '#/definitions/auth.RegisterRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/internal_auth.UserResponse'
$ref: '#/definitions/auth.AuthResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
$ref: '#/definitions/auth.ErrorResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/internal_auth.ErrorResponse'
summary: Epta registration
$ref: '#/definitions/auth.ErrorResponse'
summary: Register
tags:
- auth
/api/organizations:
get:
consumes:
- application/json
description: Get all organizations
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/org.OrgListResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/org.ErrorResponse'
security:
- Bearer: []
summary: List organizations
tags:
- organizations
post:
consumes:
- application/json
description: Create a new organization
parameters:
- description: Organization details
in: body
name: request
required: true
schema:
$ref: '#/definitions/org.CreateOrgRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/org.OrgResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/org.ErrorResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/org.ErrorResponse'
security:
- Bearer: []
summary: Create organization
tags:
- organizations
/api/organizations/{id}:
delete:
consumes:
- application/json
description: Delete an organization
parameters:
- description: Organization ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
$ref: '#/definitions/org.ErrorResponse'
security:
- Bearer: []
summary: Delete organization
tags:
- organizations
get:
consumes:
- application/json
description: Get organization details
parameters:
- description: Organization ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/org.OrgResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/org.ErrorResponse'
security:
- Bearer: []
summary: Get organization by ID
tags:
- organizations
put:
consumes:
- application/json
description: Update organization name
parameters:
- description: Organization ID
in: path
name: id
required: true
type: string
- description: New organization details
in: body
name: request
required: true
schema:
$ref: '#/definitions/org.UpdateOrgRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/org.OrgResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/org.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/org.ErrorResponse'
security:
- Bearer: []
summary: Update organization
tags:
- organizations
schemes:
- http
securityDefinitions: