policies/reputation: rework reputation to use a single entry, include geo_ip data
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
11
web/package-lock.json
generated
11
web/package-lock.json
generated
@ -45,6 +45,7 @@
|
||||
"chartjs-adapter-moment": "^1.0.0",
|
||||
"codemirror": "^5.65.0",
|
||||
"construct-style-sheets-polyfill": "^3.0.5",
|
||||
"country-flag-icons": "^1.4.19",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"eslint-plugin-custom-elements": "0.0.4",
|
||||
@ -3869,6 +3870,11 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/country-flag-icons": {
|
||||
"version": "1.4.19",
|
||||
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.4.19.tgz",
|
||||
"integrity": "sha512-1hmXFJ4UURQt0Ex0990B7oOL4n9KLpT9NOSEmZoYh+/5DQ7/pikyqaptqCLUFFv/bYHyvYFeo0fqV82XxU6VOA=="
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
@ -11581,6 +11587,11 @@
|
||||
"yaml": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"country-flag-icons": {
|
||||
"version": "1.4.19",
|
||||
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.4.19.tgz",
|
||||
"integrity": "sha512-1hmXFJ4UURQt0Ex0990B7oOL4n9KLpT9NOSEmZoYh+/5DQ7/pikyqaptqCLUFFv/bYHyvYFeo0fqV82XxU6VOA=="
|
||||
},
|
||||
"create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
|
@ -82,6 +82,7 @@
|
||||
"chartjs-adapter-moment": "^1.0.0",
|
||||
"codemirror": "^5.65.0",
|
||||
"construct-style-sheets-polyfill": "^3.0.5",
|
||||
"country-flag-icons": "^1.4.19",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"eslint-plugin-custom-elements": "0.0.4",
|
||||
|
@ -242,11 +242,8 @@ export class AdminInterface extends LitElement {
|
||||
<ak-sidebar-item path="/policy/policies">
|
||||
<span slot="label">${t`Policies`}</span>
|
||||
</ak-sidebar-item>
|
||||
<ak-sidebar-item path="/policy/reputation/ip">
|
||||
<span slot="label">${t`Reputation policy - IPs`}</span>
|
||||
</ak-sidebar-item>
|
||||
<ak-sidebar-item path="/policy/reputation/user">
|
||||
<span slot="label">${t`Reputation policy - Users`}</span>
|
||||
<ak-sidebar-item path="/policy/reputation">
|
||||
<span slot="label">${t`Reputation scores`}</span>
|
||||
</ak-sidebar-item>
|
||||
<ak-sidebar-item path="/core/property-mappings">
|
||||
<span slot="label">${t`Property Mappings`}</span>
|
||||
|
@ -1370,8 +1370,7 @@ msgstr "Define how notifications are sent to users, like Email or Webhook."
|
||||
#: src/pages/outposts/ServiceConnectionListPage.ts
|
||||
#: src/pages/policies/BoundPoliciesList.ts
|
||||
#: src/pages/policies/PolicyListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/property-mappings/PropertyMappingListPage.ts
|
||||
#: src/pages/providers/ProviderListPage.ts
|
||||
#: src/pages/sources/SourcesListPage.ts
|
||||
@ -2331,14 +2330,14 @@ msgstr "ID"
|
||||
msgid "ID Token"
|
||||
msgstr "ID Token"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "IP"
|
||||
msgstr "IP"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "IP Reputation"
|
||||
msgstr "IP Reputation"
|
||||
#~ msgid "IP Reputation"
|
||||
#~ msgstr "IP Reputation"
|
||||
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
@ -2354,6 +2353,7 @@ msgid "Icon shown in the browser tab."
|
||||
msgstr "Icon shown in the browser tab."
|
||||
|
||||
#: src/pages/flows/FlowListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/system-tasks/SystemTaskListPage.ts
|
||||
#: src/pages/tokens/TokenForm.ts
|
||||
#: src/pages/tokens/TokenListPage.ts
|
||||
@ -3869,21 +3869,34 @@ msgstr "Related objects"
|
||||
msgid "Remove the user from the current session."
|
||||
msgstr "Remove the user from the current session."
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation"
|
||||
msgstr "Reputation"
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation for IP and user identifiers. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr "Reputation for IP and user identifiers. Scores are decreased for each failed login and increased for each successful login."
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - IPs"
|
||||
msgstr "Reputation policy - IPs"
|
||||
#~ msgid "Reputation policy - IPs"
|
||||
#~ msgstr "Reputation policy - IPs"
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - Users"
|
||||
msgstr "Reputation policy - Users"
|
||||
#~ msgid "Reputation policy - Users"
|
||||
#~ msgstr "Reputation policy - Users"
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation scores"
|
||||
msgstr "Reputation scores"
|
||||
|
||||
#: src/pages/events/EventInfo.ts
|
||||
#: src/pages/events/EventInfo.ts
|
||||
@ -4048,8 +4061,7 @@ msgstr "Scope which the client can specify to access these properties."
|
||||
msgid "Scopes"
|
||||
msgstr "Scopes"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Score"
|
||||
msgstr "Score"
|
||||
|
||||
@ -5559,6 +5571,10 @@ msgstr "Update password"
|
||||
msgid "Update {0}"
|
||||
msgstr "Update {0}"
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Updated"
|
||||
msgstr "Updated"
|
||||
|
||||
#: src/pages/providers/proxy/ProxyProviderForm.ts
|
||||
msgid "Upstream host that the requests are forwarded to."
|
||||
msgstr "Upstream host that the requests are forwarded to."
|
||||
@ -5640,8 +5656,8 @@ msgstr "User Property Mappings"
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "User Reputation"
|
||||
msgstr "User Reputation"
|
||||
#~ msgid "User Reputation"
|
||||
#~ msgstr "User Reputation"
|
||||
|
||||
#:
|
||||
#:
|
||||
@ -5752,7 +5768,6 @@ msgid "Userinfo URL"
|
||||
msgstr "Userinfo URL"
|
||||
|
||||
#: src/flows/stages/identification/IdentificationStage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/stages/identification/IdentificationStageForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
|
@ -1369,8 +1369,7 @@ msgstr "Définit les méthodes d'envoi des notifications aux utilisateurs, telle
|
||||
#: src/pages/outposts/ServiceConnectionListPage.ts
|
||||
#: src/pages/policies/BoundPoliciesList.ts
|
||||
#: src/pages/policies/PolicyListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/property-mappings/PropertyMappingListPage.ts
|
||||
#: src/pages/providers/ProviderListPage.ts
|
||||
#: src/pages/sources/SourcesListPage.ts
|
||||
@ -2315,14 +2314,14 @@ msgstr "ID"
|
||||
msgid "ID Token"
|
||||
msgstr "ID du jeton"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "IP"
|
||||
msgstr "IP"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "IP Reputation"
|
||||
msgstr "Réputation IP"
|
||||
#~ msgid "IP Reputation"
|
||||
#~ msgstr "Réputation IP"
|
||||
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
@ -2338,6 +2337,7 @@ msgid "Icon shown in the browser tab."
|
||||
msgstr "Icône affichée dans l'onglet du navigateur."
|
||||
|
||||
#: src/pages/flows/FlowListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/system-tasks/SystemTaskListPage.ts
|
||||
#: src/pages/tokens/TokenForm.ts
|
||||
#: src/pages/tokens/TokenListPage.ts
|
||||
@ -3841,21 +3841,34 @@ msgstr ""
|
||||
msgid "Remove the user from the current session."
|
||||
msgstr "Supprimer l'utilisateur de la session actuelle."
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation for IP and user identifiers. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr "Réputation pour les IPs. Les notes sont réduites à chaque échec de connexion, et augmentées à chaque connexion réussie."
|
||||
#~ msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr "Réputation pour les IPs. Les notes sont réduites à chaque échec de connexion, et augmentées à chaque connexion réussie."
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr "Réputation pour les noms d'utilisateur. Les notes sont réduites à chaque échec de connexion, et augmentées à chaque connexion réussie."
|
||||
#~ msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr "Réputation pour les noms d'utilisateur. Les notes sont réduites à chaque échec de connexion, et augmentées à chaque connexion réussie."
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - IPs"
|
||||
msgstr "Politique de réputation - IPs"
|
||||
#~ msgid "Reputation policy - IPs"
|
||||
#~ msgstr "Politique de réputation - IPs"
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - Users"
|
||||
msgstr "Politique de réputation - Utilisateurs"
|
||||
#~ msgid "Reputation policy - Users"
|
||||
#~ msgstr "Politique de réputation - Utilisateurs"
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation scores"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/events/EventInfo.ts
|
||||
#: src/pages/events/EventInfo.ts
|
||||
@ -4019,8 +4032,7 @@ msgstr "Portée que le client peut spécifier pour accéder à ces propriétés.
|
||||
msgid "Scopes"
|
||||
msgstr "Portées"
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Score"
|
||||
msgstr "Note"
|
||||
|
||||
@ -5500,6 +5512,10 @@ msgstr ""
|
||||
msgid "Update {0}"
|
||||
msgstr "Mettre à jour {0}"
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Updated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/providers/proxy/ProxyProviderForm.ts
|
||||
msgid "Upstream host that the requests are forwarded to."
|
||||
msgstr "Hôte amont où transférer les requêtes."
|
||||
@ -5581,8 +5597,8 @@ msgstr "Mapping des propriétés d'utilisateur"
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "User Reputation"
|
||||
msgstr "Réputation utilisateur"
|
||||
#~ msgid "User Reputation"
|
||||
#~ msgstr "Réputation utilisateur"
|
||||
|
||||
#~ msgid "User Settings"
|
||||
#~ msgstr "Paramètres utilisateur"
|
||||
@ -5691,7 +5707,6 @@ msgid "Userinfo URL"
|
||||
msgstr "URL Userinfo"
|
||||
|
||||
#: src/flows/stages/identification/IdentificationStage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/stages/identification/IdentificationStageForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
|
@ -1364,8 +1364,7 @@ msgstr ""
|
||||
#: src/pages/outposts/ServiceConnectionListPage.ts
|
||||
#: src/pages/policies/BoundPoliciesList.ts
|
||||
#: src/pages/policies/PolicyListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/property-mappings/PropertyMappingListPage.ts
|
||||
#: src/pages/providers/ProviderListPage.ts
|
||||
#: src/pages/sources/SourcesListPage.ts
|
||||
@ -2323,14 +2322,14 @@ msgstr ""
|
||||
msgid "ID Token"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "IP"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "IP Reputation"
|
||||
msgstr ""
|
||||
#~ msgid "IP Reputation"
|
||||
#~ msgstr ""
|
||||
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
#: src/pages/applications/ApplicationForm.ts
|
||||
@ -2346,6 +2345,7 @@ msgid "Icon shown in the browser tab."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/flows/FlowListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
#: src/pages/system-tasks/SystemTaskListPage.ts
|
||||
#: src/pages/tokens/TokenForm.ts
|
||||
#: src/pages/tokens/TokenListPage.ts
|
||||
@ -3859,20 +3859,33 @@ msgstr ""
|
||||
msgid "Remove the user from the current session."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation for IP and user identifiers. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#~ msgid "Reputation for IPs. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
msgstr ""
|
||||
#~ msgid "Reputation for usernames. Scores are decreased for each failed login and increased for each successful login."
|
||||
#~ msgstr ""
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - IPs"
|
||||
msgstr ""
|
||||
#~ msgid "Reputation policy - IPs"
|
||||
#~ msgstr ""
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
msgid "Reputation policy - Users"
|
||||
#~ msgid "Reputation policy - Users"
|
||||
#~ msgstr ""
|
||||
|
||||
#: src/interfaces/AdminInterface.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Reputation scores"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/events/EventInfo.ts
|
||||
@ -4038,8 +4051,7 @@ msgstr ""
|
||||
msgid "Scopes"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/IPReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Score"
|
||||
msgstr ""
|
||||
|
||||
@ -5539,6 +5551,10 @@ msgstr ""
|
||||
msgid "Update {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/ReputationListPage.ts
|
||||
msgid "Updated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/providers/proxy/ProxyProviderForm.ts
|
||||
msgid "Upstream host that the requests are forwarded to."
|
||||
msgstr ""
|
||||
@ -5620,8 +5636,8 @@ msgstr ""
|
||||
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
msgid "User Reputation"
|
||||
msgstr ""
|
||||
#~ msgid "User Reputation"
|
||||
#~ msgstr ""
|
||||
|
||||
#:
|
||||
#:
|
||||
@ -5732,7 +5748,6 @@ msgid "Userinfo URL"
|
||||
msgstr ""
|
||||
|
||||
#: src/flows/stages/identification/IdentificationStage.ts
|
||||
#: src/pages/policies/reputation/UserReputationListPage.ts
|
||||
#: src/pages/stages/identification/IdentificationStageForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
#: src/pages/users/ServiceAccountForm.ts
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,76 +0,0 @@
|
||||
import { t } from "@lingui/macro";
|
||||
|
||||
import { TemplateResult, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
import { IPReputation, PoliciesApi } from "@goauthentik/api";
|
||||
|
||||
import { AKResponse } from "../../../api/Client";
|
||||
import { DEFAULT_CONFIG } from "../../../api/Config";
|
||||
import { uiConfig } from "../../../common/config";
|
||||
import "../../../elements/buttons/ModalButton";
|
||||
import "../../../elements/buttons/SpinnerButton";
|
||||
import "../../../elements/forms/DeleteBulkForm";
|
||||
import "../../../elements/forms/ModalForm";
|
||||
import { TableColumn } from "../../../elements/table/Table";
|
||||
import { TablePage } from "../../../elements/table/TablePage";
|
||||
|
||||
@customElement("ak-policy-reputation-ip-list")
|
||||
export class IPReputationListPage extends TablePage<IPReputation> {
|
||||
searchEnabled(): boolean {
|
||||
return true;
|
||||
}
|
||||
pageTitle(): string {
|
||||
return t`IP Reputation`;
|
||||
}
|
||||
pageDescription(): string {
|
||||
return t`Reputation for IPs. Scores are decreased for each failed login and increased for each successful login.`;
|
||||
}
|
||||
pageIcon(): string {
|
||||
return "fa fa-ban";
|
||||
}
|
||||
|
||||
@property()
|
||||
order = "ip";
|
||||
|
||||
checkbox = true;
|
||||
|
||||
async apiEndpoint(page: number): Promise<AKResponse<IPReputation>> {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationIpsList({
|
||||
ordering: this.order,
|
||||
page: page,
|
||||
pageSize: (await uiConfig()).pagination.perPage,
|
||||
search: this.search || "",
|
||||
});
|
||||
}
|
||||
|
||||
columns(): TableColumn[] {
|
||||
return [new TableColumn(t`IP`, "ip"), new TableColumn(t`Score`, "score")];
|
||||
}
|
||||
|
||||
renderToolbarSelected(): TemplateResult {
|
||||
const disabled = this.selectedElements.length < 1;
|
||||
return html`<ak-forms-delete-bulk
|
||||
objectLabel=${t`IP Reputation`}
|
||||
.objects=${this.selectedElements}
|
||||
.usedBy=${(item: IPReputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationIpsUsedByList({
|
||||
id: item.pk,
|
||||
});
|
||||
}}
|
||||
.delete=${(item: IPReputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationIpsDestroy({
|
||||
id: item.pk,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
|
||||
${t`Delete`}
|
||||
</button>
|
||||
</ak-forms-delete-bulk>`;
|
||||
}
|
||||
|
||||
row(item: IPReputation): TemplateResult[] {
|
||||
return [html`${item.ip}`, html`${item.score}`];
|
||||
}
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
import getUnicodeFlagIcon from "country-flag-icons/unicode/index.js";
|
||||
|
||||
import { t } from "@lingui/macro";
|
||||
|
||||
import { TemplateResult, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators.js";
|
||||
|
||||
import { PoliciesApi, UserReputation } from "@goauthentik/api";
|
||||
import { PoliciesApi, Reputation } from "@goauthentik/api";
|
||||
|
||||
import { AKResponse } from "../../../api/Client";
|
||||
import { DEFAULT_CONFIG } from "../../../api/Config";
|
||||
@ -15,28 +17,28 @@ import "../../../elements/forms/ModalForm";
|
||||
import { TableColumn } from "../../../elements/table/Table";
|
||||
import { TablePage } from "../../../elements/table/TablePage";
|
||||
|
||||
@customElement("ak-policy-reputation-user-list")
|
||||
export class UserReputationListPage extends TablePage<UserReputation> {
|
||||
@customElement("ak-policy-reputation-list")
|
||||
export class ReputationListPage extends TablePage<Reputation> {
|
||||
searchEnabled(): boolean {
|
||||
return true;
|
||||
}
|
||||
pageTitle(): string {
|
||||
return t`User Reputation`;
|
||||
return t`Reputation scores`;
|
||||
}
|
||||
pageDescription(): string {
|
||||
return t`Reputation for usernames. Scores are decreased for each failed login and increased for each successful login.`;
|
||||
return t`Reputation for IP and user identifiers. Scores are decreased for each failed login and increased for each successful login.`;
|
||||
}
|
||||
pageIcon(): string {
|
||||
return "fa fa-ban";
|
||||
}
|
||||
|
||||
@property()
|
||||
order = "identifier";
|
||||
|
||||
checkbox = true;
|
||||
|
||||
@property()
|
||||
order = "username";
|
||||
|
||||
async apiEndpoint(page: number): Promise<AKResponse<UserReputation>> {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUsersList({
|
||||
async apiEndpoint(page: number): Promise<AKResponse<Reputation>> {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationScoresList({
|
||||
ordering: this.order,
|
||||
page: page,
|
||||
pageSize: (await uiConfig()).pagination.perPage,
|
||||
@ -45,22 +47,27 @@ export class UserReputationListPage extends TablePage<UserReputation> {
|
||||
}
|
||||
|
||||
columns(): TableColumn[] {
|
||||
return [new TableColumn(t`Username`, "username"), new TableColumn(t`Score`, "score")];
|
||||
return [
|
||||
new TableColumn(t`Identifier`, "identifier"),
|
||||
new TableColumn(t`IP`, "ip"),
|
||||
new TableColumn(t`Score`, "score"),
|
||||
new TableColumn(t`Updated`, "updated"),
|
||||
];
|
||||
}
|
||||
|
||||
renderToolbarSelected(): TemplateResult {
|
||||
const disabled = this.selectedElements.length < 1;
|
||||
return html`<ak-forms-delete-bulk
|
||||
objectLabel=${t`User Reputation`}
|
||||
objectLabel=${t`Reputation`}
|
||||
.objects=${this.selectedElements}
|
||||
.usedBy=${(item: UserReputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUsersUsedByList({
|
||||
id: item.pk,
|
||||
.usedBy=${(item: Reputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationScoresUsedByList({
|
||||
reputationUuid: item.pk || "",
|
||||
});
|
||||
}}
|
||||
.delete=${(item: UserReputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUsersDestroy({
|
||||
id: item.pk,
|
||||
.delete=${(item: Reputation) => {
|
||||
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationScoresDestroy({
|
||||
reputationUuid: item.pk || "",
|
||||
});
|
||||
}}
|
||||
>
|
||||
@ -70,7 +77,15 @@ export class UserReputationListPage extends TablePage<UserReputation> {
|
||||
</ak-forms-delete-bulk>`;
|
||||
}
|
||||
|
||||
row(item: UserReputation): TemplateResult[] {
|
||||
return [html`${item.username}`, html`${item.score}`];
|
||||
row(item: Reputation): TemplateResult[] {
|
||||
return [
|
||||
html`${item.identifier}`,
|
||||
html`${item.ipGeoData?.country
|
||||
? html` ${getUnicodeFlagIcon(item.ipGeoData.country)} `
|
||||
: html``}
|
||||
${item.ip}`,
|
||||
html`${item.score}`,
|
||||
html`${item.updated.toLocaleString()}`,
|
||||
];
|
||||
}
|
||||
}
|
@ -16,8 +16,7 @@ import "./pages/groups/GroupListPage";
|
||||
import "./pages/outposts/OutpostListPage";
|
||||
import "./pages/outposts/ServiceConnectionListPage";
|
||||
import "./pages/policies/PolicyListPage";
|
||||
import "./pages/policies/reputation/IPReputationListPage";
|
||||
import "./pages/policies/reputation/UserReputationListPage";
|
||||
import "./pages/policies/reputation/ReputationListPage";
|
||||
import "./pages/property-mappings/PropertyMappingListPage";
|
||||
import "./pages/providers/ProviderListPage";
|
||||
import "./pages/providers/ProviderViewPage";
|
||||
@ -72,12 +71,8 @@ export const ROUTES: Route[] = [
|
||||
new Route(new RegExp("^/core/tenants$"), html`<ak-tenant-list></ak-tenant-list>`),
|
||||
new Route(new RegExp("^/policy/policies$"), html`<ak-policy-list></ak-policy-list>`),
|
||||
new Route(
|
||||
new RegExp("^/policy/reputation/ip$"),
|
||||
html`<ak-policy-reputation-ip-list></ak-policy-reputation-ip-list>`,
|
||||
),
|
||||
new Route(
|
||||
new RegExp("^/policy/reputation/user$"),
|
||||
html`<ak-policy-reputation-user-list></ak-policy-reputation-user-list>`,
|
||||
new RegExp("^/policy/reputation$"),
|
||||
html`<ak-policy-reputation-list></ak-policy-reputation-list>`,
|
||||
),
|
||||
new Route(new RegExp("^/identity/groups$"), html`<ak-group-list></ak-group-list>`),
|
||||
new Route(new RegExp("^/identity/users$"), html`<ak-user-list></ak-user-list>`),
|
||||
|
Reference in New Issue
Block a user