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:
@@ -21,12 +21,13 @@
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h2 class="h6">API keys</h2>
|
||||
<p class="text-secondary small">Used by third-party Subsonic clients in later phases.</p>
|
||||
<form method="post" action="/settings/api-keys" class="d-flex gap-2 mb-3">
|
||||
<h2 class="h6" id="api-keys">API keys</h2>
|
||||
<p class="text-secondary small">Used by OpenSubsonic clients via <code>apiKey=</code> authentication, in place of your password.</p>
|
||||
<form method="post" action="/settings/api-keys" class="row g-2 mb-3">
|
||||
{{template "csrf_field" .CSRFToken}}
|
||||
<input type="text" name="name" class="form-control form-control-sm" placeholder="Key name">
|
||||
<button type="submit" class="btn btn-outline-primary btn-sm text-nowrap">New key</button>
|
||||
<div class="col-5"><input type="text" name="name" class="form-control form-control-sm" placeholder="Key name" required></div>
|
||||
<div class="col-5"><input type="text" name="client_description" class="form-control form-control-sm" placeholder="Client (optional)"></div>
|
||||
<div class="col-2"><button type="submit" class="btn btn-outline-primary btn-sm w-100">New key</button></div>
|
||||
</form>
|
||||
{{if .Data.NewAPIKey}}
|
||||
<div class="alert alert-warning small">
|
||||
@@ -38,13 +39,18 @@
|
||||
<tbody>
|
||||
{{range .Data.APIKeys}}
|
||||
<tr>
|
||||
<td>{{.Name}}</td>
|
||||
<td class="text-secondary small">{{fmtTime .CreatedAt}}</td>
|
||||
<td>{{.Name}}{{if .ClientDescription}} <span class="text-secondary small">({{.ClientDescription}})</span>{{end}}</td>
|
||||
<td class="text-secondary small">
|
||||
{{fmtTime .CreatedAt}}
|
||||
{{if .LastUsedAt.Valid}}· last used {{fmtTime .LastUsedAt.Time}}{{else}}· never used{{end}}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
{{if .RevokedAt.Valid}}<span class="text-danger small">Revoked</span>{{else}}
|
||||
<form method="post" action="/settings/api-keys/{{.ID}}/revoke">
|
||||
{{template "csrf_field" $.CSRFToken}}
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Revoke</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user