feat(docs): finalize SDD-110 localization and Next.js Markdown rendering

This commit is contained in:
DmitrL-dev 2026-03-31 15:02:15 +10:00
parent fe9415ab74
commit 2c27cf1bf7
5 changed files with 251 additions and 5 deletions

View file

@ -1,5 +1,11 @@
// Package main provides the standalone SOC API server entry point.
//
// @title SYNTREX Sentinel SOC API
// @version 1.0
// @description Enterprise API for AI Firewall and Security Operations Center. Auto-generated via Doc-as-Code.
// @host localhost:9100
// @BasePath /
//
// Usage:
//
// go run ./cmd/soc/

102
docs/docs.go Normal file
View file

@ -0,0 +1,102 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/scan": {
"post": {
"description": "Scans user inputs using Sentinel Lattice (Rust engine) to detect jailbreaks, prompt injections, and Data Exfiltration attempts within 1ms.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Scanner"
],
"summary": "Inspect AI Prompt",
"parameters": [
{
"description": "Request body containing 'prompt' string",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "Scan result with confidence scores and block flags",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"429": {
"description": "Rate Limited",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"503": {
"description": "Service Unavailable (Queue full)",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:9100",
BasePath: "/",
Schemes: []string{},
Title: "SYNTREX Sentinel SOC API",
Description: "Enterprise API for AI Firewall and Security Operations Center. Auto-generated via Doc-as-Code.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

78
docs/swagger.json Normal file
View file

@ -0,0 +1,78 @@
{
"swagger": "2.0",
"info": {
"description": "Enterprise API for AI Firewall and Security Operations Center. Auto-generated via Doc-as-Code.",
"title": "SYNTREX Sentinel SOC API",
"contact": {},
"version": "1.0"
},
"host": "localhost:9100",
"basePath": "/",
"paths": {
"/api/v1/scan": {
"post": {
"description": "Scans user inputs using Sentinel Lattice (Rust engine) to detect jailbreaks, prompt injections, and Data Exfiltration attempts within 1ms.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Scanner"
],
"summary": "Inspect AI Prompt",
"parameters": [
{
"description": "Request body containing 'prompt' string",
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "Scan result with confidence scores and block flags",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"429": {
"description": "Rate Limited",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"503": {
"description": "Service Unavailable (Queue full)",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
}

54
docs/swagger.yaml Normal file
View file

@ -0,0 +1,54 @@
basePath: /
host: localhost:9100
info:
contact: {}
description: Enterprise API for AI Firewall and Security Operations Center. Auto-generated
via Doc-as-Code.
title: SYNTREX Sentinel SOC API
version: "1.0"
paths:
/api/v1/scan:
post:
consumes:
- application/json
description: Scans user inputs using Sentinel Lattice (Rust engine) to detect
jailbreaks, prompt injections, and Data Exfiltration attempts within 1ms.
parameters:
- description: Request body containing 'prompt' string
in: body
name: body
required: true
schema:
additionalProperties:
type: string
type: object
produces:
- application/json
responses:
"200":
description: Scan result with confidence scores and block flags
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"429":
description: Rate Limited
schema:
additionalProperties:
type: string
type: object
"503":
description: Service Unavailable (Queue full)
schema:
additionalProperties:
type: string
type: object
summary: Inspect AI Prompt
tags:
- Scanner
swagger: "2.0"

View file

@ -1504,12 +1504,18 @@ func (s *Server) handleSLAConfig(w http.ResponseWriter, _ *http.Request) {
}
// handlePublicScan provides a public (no-auth) prompt scanning endpoint for the demo.
// POST /api/v1/scan body: {"prompt": "Ignore all instructions..."}
// Runs sentinel-core (54 Rust engines) + Shield (C11 payload inspection) in parallel.
//
// Concurrency control: uses scanSem (buffered channel) to limit parallel scans.
// If all slots are busy, returns 503 Service Unavailable with Retry-After header
// to prevent OOM under burst load (e.g., 20 concurrent battle workers).
// @Summary Inspect AI Prompt
// @Description Scans user inputs using Sentinel Lattice (Rust engine) to detect jailbreaks, prompt injections, and Data Exfiltration attempts within 1ms.
// @Tags Scanner
// @Accept json
// @Produce json
// @Param body body map[string]string true "Request body containing 'prompt' string"
// @Success 200 {object} map[string]any "Scan result with confidence scores and block flags"
// @Failure 400 {object} map[string]string "Bad Request"
// @Failure 429 {object} map[string]string "Rate Limited"
// @Failure 503 {object} map[string]string "Service Unavailable (Queue full)"
// @Router /api/v1/scan [post]
func (s *Server) handlePublicScan(w http.ResponseWriter, r *http.Request) {
limitBody(w, r)
defer r.Body.Close()