mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add per-application API Keys
This commit is contained in:
parent
d1afe13a1c
commit
25cc0d2447
35 changed files with 940 additions and 71 deletions
|
@ -92,6 +92,79 @@ var templateViewsMap = map[string]string{
|
|||
</form>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
`,
|
||||
"api_keys": `{{ define "title"}}{{ t "page.api_keys.title" }}{{ end }}
|
||||
|
||||
{{ define "content"}}
|
||||
<section class="page-header">
|
||||
<h1>{{ t "page.api_keys.title" }}</h1>
|
||||
{{ template "settings_menu" dict "user" .user }}
|
||||
</section>
|
||||
|
||||
{{ if .apiKeys }}
|
||||
{{ range .apiKeys }}
|
||||
<table>
|
||||
<tr>
|
||||
<th class="column-25">{{ t "page.api_keys.table.description" }}</th>
|
||||
<td>{{ .Description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ t "page.api_keys.table.token" }}</th>
|
||||
<td>{{ .Token }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ t "page.api_keys.table.last_used_at" }}</th>
|
||||
<td>
|
||||
{{ if .LastUsedAt }}
|
||||
<time datetime="{{ isodate .LastUsedAt }}" title="{{ isodate .LastUsedAt }}">{{ elapsed $.user.Timezone .LastUsedAt }}</time>
|
||||
{{ else }}
|
||||
{{ t "page.api_keys.never_used" }}
|
||||
{{ end }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ t "page.api_keys.table.created_at" }}</th>
|
||||
<td>
|
||||
<time datetime="{{ isodate .CreatedAt }}" title="{{ isodate .CreatedAt }}">{{ elapsed $.user.Timezone .CreatedAt }}</time>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ t "page.api_keys.table.actions" }}</th>
|
||||
<td>
|
||||
<a href="#"
|
||||
data-confirm="true"
|
||||
data-label-question="{{ t "confirm.question" }}"
|
||||
data-label-yes="{{ t "confirm.yes" }}"
|
||||
data-label-no="{{ t "confirm.no" }}"
|
||||
data-label-loading="{{ t "confirm.loading" }}"
|
||||
data-url="{{ route "removeAPIKey" "keyID" .ID }}">{{ t "action.remove" }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<h3>{{ t "page.integration.miniflux_api" }}</h3>
|
||||
<div class="panel">
|
||||
<ul>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_endpoint" }} = <strong>{{ baseURL }}/v1/</strong>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_username" }} = <strong>{{ .user.Username }}</strong>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_password" }} = <strong>{{ t "page.integration.miniflux_api_password_value" }}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<a href="{{ route "createAPIKey" }}" class="button button-primary">{{ t "menu.create_api_key" }}</a>
|
||||
</p>
|
||||
|
||||
{{ end }}
|
||||
`,
|
||||
"bookmark_entries": `{{ define "title"}}{{ t "page.starred.title" }} ({{ .total }}){{ end }}
|
||||
|
@ -317,6 +390,30 @@ var templateViewsMap = map[string]string{
|
|||
</div>
|
||||
</form>
|
||||
{{ end }}
|
||||
`,
|
||||
"create_api_key": `{{ define "title"}}{{ t "page.new_api_key.title" }}{{ end }}
|
||||
|
||||
{{ define "content"}}
|
||||
<section class="page-header">
|
||||
<h1>{{ t "page.new_api_key.title" }}</h1>
|
||||
{{ template "settings_menu" dict "user" .user }}
|
||||
</section>
|
||||
|
||||
<form action="{{ route "saveAPIKey" }}" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf" value="{{ .csrf }}">
|
||||
|
||||
{{ if .errorMessage }}
|
||||
<div class="alert alert-error">{{ t .errorMessage }}</div>
|
||||
{{ end }}
|
||||
|
||||
<label for="form-description">{{ t "form.api_key.label.description" }}</label>
|
||||
<input type="text" name="description" id="form-description" value="{{ .form.Description }}" required autofocus>
|
||||
|
||||
<div class="buttons">
|
||||
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.save" }}</button> {{ t "action.or" }} <a href="{{ route "apiKeys" }}">{{ t "action.cancel" }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{{ end }}
|
||||
`,
|
||||
"create_category": `{{ define "title"}}{{ t "page.new_category.title" }}{{ end }}
|
||||
|
||||
|
@ -992,21 +1089,6 @@ var templateViewsMap = map[string]string{
|
|||
</div>
|
||||
</form>
|
||||
|
||||
<h3>{{ t "page.integration.miniflux_api" }}</h3>
|
||||
<div class="panel">
|
||||
<ul>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_endpoint" }} = <strong>{{ baseURL }}/v1/</strong>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_username" }} = <strong>{{ .user.Username }}</strong>
|
||||
</li>
|
||||
<li>
|
||||
{{ t "page.integration.miniflux_api_password" }} = <strong>{{ t "page.integration.miniflux_api_password_value" }}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3>{{ t "page.integration.bookmarklet" }}</h3>
|
||||
<div class="panel">
|
||||
<p>{{ t "page.integration.bookmarklet.help" }}</p>
|
||||
|
@ -1302,8 +1384,13 @@ var templateViewsMap = map[string]string{
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
</table>
|
||||
<br>
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
<a href="{{ route "createUser" }}" class="button button-primary">{{ t "menu.add_user" }}</a>
|
||||
</p>
|
||||
|
||||
{{ end }}
|
||||
`,
|
||||
}
|
||||
|
@ -1311,11 +1398,13 @@ var templateViewsMap = map[string]string{
|
|||
var templateViewsMapChecksums = map[string]string{
|
||||
"about": "4035658497363d7af7f79be83190404eb21ec633fe8ec636bdfc219d9fc78cfc",
|
||||
"add_subscription": "0dbea93b6fc07423fa066122ad960c69616b829533371a2dbadec1e22d4f1ae0",
|
||||
"api_keys": "27d401b31a72881d5232486ba17eb47edaf5246eaedce81de88698c15ebb2284",
|
||||
"bookmark_entries": "65588da78665699dd3f287f68325e9777d511f1a57fee4131a5bb6d00bb68df8",
|
||||
"categories": "2c5dd0ed6355bd5acc393bbf6117d20458b5581aab82036008324f6bbbe2af75",
|
||||
"category_entries": "dee7b9cd60c6c46f01dd4289940679df31c1fce28ce4aa7249fa459023e1eeb4",
|
||||
"category_feeds": "527c2ffbc4fcec775071424ba1022ae003525dba53a28cc41f48fb7b30aa984b",
|
||||
"choose_subscription": "84c9730cadd78e6ee5a6b4c499aab33acddb4324ac01924d33387543eec4d702",
|
||||
"create_api_key": "5f74d4e92a6684927f5305096378c8be278159a5cd88ce652c7be3280a7d1685",
|
||||
"create_category": "6b22b5ce51abf4e225e23a79f81be09a7fb90acb265e93a8faf9446dff74018d",
|
||||
"create_user": "9b73a55233615e461d1f07d99ad1d4d3b54532588ab960097ba3e090c85aaf3a",
|
||||
"edit_category": "b1c0b38f1b714c5d884edcd61e5b5295a5f1c8b71c469b35391e4dcc97cc6d36",
|
||||
|
@ -1326,11 +1415,11 @@ var templateViewsMapChecksums = map[string]string{
|
|||
"feeds": "ec7d3fa96735bd8422ba69ef0927dcccddc1cc51327e0271f0312d3f881c64fd",
|
||||
"history_entries": "87e17d39de70eb3fdbc4000326283be610928758eae7924e4b08dcb446f3b6a9",
|
||||
"import": "1b59b3bd55c59fcbc6fbb346b414dcdd26d1b4e0c307e437bb58b3f92ef01ad1",
|
||||
"integrations": "6104ff6ff3ac3c1ae5e850c78250aab6e99e2342a337589f3848459fa333766a",
|
||||
"integrations": "30329452743b35c668278f519245fd9be05c1726856e0384ba542f7c307f2788",
|
||||
"login": "0657174d13229bb6d0bc470ccda06bb1f15c1af65c86b20b41ffa5c819eef0cc",
|
||||
"search_entries": "274950d03298c24f3942e209c0faed580a6d57be9cf76a6c236175a7e766ac6a",
|
||||
"sessions": "5d5c677bddbd027e0b0c9f7a0dd95b66d9d95b4e130959f31fb955b926c2201c",
|
||||
"settings": "56f7c06f24eef317353582b0191aa9a5985f46ed755accf97e723ceb4bba4469",
|
||||
"unread_entries": "e38f7ffce17dfad3151b08cd33771a2cefe8ca9db42df04fc98bd1d675dd6075",
|
||||
"users": "17d0b7c760557e20f888d83d6a1b0d4506dab071a593cc42080ec0dbf16adf9e",
|
||||
"users": "d7ff52efc582bbad10504f4a04fa3adcc12d15890e45dff51cac281e0c446e45",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue