mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-06-12 00:56:39 +00:00
3 lines
25 KiB
HTML
3 lines
25 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="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">☰</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">−</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: &<a class="primitive" href="https://doc.rust-lang.org/1.55.0/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: >-\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: \'#/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\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n\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\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\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n\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\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\n responses:\n \'200\':\n description: OK\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/MCaptchaDetails\'\n\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\n \'500\':\n description: Internal server error\n content:\n application/json:\n schema:\n $ref: \'#/components/schemas/Error\'\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: \'#/components/schemas/MCaptchaID\'\n\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\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\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\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\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\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\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\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\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\'\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: \'#/components/schemas/Level\'\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: \'#/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\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";</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> |