enterprise/rac: fix connection token management (#8909)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-03-14 19:55:46 +01:00
committed by GitHub
parent 52d19bf4a6
commit ee86322ab4
3 changed files with 15 additions and 11 deletions

View File

@ -13,7 +13,7 @@ import { customElement, property } from "lit/decorators.js";
import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css";
import { ConnectionToken, Endpoint, RACProvider, RacApi } from "@goauthentik/api";
import { ConnectionToken, RACProvider, RacApi } from "@goauthentik/api";
@customElement("ak-rac-connection-token-list")
export class ConnectionTokenListPage extends Table<ConnectionToken> {
@ -53,18 +53,18 @@ export class ConnectionTokenListPage extends Table<ConnectionToken> {
return html`<ak-forms-delete-bulk
objectLabel=${msg("Connection Token(s)")}
.objects=${this.selectedElements}
.metadata=${(item: Endpoint) => {
.metadata=${(item: ConnectionToken) => {
return [
{ key: msg("Name"), value: item.name },
{ key: msg("Host"), value: item.host },
{ key: msg("Endpoint"), value: item.endpointObj.name },
{ key: msg("User"), value: item.user.username },
];
}}
.usedBy=${(item: Endpoint) => {
.usedBy=${(item: ConnectionToken) => {
return new RacApi(DEFAULT_CONFIG).racConnectionTokensUsedByList({
connectionTokenUuid: item.pk,
});
}}
.delete=${(item: Endpoint) => {
.delete=${(item: ConnectionToken) => {
return new RacApi(DEFAULT_CONFIG).racConnectionTokensDestroy({
connectionTokenUuid: item.pk,
});

View File

@ -88,7 +88,11 @@ export class RACProviderViewPage extends AKElement {
<section slot="page-overview" data-tab-title="${msg("Overview")}">
${this.renderTabOverview()}
</section>
<section slot="page-connections" data-tab-title="${msg("Connections")}">
<section
slot="page-connections"
data-tab-title="${msg("Connections")}"
class="pf-c-page__main-section pf-m-no-padding-mobile"
>
<div class="pf-c-card">
<div class="pf-c-card__body">
<ak-rac-connection-token-list