重組前檢查點:根目錄 main package

This commit is contained in:
2026-10-03 09:23:38 +08:00
commit f373cb8d37
45 changed files with 5332 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
{{/* 一次性成果面板(共用片段):註冊應用程式與輪替 client secret 成功時,
於 POST 回應直接渲染——資料庫僅存雜湊,明文無法重現,故不採 PRG。
僅定義 "secretpanel" 區塊供頁面模板以 {{template "secretpanel" .Secret}}
引用,不應單獨解析執行。機密式顯示明文 client_secret 與保存警告;
公開式無 secret,改提示以 PKCE 驗證授權請求。 */}}
{{define "secretpanel"}}
<div class="mb-6 rounded-lg border border-emerald-500/40 bg-emerald-500/10 p-4" role="status">
{{if .Rotated}}
<h2 class="mb-2 text-sm font-semibold text-emerald-700 dark:text-emerald-400">{{.Name}}:client secret 已輪替</h2>
{{else if .Public}}
<h2 class="mb-2 text-sm font-semibold text-emerald-700 dark:text-emerald-400">{{.Name}} 已註冊(公開式 Client)</h2>
{{else}}
<h2 class="mb-2 text-sm font-semibold text-emerald-700 dark:text-emerald-400">{{.Name}} 已註冊:client secret 已發配</h2>
{{end}}
<dl class="space-y-2 text-sm">
<div class="flex flex-wrap items-center gap-2">
<dt class="font-medium text-neutral-700 dark:text-neutral-300">client_id</dt>
<dd class="font-mono text-xs break-all">{{.ClientID}}</dd>
</div>
{{if .Secret}}
<div class="flex flex-wrap items-center gap-2">
<dt class="font-medium text-neutral-700 dark:text-neutral-300">client_secret</dt>
<dd class="font-mono text-xs break-all">{{.Secret}}</dd>
</div>
{{end}}
</dl>
{{if .Secret}}
<p class="mt-3 text-sm font-medium text-red-600 dark:text-red-400">此 client secret 只顯示這一次,關閉或重新整理頁面後將無法再查看,請立即交付給應用程式管理者妥善保存。</p>
{{else}}
<p class="mt-3 text-sm text-neutral-600 dark:text-neutral-300">公開式 Client 不持有 client secret,授權請求須以 PKCE(code_challenge)驗證。</p>
{{end}}
</div>
{{end}}