mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-06-13 01:26:39 +00:00
8 lines
26 KiB
HTML
8 lines
26 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`."><meta name="keywords" content="rust, rustlang, rust-lang, OPEN_API_SPEC"><title>OPEN_API_SPEC in mcaptcha::docs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.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">☰</button><a class="sidebar-logo" href="../../mcaptcha/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||
</a><h2 class="location"></h2>
|
||
</nav>
|
||
<nav class="sidebar"><a class="sidebar-logo" href="../../mcaptcha/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In mcaptcha::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><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../mcaptcha/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||
<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 item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/mcaptcha/docs.rs.html#79">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const OPEN_API_SPEC: &<a class="primitive" href="https://doc.rust-lang.org/1.62.1/std/primitive.str.html">str</a> = "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: \'#/components/schemas/RegisterUser\'\n example:\n username: testuser\n password: mysuperlongandsecurepassword\n email: testuser@example.com\n responses:\n \'200\':\n description: Successful registration\n \'400\':\n description: \'Bad request: username contains profainity/blacklisted words or email not acceptable or password too long/short or duplicate username/password\'\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/LoginUser\'\n example:\n username: testuser\n password: mysuperlongandsecurepassword\n responses:\n \'200\':\n description: Successful authentication\n \'401\':\n description: \'authentication failed, wrong password\'\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'404\':\n description: username not found\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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 \'200\':\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: \'#/components/schemas/DeleteUser\'\n example:\n password: mysuperlongandsecurepassword\n responses:\n \'200\':\n description: OK\n \'401\':\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'404\':\n description: username not found\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/UserDetailCheck\'\n example:\n val: testuser\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/UserDetailCheckRes\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/UserDetailCheck\'\n example:\n val: testuser@example.com\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/UserDetailCheckRes\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n /api/v1/meta/health:\n get:\n summary: Health check\n operationId: healthCheck\n tags:\n - meta\n - health\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Health\'\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 \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/BuildDetails\'\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: \'#/components/schemas/MCaptchaID\'\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n \'400\':\n description: \'Bad request: Submited URI is not a URI or duplicate token name\'\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/MCaptchaID\'\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n \'400\':\n description: \'Bad request: Submited URI is not a URI or duplicate token name\'\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/MCaptchaID\'\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n \'400\':\n description: \'Bad request: Submited URI is not a URI\'\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'404\':\n description: token name not found\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/MCaptchaID\'\n responses:\n \'200\':\n description: OK\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/AddLevels\'\n responses:\n \'200\':\n description: OK\n \'400\':\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: \'#/components/schemas/Error\'\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/AddLevels\'\n responses:\n \'200\':\n description: OK\n \'400\':\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: \'#/components/schemas/Error\'\n \'401\':\n description: authentication failed\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/AddLevels\'\n responses:\n \'200\':\n description: OK\n \'401\':\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/AddLevels\'\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Levels\'\n \'401\':\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/GetDuration\'\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Duration\'\n \'401\':\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/UpdateDuration\'\n responses:\n \'200\':\n description: OK\n \'400\':\n description: \'Bad request: Duration must be greater than 0\'\n \'401\':\n description: (cookie)authentication required or wrong password\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/Level\'\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: \'#/components/schemas/Level\'\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";</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="mcaptcha" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.1 (e092d0b6b 2022-07-16)" ></div>
|
||
</body></html> |