Files
HellreigN/backend/docs/swagger.yaml
T
d3m0k1d a2c71da3a0
ci-agent / build (push) Failing after 1m19s
chore: grpc + mtls working
2026-04-04 03:55:37 +03:00

521 lines
12 KiB
YAML

definitions:
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest:
properties:
login:
type: string
password:
type: string
required:
- login
- password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse:
properties:
last_name:
type: string
login:
type: string
name:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
token:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest:
properties:
label:
type: string
required:
- label
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate:
properties:
last_name:
type: string
login:
type: string
name:
type: string
password:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
required:
- last_name
- login
- name
- password
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens:
properties:
id:
type: integer
last_name:
type: string
login:
type: string
name:
type: string
permission_admin:
type: boolean
permission_manage_agent:
type: boolean
permission_view:
type: boolean
token:
type: string
type: object
gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry:
properties:
agent:
type: string
level:
type: string
message:
type: string
service:
type: string
timestamp:
type: string
type: object
internal_handlers.AgentInfo:
properties:
label:
type: string
services:
items:
type: string
type: array
token:
type: string
type: object
internal_handlers.InsertLogRequest:
properties:
agent:
type: string
level:
type: string
message:
type: string
service:
type: string
timestamp:
type: string
required:
- agent
- level
- message
- service
type: object
internal_handlers.InsertLogsRequest:
properties:
logs:
items:
$ref: '#/definitions/internal_handlers.InsertLogRequest'
type: array
required:
- logs
type: object
internal_handlers.RegisterRequest:
properties:
csr:
type: string
token:
type: string
required:
- csr
- token
type: object
internal_handlers.RegisterResponse:
properties:
ca_cert:
type: string
client_cert:
type: string
type: object
info:
contact: {}
paths:
/agents:
get:
description: Returns a list of all agents currently connected via gRPC streaming
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/internal_handlers.AgentInfo'
type: array
summary: Get connected agents
tags:
- agents
/agents/register:
post:
consumes:
- application/json
parameters:
- description: CSR + token
in: body
name: request
required: true
schema:
$ref: '#/definitions/internal_handlers.RegisterRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_handlers.RegisterResponse'
summary: Register agent
tags:
- agents
/agents/register-token:
post:
consumes:
- application/json
parameters:
- description: Label
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
security:
- Bearer: []
summary: Create registration token
tags:
- agents
/auth/login:
post:
consumes:
- application/json
description: Authenticate with login and password, returns a token and permissions
parameters:
- description: Login credentials
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Login
tags:
- auth
/auth/token:
delete:
description: Deletes the current authenticated user
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Delete my account
tags:
- auth
post:
consumes:
- application/json
description: Creates a new user with permissions
parameters:
- description: User data
in: body
name: request
required: true
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Create user
tags:
- auth
/auth/tokens:
get:
description: Returns list of all users with their permissions
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: List users
tags:
- auth
/auth/tokens/:login:
delete:
description: Deletes a user by their login
parameters:
- description: Login of the user to delete
in: path
name: login
required: true
type: string
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Delete user
tags:
- auth
/auth/validate:
get:
description: Check if the provided Bearer token is valid and return its permissions
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens'
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Validate token
tags:
- auth
/logs:
get:
description: Searches logs with various filters
parameters:
- description: Log level (INFO, WARNING, ERROR, FATAL)
in: query
name: level
type: string
- description: Service name
in: query
name: service
type: string
- description: Agent name
in: query
name: agent
type: string
- description: Date from (RFC3339)
in: query
name: date_from
type: string
- description: Date to (RFC3339)
in: query
name: date_to
type: string
- default: 100
description: Limit results
in: query
name: limit
type: integer
- default: 0
description: Offset results
in: query
name: offset
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry'
type: array
summary: Search logs
tags:
- logs
post:
consumes:
- application/json
description: Inserts a single log entry into ClickHouse
parameters:
- description: Log entry
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.InsertLogRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties:
type: string
type: object
summary: Insert log entry
tags:
- logs
/logs/agents:
get:
description: Returns list of all unique agent names in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
summary: Get distinct agents
tags:
- logs
/logs/batch:
post:
consumes:
- application/json
description: Inserts multiple log entries into ClickHouse
parameters:
- description: Log entries
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_handlers.InsertLogsRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties:
type: string
type: object
summary: Insert log entries (batch)
tags:
- logs
/logs/levels:
get:
description: Returns list of all unique log levels in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
summary: Get distinct log levels
tags:
- logs
/logs/services:
get:
description: Returns list of all unique service names in logs
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
summary: Get distinct services
tags:
- logs
securityDefinitions:
Bearer:
description: Type "Bearer" followed by a space and the JWT token.
in: header
name: Authorization
type: apiKey
swagger: "2.0"