mCaptcha/mcaptcha/docs/constant.OPEN_API_SPEC.html

3 lines
25 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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`."><meta name="keywords" content="rust, rustlang, rust-lang, OPEN_API_SPEC"><title>OPEN_API_SPEC in mcaptcha::docs - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../mcaptcha/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../index.html">mcaptcha</a>::<wbr><a href="index.html">docs</a></h2><div id="sidebar-vars" data-name="OPEN_API_SPEC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input"name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">mcaptcha</a>::<wbr><a href="index.html">docs</a>::<wbr><a class="constant" href="#">OPEN_API_SPEC</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/mcaptcha/docs.rs.html#76" title="goto source code">[src]</a></span></h1><pre class="rust const">const OPEN_API_SPEC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.55.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: \&#39;testuser\&#39;\n password: \&#39;mysuperlongandsecurepassword\&#39;\n email: \&#39;testuser@example.com\&#39;\n responses:\n \&#39;200\&#39;:\n description: Successful registration\n \&#39;400\&#39;:\n description: &gt;-\n Bad request: username contains profainity/blacklisted words or email\n not acceptable or password too long/short or duplicate\n username/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/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: \&#39;testuser\&#39;\n password: \&#39;mysuperlongandsecurepassword\&#39;\n responses:\n \&#39;200\&#39;:\n description: Successful authentication\n \&#39;401\&#39;:\n description: \&#39;authentication failed, wrong password\&#39;\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: \&#39;mysuperlongandsecurepassword\&#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;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: \&#39;testuser\&#39;\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: \&#39;testuser@example.com\&#39;\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\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n\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: \&#39;authentication failed\&#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\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\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n\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: \&#39;authentication failed\&#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\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\n responses:\n \&#39;200\&#39;:\n description: OK\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/MCaptchaDetails\&#39;\n\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: \&#39;authentication failed\&#39;\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\n \&#39;500\&#39;:\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n\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\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;401\&#39;:\n description: \&#39;authentication failed\&#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\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\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;400\&#39;:\n description: \&#39;duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n\n \&#39;401\&#39;:\n description: \&#39;authentication failed\&#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\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\n responses:\n \&#39;200\&#39;:\n description: OK\n \&#39;400\&#39;:\n description: \&#39;duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count\&#39;\n content:\n application/json:\n schema:\n $ref: \&#39;#/components/schemas/Error\&#39;\n\n \&#39;401\&#39;:\n description: \&#39;authentication failed\&#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\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\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;\n\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\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\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\n securitySchemes:\n cookieAuth:\n type: apiKey\n in: cookie\n name: Authorization\n&quot;;</pre></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="mcaptcha" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div>
<script src="../../main.js"></script>
</body></html>