feat: add scoped upload tokens

This commit is contained in:
Ludwig Lehnert
2026-06-18 19:17:51 +00:00
parent a2b6054440
commit 0ed32f7623
17 changed files with 592 additions and 95 deletions

View File

@@ -0,0 +1,17 @@
'use client';
import { useEffect, useState } from 'react';
export function CurlUploadExample({ path, token = '', fileName = 'datei.pdf' }) {
const [url, setUrl] = useState(path);
useEffect(() => {
setUrl(new URL(path, window.location.origin).toString());
}, [path]);
const header = token
? `-H 'Authorization: Bearer ${token}'`
: `-H 'X-File-Name: ${fileName}'`;
return <pre><code>{`curl -T ./${fileName} ${header} '${url}'`}</code></pre>;
}