mCaptcha/mcaptcha/docs/constant.OPEN_API_SPEC.html

1 line
24 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `OPEN_API_SPEC` constant in crate `mcaptcha`."><title>OPEN_API_SPEC in mcaptcha::docs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0 (1159e78c4 2025-09-14)" data-channel="1.90.0" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mcaptcha/index.html">mcaptcha</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In mcaptcha::<wbr>docs</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">mcaptcha</a>::<wbr><a href="index.html">docs</a></div><h1>Constant <span class="constant">OPEN_API_SPEC</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/mcaptcha/docs.rs.html#68">Source</a> </span></div><pre class="rust item-decl"><code>const OPEN_API_SPEC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.90.0/std/primitive.str.html">str</a> = &quot;openapi: 3.0.0\ninfo:\n version: 0.1.0\n title: mCaptcha/guard\nservers:\n - url: /\npaths:\n /api/v1/signup:\n post:\n summary: Registration endpoint\n operationId: registerUser\n tags:\n - user\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/RegisterUser\&#39;\n example:\n username: testuser\n password: mysuperlongandsecurepassword\n email: testuser@example.com\n responses:\n \&#39;200\&#39;:\n description: Successful registration\n \&#39;400\&#39;:\n description: \&#39;Bad request: username contains profainity/blacklisted words or email not acceptable or password too long/short or duplicate username/password\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/signin:\n post:\n summary: Login endpoint\n operationId: loginUser\n tags:\n - user\n - authentication\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/LoginUser\&#39;\n example:\n username: testuser\n password: mysuperlongandsecurepassword\n responses:\n \&#39;200\&#39;:\n description: Successful authentication\n \&#39;401\&#39;:\n description: authentication failed, wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;404\&#39;:\n description: username not found\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/signout:\n post:\n security:\n - cookieAuth: []\n summary: Signout endpoint\n operationId: signoutUser\n tags:\n - user\n - authentication\n responses:\n \&#39;200\&#39;:\n description: OK\n /api/v1/account/delete:\n post:\n security:\n - cookieAuth: []\n summary: Delete account\n operationId: deleteAccount\n tags:\n - user\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/DeleteUser\&#39;\n example:\n password: mysuperlongandsecurepassword\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;401\&#39;:\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;404\&#39;:\n description: username not found\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/account/username/exists:\n post:\n summary: Check if username exists\n operationId: usernameExists\n tags:\n - user\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/UserDetailCheck\&#39;\n example:\n val: testuser\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/UserDetailCheckRes\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/account/email/exists:\n post:\n summary: Check if email exists\n operationId: emailExists\n tags:\n - user\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/UserDetailCheck\&#39;\n example:\n val: testuser@example.com\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/UserDetailCheckRes\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/meta/health:\n get:\n summary: Health check\n operationId: healthCheck\n tags:\n - meta\n - health\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Health\&#39;\n /api/v1/meta/build:\n get:\n summary: Get server binary build details\n operationId: buildDetails\n tags:\n - meta\n - build\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/BuildDetails\&#39;\n /api/v1/mcaptcha/domain/token/add:\n post:\n security:\n - cookieAuth: []\n summary: Add token for registered domain\n operationId: addToken\n tags:\n - mcaptcha\n - domain\n - token\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaID\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n \&#39;400\&#39;:\n description: \&#39;Bad request: Submited URI is not a URI or duplicate token name\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/update:\n post:\n security:\n - cookieAuth: []\n summary: Update token key\n operationId: updateTokenKey\n tags:\n - mcaptcha\n - domain\n - token\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaID\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n \&#39;400\&#39;:\n description: \&#39;Bad request: Submited URI is not a URI or duplicate token name\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/get:\n post:\n security:\n - cookieAuth: []\n summary: Get token key\n operationId: getTokenKey\n tags:\n - mcaptcha\n - domain\n - token\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaID\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n \&#39;400\&#39;:\n description: \&#39;Bad request: Submited URI is not a URI\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;404\&#39;:\n description: token name not found\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/delete:\n post:\n security:\n - cookieAuth: []\n summary: Delete token from mcaptcha\n operationId: deleteToken\n tags:\n - mcaptcha\n - domain\n - token\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaID\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/levels/add:\n post:\n security:\n - cookieAuth: []\n summary: Add levels to a token\n operationId: addTokenLevels\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/AddLevels\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;400\&#39;:\n description: duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/levels/update:\n post:\n security:\n - cookieAuth: []\n summary: Update levels of a token\n operationId: updateTokenLevels\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/AddLevels\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;400\&#39;:\n description: duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;401\&#39;:\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/levels/delete:\n post:\n security:\n - cookieAuth: []\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n summary: Delete levels of a token\n operationId: deleteTokenLevels\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/AddLevels\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;401\&#39;:\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/levels/get:\n post:\n security:\n - cookieAuth: []\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n summary: Get levels of a token\n operationId: getTokenLevels\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/AddLevels\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Levels\&#39;\n \&#39;401\&#39;:\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/token/get:\n post:\n security:\n - cookieAuth: []\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n - duration\n summary: Get duration of a token\n operationId: getTokenDuration\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/GetDuration\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Duration\&#39;\n \&#39;401\&#39;:\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n /api/v1/mcaptcha/domain/token/token/update:\n post:\n security:\n - cookieAuth: []\n tags:\n - mcaptcha\n - domain\n - token\n - levels\n - duration\n summary: update duration of a token\n operationId: updateTokenDuration\n requestBody:\n required: true\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/UpdateDuration\&#39;\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;400\&#39;:\n description: \&#39;Bad request: Duration must be greater than 0\&#39;\n \&#39;401\&#39;:\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\ncomponents:\n schemas:\n RegisterUser:\n type: object\n required:\n - username\n - password\n - email\n properties:\n username:\n type: string\n email:\n type: string\n password:\n type: string\n format: password\n LoginUser:\n type: object\n required:\n - username\n - password\n properties:\n username:\n type: string\n password:\n type: string\n format: password\n DeleteUser:\n type: object\n required:\n - password\n properties:\n password:\n type: string\n format: password\n Error:\n type: object\n required:\n - error\n properties:\n error:\n type: string\n User:\n type: object\n required:\n - id\n - name\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n UserDetailCheck:\n type: object\n required:\n - val\n properties:\n val:\n type: string\n Health:\n type: object\n required:\n - db\n properties:\n db:\n type: boolean\n UserDetailCheckRes:\n type: object\n required:\n - exists\n properties:\n val:\n type: boolean\n BuildDetails:\n type: object\n required:\n - version\n - git_commit_hash\n properties:\n version:\n type: string\n git_commit_hash:\n type: string\n AddDomain:\n type: object\n required:\n - name\n properties:\n name:\n type: string\n DomainVerificationChallenge:\n type: object\n required:\n - verification_challenge\n properties:\n verification_challenge:\n type: string\n MCaptchaID:\n type: object\n required:\n - name\n - domain\n properties:\n name:\n type: string\n domain:\n type: string\n MCaptchaDetails:\n type: object\n required:\n - name\n - key\n properties:\n name:\n type: string\n key:\n type: string\n Level:\n type: object\n required:\n - visitor_threshold\n - difficulty_factor\n properties:\n visitor_threshold:\n type: number\n minimum: 1\n maximum: 2147483647\n difficulty_factor:\n type: number\n minimum: 1\n GetLevels:\n type: object\n required:\n - token\n properties:\n token:\n type: string\n Levels:\n type: array\n items:\n $ref: \&#39;#/components/schemas/Level\&#39;\n AddLevels:\n type: object\n required:\n - name\n - levels\n properties:\n name:\n type: string\n levels:\n type: array\n items:\n $ref: \&#39;#/components/schemas/Level\&#39;\n GetDuration:\n type: object\n required:\n - token\n properties:\n token:\n type: string\n Duration:\n type: object\n required:\n - duration\n properties:\n duration:\n type: number\n minimum: 1\n maximum: 2147483647\n UpdateDuration:\n type: object\n required:\n - duration\n - token_name\n properties:\n token_name:\n type: string\n duration:\n type: number\n minimum: 1\n maximum: 2147483647\n securitySchemes:\n cookieAuth:\n type: apiKey\n in: cookie\n name: Authorization\n&quot;;</code></pre></section></div></main></body></html>