Phase 3: OpenSubsonic core (response envelope, error codes 42-44, getOpenSubsonicExtensions) and apiKeyAuthentication extension with tokenInfo, web API key management

This commit is contained in:
2026-08-23 08:04:01 -05:00
parent 3b4883780b
commit e38d31d384
17 changed files with 763 additions and 37 deletions
+30
View File
@@ -0,0 +1,30 @@
{{define "admin_api_keys"}}{{template "header" .}}
<p class="text-secondary small">All API keys across every user. Used for OpenSubsonic <code>apiKey=</code> authentication.</p>
{{if .Data}}
<table class="table vs-table table-sm">
<thead><tr><th>User</th><th>Name</th><th>Client</th><th>Created</th><th>Last used</th><th>Status</th><th></th></tr></thead>
<tbody>
{{range .Data}}
<tr>
<td>{{.Username}}</td>
<td>{{.Key.Name}}</td>
<td class="text-secondary small">{{.Key.ClientDescription}}</td>
<td class="text-secondary small">{{fmtTime .Key.CreatedAt}}</td>
<td class="text-secondary small">{{if .Key.LastUsedAt.Valid}}{{fmtTime .Key.LastUsedAt.Time}}{{else}}never{{end}}</td>
<td>{{if .Key.RevokedAt.Valid}}<span class="text-danger">Revoked</span>{{else}}<span class="text-success">Active</span>{{end}}</td>
<td class="text-end">
{{if not .Key.RevokedAt.Valid}}
<form method="post" action="/admin/api-keys/{{.Key.ID}}/revoke">
{{template "csrf_field" $.CSRFToken}}
<button type="submit" class="btn btn-sm btn-outline-danger">Revoke</button>
</form>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="text-secondary">No API keys have been created yet.</p>
{{end}}
{{template "footer" .}}{{end}}