removed revocation (#26459)

fixes: #17734

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-01-30 10:49:39 +01:00 committed by GitHub
parent 4716c956b0
commit 02d86d1d8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 184 deletions

View file

@ -1,11 +1,6 @@
import PageObject from "../../../../components/PageObject";
export default class AdvancedTab extends PageObject {
#setToNowBtn = "#setToNow";
#clearBtn = "#clear";
#pushBtn = "#push";
#notBeforeInput = "#kc-not-before";
#clusterNodesExpandBtn =
".pf-c-expandable-section .pf-c-expandable-section__toggle";
#testClusterAvailability = "#testClusterAvailability";
@ -48,39 +43,6 @@ export default class AdvancedTab extends PageObject {
#jumpToAdvancedSettings = "jump-link-advanced-settings";
#jumpToAuthFlowOverride = "jump-link-authentication-flow-overrides";
setRevocationToNow() {
cy.get(this.#setToNowBtn).click();
return this;
}
clearRevocation() {
cy.get(this.#clearBtn).click();
return this;
}
pushRevocation() {
cy.get(this.#pushBtn).click();
return this;
}
checkRevacationIsNone() {
cy.get(this.#notBeforeInput).should("have.value", "None");
return this;
}
checkRevocationIsSetToNow() {
cy.get(this.#notBeforeInput).should(
"have.value",
new Date().toLocaleString("en-US", {
dateStyle: "long",
timeStyle: "short",
}),
);
return this;
}
expandClusterNode() {
cy.get(this.#clusterNodesExpandBtn).click();
return this;

View file

@ -303,7 +303,6 @@ webAuthnPolicyCreateTimeout=Timeout
comparison=Comparison
passwordPoliciesHelp.digits=The number of numerical digits required in the password string.
deletedSuccessClientScope=The client scope has been deleted
notBeforeError=Error clearing "Not Before" for realm\: {{error}}
columnDisplayName=Display name
noUsersFoundErrorStorage=No users found, could be due to wrongly configured federated provider {{error}}
lookAround=Look around window
@ -457,7 +456,6 @@ displayDescriptionField=Display description
eventTypes.DELETE_ACCOUNT.description=Delete account
eventTypes.RESTART_AUTHENTICATION_ERROR.description=Restart authentication error
evictionHour=Eviction hour
notBefore=Not before
onDragFinish=Dragging finished {{list}}
otpSupportedApplications.totpAppMicrosoftAuthenticatorName=Microsoft Authenticator
ldapMappersList=LDAP Mappers
@ -624,7 +622,6 @@ alwaysDisplayInUIHelp=Always list this client in the Account UI, even if the use
eventTypes.UPDATE_PASSWORD.name=Update password
eventTypes.UPDATE_CONSENT.description=Update consent
realmSaveSuccess=Realm successfully updated
notBeforePushFail=Failed to push "not before" to\: {{failedNodes}}
executorTypeTextHelpText=Executor Type Text Help Text
eventTypes.IDENTITY_PROVIDER_LOGIN_ERROR.description=Identity provider login error
readTimeout=Read timeout
@ -718,7 +715,6 @@ rowSaveBtnAriaLabel=Save edits for {{messageBundle}}
permanentLockout=Permanent lockout
debug=Debug
webAuthnPolicyRequireResidentKey=Require resident key
notBeforePushSuccess=Successfully push "not before" to\: {{successNodes}}
unlockUsersConfirm=All the users that are temporarily locked will be unlocked.
clear=Clear
idpType.custom=Custom
@ -2343,7 +2339,6 @@ rowCancelBtnAriaLabel=Cancel edits for {{messageBundle}}
validateSignatureHelp=Enable/disable signature validation of external IDP signatures.
searchForFlow=Search for flow
verifyEmail=Verify email
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
addressClaim.locality.label=User Attribute Name for Locality
formatOption=Format option
addAuthnContextClassRef=Add AuthnContext ClassRef
@ -2353,7 +2348,6 @@ whoCanEdit=Who can edit?
mappingCreatedSuccess=Mapping successfully created
eventTypes.GRANT_CONSENT.description=Grant consent
client=Client
setToNow=Set to now
eventTypes.OAUTH2_DEVICE_AUTH_ERROR.name=Oauth2 device authentication error
addSubFlowHelp=Sub-Flows can be either generic or form. The form type is used to construct a sub-flow that generates a single flow for the user. Sub-flows are a special type of execution that evaluate as successful depending on how the executions they contain evaluate.
implicitFlow=Implicit flow

View file

@ -14,7 +14,6 @@ import { ClusteringPanel } from "./advanced/ClusteringPanel";
import { FineGrainOpenIdConnect } from "./advanced/FineGrainOpenIdConnect";
import { FineGrainSamlEndpointConfig } from "./advanced/FineGrainSamlEndpointConfig";
import { OpenIdConnectCompatibilityModes } from "./advanced/OpenIdConnectCompatibilityModes";
import { RevocationPanel } from "./advanced/RevocationPanel";
export const parseResult = (
result: GlobalRequestResult,
@ -75,11 +74,6 @@ export const AdvancedTab = ({ save, client }: AdvancedProps) => {
<ScrollForm
label={t("jumpToSection")}
sections={[
{
title: t("revocation"),
isHidden: protocol !== openIdConnect,
panel: <RevocationPanel client={client} save={save} />,
},
{
title: t("clustering"),
isHidden: !publicClient,

View file

@ -1,134 +0,0 @@
import {
ActionGroup,
Button,
FormGroup,
InputGroup,
Text,
Tooltip,
} from "@patternfly/react-core";
import { useEffect, useRef } from "react";
import { useFormContext } from "react-hook-form";
import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { HelpItem } from "ui-shared";
import { adminClient } from "../../admin-client";
import { useAlerts } from "../../components/alert/Alerts";
import { FormAccess } from "../../components/form/FormAccess";
import { KeycloakTextInput } from "../../components/keycloak-text-input/KeycloakTextInput";
import { useRealm } from "../../context/realm-context/RealmContext";
import useFormatDate, { FORMAT_DATE_AND_TIME } from "../../utils/useFormatDate";
import { AdvancedProps, parseResult } from "../AdvancedTab";
import { toClient } from "../routes/Client";
export const RevocationPanel = ({
save,
client: { id, adminUrl, access },
}: AdvancedProps) => {
const revocationFieldName = "notBefore";
const pushRevocationButtonRef = useRef<HTMLElement>();
const { t } = useTranslation();
const { realm } = useRealm();
const { addAlert } = useAlerts();
const formatDate = useFormatDate();
const { getValues, setValue, register } = useFormContext();
const setNotBefore = (time: number, messageKey: string) => {
setValue(revocationFieldName, time);
save({ messageKey });
};
useEffect(() => {
register(revocationFieldName);
}, [register]);
const getNotBeforeValue = () => {
const date = getValues(revocationFieldName);
if (date > 0) {
return formatDate(new Date(date * 1000), FORMAT_DATE_AND_TIME);
} else {
return t("none");
}
};
const push = async () => {
const result = await adminClient.clients.pushRevocation({
id: id!,
});
parseResult(result, "notBeforePush", addAlert, t);
};
return (
<>
<Text className="pf-u-pb-lg">
<Trans i18nKey="notBeforeIntro">
In order to successfully push setup url on
<Link to={toClient({ realm, clientId: id!, tab: "settings" })}>
{t("settings")}
</Link>
tab
</Trans>
</Text>
<FormAccess
role="manage-clients"
fineGrainedAccess={access?.configure}
isHorizontal
>
<FormGroup
label={t("notBefore")}
fieldId="kc-not-before"
labelIcon={
<HelpItem helpText={t("notBeforeHelp")} fieldLabelId="notBefore" />
}
>
<InputGroup>
<KeycloakTextInput
type="text"
id="kc-not-before"
name="notBefore"
isReadOnly
value={getNotBeforeValue()}
/>
<Button
id="setToNow"
variant="control"
onClick={() => {
setNotBefore(Date.now() / 1000, "notBeforeSetToNow");
}}
>
{t("setToNow")}
</Button>
<Button
id="clear"
variant="control"
onClick={() => {
setNotBefore(0, "notBeforeNowClear");
}}
>
{t("clear")}
</Button>
</InputGroup>
</FormGroup>
<ActionGroup>
{!adminUrl && (
<Tooltip
reference={pushRevocationButtonRef}
content={t("notBeforeTooltip")}
/>
)}
<Button
id="push"
variant="secondary"
onClick={push}
isAriaDisabled={!adminUrl}
ref={pushRevocationButtonRef}
>
{t("push")}
</Button>
</ActionGroup>
</FormAccess>
</>
);
};