Process UXD feedback for client revocation (#1139)
This commit is contained in:
parent
787a565213
commit
5979101b0b
3 changed files with 46 additions and 38 deletions
|
@ -120,18 +120,6 @@ describe("Clients test", function () {
|
||||||
new AdminClient().deleteClient(client);
|
new AdminClient().deleteClient(client);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Revocation", () => {
|
|
||||||
advancedTab.checkNone();
|
|
||||||
|
|
||||||
advancedTab.clickSetToNow().checkSetToNow();
|
|
||||||
advancedTab.clickClear().checkNone();
|
|
||||||
|
|
||||||
advancedTab.clickPush();
|
|
||||||
masthead.checkNotificationMessage(
|
|
||||||
"No push sent. No admin URI configured or no registered cluster nodes available"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Clustering", () => {
|
it("Clustering", () => {
|
||||||
advancedTab.expandClusterNode();
|
advancedTab.expandClusterNode();
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,19 @@ import {
|
||||||
ButtonVariant,
|
ButtonVariant,
|
||||||
ExpandableSection,
|
ExpandableSection,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
|
InputGroup,
|
||||||
PageSection,
|
PageSection,
|
||||||
Split,
|
Split,
|
||||||
SplitItem,
|
SplitItem,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
ToolbarItem,
|
ToolbarItem,
|
||||||
|
Tooltip,
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
|
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
|
||||||
import type GlobalRequestResult from "@keycloak/keycloak-admin-client/lib/defs/globalRequestResult";
|
import type GlobalRequestResult from "@keycloak/keycloak-admin-client/lib/defs/globalRequestResult";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { Controller, useFormContext } from "react-hook-form";
|
import { Controller, useFormContext } from "react-hook-form";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
@ -52,6 +54,7 @@ export const AdvancedTab = ({
|
||||||
attributes,
|
attributes,
|
||||||
protocol,
|
protocol,
|
||||||
authenticationFlowBindingOverrides,
|
authenticationFlowBindingOverrides,
|
||||||
|
adminUrl,
|
||||||
},
|
},
|
||||||
}: AdvancedProps) => {
|
}: AdvancedProps) => {
|
||||||
const { t } = useTranslation("clients");
|
const { t } = useTranslation("clients");
|
||||||
|
@ -68,6 +71,7 @@ export const AdvancedTab = ({
|
||||||
const [key, setKey] = useState(0);
|
const [key, setKey] = useState(0);
|
||||||
const refresh = () => setKey(new Date().getTime());
|
const refresh = () => setKey(new Date().getTime());
|
||||||
const [nodes, setNodes] = useState(registeredNodes || {});
|
const [nodes, setNodes] = useState(registeredNodes || {});
|
||||||
|
const pushRevocationButtonRef = useRef<HTMLElement>();
|
||||||
|
|
||||||
const setNotBefore = (time: number, messageKey: string) => {
|
const setNotBefore = (time: number, messageKey: string) => {
|
||||||
setValue(revocationFieldName, time);
|
setValue(revocationFieldName, time);
|
||||||
|
@ -199,6 +203,7 @@ export const AdvancedTab = ({
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
<InputGroup>
|
||||||
<TextInput
|
<TextInput
|
||||||
type="text"
|
type="text"
|
||||||
id="kc-not-before"
|
id="kc-not-before"
|
||||||
|
@ -206,11 +211,9 @@ export const AdvancedTab = ({
|
||||||
isReadOnly
|
isReadOnly
|
||||||
value={formatDate()}
|
value={formatDate()}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
|
||||||
<ActionGroup>
|
|
||||||
<Button
|
<Button
|
||||||
id="setToNow"
|
id="setToNow"
|
||||||
variant="tertiary"
|
variant="control"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setNotBefore(moment.now() / 1000, "notBeforeSetToNow");
|
setNotBefore(moment.now() / 1000, "notBeforeSetToNow");
|
||||||
}}
|
}}
|
||||||
|
@ -219,14 +222,29 @@ export const AdvancedTab = ({
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
id="clear"
|
id="clear"
|
||||||
variant="tertiary"
|
variant="control"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setNotBefore(0, "notBeforeNowClear");
|
setNotBefore(0, "notBeforeNowClear");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("clear")}
|
{t("clear")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button id="push" variant="secondary" onClick={push}>
|
</InputGroup>
|
||||||
|
</FormGroup>
|
||||||
|
<ActionGroup>
|
||||||
|
{!adminUrl && (
|
||||||
|
<Tooltip
|
||||||
|
reference={pushRevocationButtonRef}
|
||||||
|
content={t("clients-help:notBeforeTooltip")}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
id="push"
|
||||||
|
variant="secondary"
|
||||||
|
onClick={push}
|
||||||
|
isAriaDisabled={!adminUrl}
|
||||||
|
ref={pushRevocationButtonRef}
|
||||||
|
>
|
||||||
{t("push")}
|
{t("push")}
|
||||||
</Button>
|
</Button>
|
||||||
</ActionGroup>
|
</ActionGroup>
|
||||||
|
|
|
@ -60,9 +60,11 @@ export default {
|
||||||
scopeParameter:
|
scopeParameter:
|
||||||
"You can copy/paste this value of scope parameter and use it in initial OpenID Connect Authentication Request sent from this client adapter. Default client scopes and selected optional client scopes will be used when generating token issued for this client",
|
"You can copy/paste this value of scope parameter and use it in initial OpenID Connect Authentication Request sent from this client adapter. Default client scopes and selected optional client scopes will be used when generating token issued for this client",
|
||||||
user: "Optionally select user, for whom the example access token will be generated. If you do not select a user, example access token will not be generated during evaluation",
|
user: "Optionally select user, for whom the example access token will be generated. If you do not select a user, example access token will not be generated during evaluation",
|
||||||
notBefore: "Revoke any tokens issued before this date for this client.",
|
notBefore:
|
||||||
|
"Revoke any tokens issued before this time for this client. To push the policy, you should set an effective admin URL in the Settings tab first.",
|
||||||
notBeforeIntro:
|
notBeforeIntro:
|
||||||
"In order to successfully push a revocation policy to the client, you need to set an Admin URL under the <1>Settings</1> tab for this client first",
|
"In order to successfully push a revocation policy to the client, you need to set an Admin URL under the <1>Settings</1> tab for this client first",
|
||||||
|
notBeforeTooltip: "The admin URL should be set in the Settings tab first.",
|
||||||
nodeReRegistrationTimeout:
|
nodeReRegistrationTimeout:
|
||||||
"Interval to specify max time for registered clients cluster nodes to re-register. If cluster node will not send re-registration request to Keycloak within this time, it will be unregistered from Keycloak",
|
"Interval to specify max time for registered clients cluster nodes to re-register. If cluster node will not send re-registration request to Keycloak within this time, it will be unregistered from Keycloak",
|
||||||
fineGrainOpenIdConnectConfiguration:
|
fineGrainOpenIdConnectConfiguration:
|
||||||
|
|
Loading…
Reference in a new issue