added some govno to postgres
This commit is contained in:
+480
-34
@@ -22,7 +22,7 @@
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Epta login",
|
||||
"summary": "Login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
@@ -30,7 +30,7 @@
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.LoginRequest"
|
||||
"$ref": "#/definitions/auth.LoginRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -38,19 +38,19 @@
|
||||
"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"
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Logout epta",
|
||||
"summary": "Logout",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Refresh token to invalidate",
|
||||
@@ -76,7 +76,7 @@
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.LogoutRequest"
|
||||
"$ref": "#/definitions/auth.LogoutRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -93,13 +93,13 @@
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,18 +122,121 @@
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Epta get current user",
|
||||
"summary": "Get current user",
|
||||
"responses": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Update current user's username",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Update profile",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Profile update",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.UpdateProfileRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/password": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Change current user's password",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Change password",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Password change details",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.PasswordChangeRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,7 +254,7 @@
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Refresh epta token",
|
||||
"summary": "Refresh token",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Refresh token",
|
||||
@@ -159,7 +262,7 @@
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.RefreshRequest"
|
||||
"$ref": "#/definitions/auth.RefreshRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -167,19 +270,19 @@
|
||||
"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"
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +300,7 @@
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Epta registration",
|
||||
"summary": "Register",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Registration details",
|
||||
@@ -205,7 +308,7 @@
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.RegisterRequest"
|
||||
"$ref": "#/definitions/auth.RegisterRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -213,19 +316,245 @@
|
||||
"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"
|
||||
"$ref": "#/definitions/auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/organizations": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Get all organizations",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organizations"
|
||||
],
|
||||
"summary": "List organizations",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.OrgListResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Create a new organization",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organizations"
|
||||
],
|
||||
"summary": "Create organization",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Organization details",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.CreateOrgRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/organizations/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Get organization details",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organizations"
|
||||
],
|
||||
"summary": "Get organization by ID",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Organization ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.OrgResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Update organization name",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organizations"
|
||||
],
|
||||
"summary": "Update organization",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Organization ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "New organization details",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.UpdateOrgRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Delete an organization",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organizations"
|
||||
],
|
||||
"summary": "Delete organization",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Organization ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/org.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,7 +562,7 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"internal_auth.AuthResponse": {
|
||||
"auth.AuthResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"refresh_token": {
|
||||
@@ -245,11 +574,11 @@
|
||||
"example": "eyJhbGciOiJIUzI1NiIs..."
|
||||
},
|
||||
"user": {
|
||||
"$ref": "#/definitions/internal_auth.UserPublic"
|
||||
"$ref": "#/definitions/auth.UserPublic"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.ErrorResponse": {
|
||||
"auth.ErrorResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
@@ -258,7 +587,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.LoginRequest": {
|
||||
"auth.LoginRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email",
|
||||
@@ -275,7 +604,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.LogoutRequest": {
|
||||
"auth.LogoutRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"refresh_token"
|
||||
@@ -287,7 +616,25 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.RefreshRequest": {
|
||||
"auth.PasswordChangeRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"new_password",
|
||||
"old_password"
|
||||
],
|
||||
"properties": {
|
||||
"new_password": {
|
||||
"type": "string",
|
||||
"minLength": 8,
|
||||
"example": "NewSecret456!"
|
||||
},
|
||||
"old_password": {
|
||||
"type": "string",
|
||||
"example": "Secret123!"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth.RefreshRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"refresh_token"
|
||||
@@ -299,7 +646,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.RegisterRequest": {
|
||||
"auth.RegisterRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"email",
|
||||
@@ -313,8 +660,8 @@
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"minLength": 6,
|
||||
"example": "secret123"
|
||||
"minLength": 8,
|
||||
"example": "Secret123!"
|
||||
},
|
||||
"username": {
|
||||
"type": "string",
|
||||
@@ -324,7 +671,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.UserPublic": {
|
||||
"auth.UpdateProfileRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string",
|
||||
"maxLength": 30,
|
||||
"minLength": 3,
|
||||
"example": "john_updated"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth.UserPublic": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
@@ -341,11 +702,96 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.UserResponse": {
|
||||
"auth.UserResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"$ref": "#/definitions/internal_auth.UserPublic"
|
||||
"$ref": "#/definitions/auth.UserPublic"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.CreateOrgRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"slug"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 100,
|
||||
"minLength": 2,
|
||||
"example": "My Corp"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"maxLength": 50,
|
||||
"minLength": 2,
|
||||
"example": "my-corp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.ErrorResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.OrgListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"organizations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/org.Organization"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.OrgResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"organization": {
|
||||
"$ref": "#/definitions/org.Organization"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.Organization": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.UpdateOrgRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 100,
|
||||
"minLength": 2,
|
||||
"example": "My Corp Updated"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user