Files
OpenArchiver/assets/api_integrity.md.CTx79Yjz.js
2025-10-24 15:11:40 +00:00

15 lines
6.9 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as e,c as s,o as i,ag as a}from"./chunks/framework.S-Qvb3wi.js";const k=JSON.parse('{"title":"Integrity Check API","description":"","frontmatter":{},"headers":[],"relativePath":"api/integrity.md","filePath":"api/integrity.md"}'),n={name:"api/integrity.md"};function l(h,t,o,r,d,p){return i(),s("div",null,t[0]||(t[0]=[a(`<h1 id="integrity-check-api" tabindex="-1">Integrity Check API <a class="header-anchor" href="#integrity-check-api" aria-label="Permalink to &quot;Integrity Check API&quot;"></a></h1><p>The Integrity Check API provides an endpoint to verify the cryptographic hash of an archived email and its attachments against the stored values in the database. This allows you to ensure that the stored files have not been tampered with or corrupted since they were archived.</p><h2 id="check-email-integrity" tabindex="-1">Check Email Integrity <a class="header-anchor" href="#check-email-integrity" aria-label="Permalink to &quot;Check Email Integrity&quot;"></a></h2><p>Verifies the integrity of a specific archived email and all of its associated attachments.</p><ul><li><strong>URL:</strong> <code>/api/v1/integrity/:id</code></li><li><strong>Method:</strong> <code>GET</code></li><li><strong>URL Params:</strong><ul><li><code>id=[string]</code> (required) - The UUID of the archived email to check.</li></ul></li><li><strong>Permissions:</strong> <code>read:archive</code></li><li><strong>Success Response:</strong><ul><li><strong>Code:</strong> 200 OK</li><li><strong>Content:</strong> <code>IntegrityCheckResult[]</code></li></ul></li></ul><h3 id="response-body-integritycheckresult" tabindex="-1">Response Body <code>IntegrityCheckResult</code> <a class="header-anchor" href="#response-body-integritycheckresult" aria-label="Permalink to &quot;Response Body \`IntegrityCheckResult\`&quot;"></a></h3><p>An array of objects, each representing the result of an integrity check for a single file (either the email itself or an attachment).</p><table tabindex="0"><thead><tr><th style="text-align:left;">Field</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;"><code>&#39;email&#39; | &#39;attachment&#39;</code></td><td style="text-align:left;">The type of the file being checked.</td></tr><tr><td style="text-align:left;"><code>id</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">The UUID of the email or attachment.</td></tr><tr><td style="text-align:left;"><code>filename</code></td><td style="text-align:left;"><code>string</code> (optional)</td><td style="text-align:left;">The filename of the attachment. This field is only present for attachments.</td></tr><tr><td style="text-align:left;"><code>isValid</code></td><td style="text-align:left;"><code>boolean</code></td><td style="text-align:left;"><code>true</code> if the current hash matches the stored hash, otherwise <code>false</code>.</td></tr><tr><td style="text-align:left;"><code>reason</code></td><td style="text-align:left;"><code>string</code> (optional)</td><td style="text-align:left;">A reason for the failure. Only present if <code>isValid</code> is <code>false</code>.</td></tr></tbody></table><h3 id="example-response" tabindex="-1">Example Response <a class="header-anchor" href="#example-response" aria-label="Permalink to &quot;Example Response&quot;"></a></h3><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;type&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;email&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;id&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;a1b2c3d4-e5f6-7890-1234-567890abcdef&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;isValid&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;type&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;attachment&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;id&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;b2c3d4e5-f6a7-8901-2345-67890abcdef1&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;filename&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;document.pdf&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;isValid&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;reason&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Stored hash does not match current hash.&quot;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span></code></pre></div><ul><li><strong>Error Response:</strong><ul><li><strong>Code:</strong> 404 Not Found</li><li><strong>Content:</strong> <code>{ &quot;message&quot;: &quot;Archived email not found&quot; }</code></li></ul></li></ul>`,11)]))}const g=e(n,[["render",l]]);export{k as __pageData,g as default};