mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 03:50:10 +00:00
Merge branch 'ENG-3506' into ENG-3506-LDAP
This commit is contained in:
@@ -118,6 +118,7 @@ const Page = () => {
|
||||
authMethod={popUp.viewAuthMethod.data?.authMethod}
|
||||
lockedOut={popUp.viewAuthMethod.data?.lockedOut || false}
|
||||
identityId={identityId}
|
||||
onResetAllLockouts={popUp.viewAuthMethod.data?.refetchIdentity}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
+7
-4
@@ -2,7 +2,7 @@ import { faCog, faLock, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
|
||||
import { OrgPermissionCan } from "@app/components/permissions";
|
||||
import { Button } from "@app/components/v2";
|
||||
import { Button, Tooltip } from "@app/components/v2";
|
||||
import { OrgPermissionIdentityActions, OrgPermissionSubjects } from "@app/context";
|
||||
import { IdentityAuthMethod, identityAuthToNameMap, useGetIdentityById } from "@app/hooks/api";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
@@ -16,7 +16,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export const IdentityAuthenticationSection = ({ identityId, handlePopUpOpen }: Props) => {
|
||||
const { data } = useGetIdentityById(identityId);
|
||||
const { data, refetch } = useGetIdentityById(identityId);
|
||||
|
||||
return data ? (
|
||||
<div className="mt-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||
@@ -31,7 +31,8 @@ export const IdentityAuthenticationSection = ({ identityId, handlePopUpOpen }: P
|
||||
onClick={() =>
|
||||
handlePopUpOpen("viewAuthMethod", {
|
||||
authMethod,
|
||||
lockedOut: data.identity.activeLockoutAuthMethods.includes(authMethod)
|
||||
lockedOut: data.identity.activeLockoutAuthMethods.includes(authMethod),
|
||||
refetchIdentity: refetch
|
||||
})
|
||||
}
|
||||
type="button"
|
||||
@@ -40,7 +41,9 @@ export const IdentityAuthenticationSection = ({ identityId, handlePopUpOpen }: P
|
||||
<span>{identityAuthToNameMap[authMethod]}</span>
|
||||
<div className="flex gap-2">
|
||||
{data.identity.activeLockoutAuthMethods.includes(authMethod) && (
|
||||
<FontAwesomeIcon icon={faLock} size="xs" className="text-red-400/50" />
|
||||
<Tooltip content="Auth method has active lockouts">
|
||||
<FontAwesomeIcon icon={faLock} size="xs" className="text-red-400/50" />
|
||||
</Tooltip>
|
||||
)}
|
||||
<FontAwesomeIcon icon={faCog} size="xs" className="text-mineshaft-400" />
|
||||
</div>
|
||||
|
||||
+5
-2
@@ -13,7 +13,8 @@ export const LockoutFields = ({
|
||||
clearLockoutsResult,
|
||||
lockedOut,
|
||||
identityId,
|
||||
data
|
||||
data,
|
||||
onResetAllLockouts
|
||||
}: {
|
||||
clearLockoutsResult: UseMutationResult<number, object, { identityId: string }, unknown>;
|
||||
lockedOut: boolean;
|
||||
@@ -24,6 +25,7 @@ export const LockoutFields = ({
|
||||
lockoutDurationSeconds: number;
|
||||
lockoutCounterResetSeconds: number;
|
||||
};
|
||||
onResetAllLockouts: () => void;
|
||||
}) => {
|
||||
const { mutateAsync, isPending } = clearLockoutsResult;
|
||||
|
||||
@@ -37,6 +39,7 @@ export const LockoutFields = ({
|
||||
type: "success"
|
||||
});
|
||||
setLockedOutState(false);
|
||||
onResetAllLockouts();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
createNotification({
|
||||
@@ -59,7 +62,7 @@ export const LockoutFields = ({
|
||||
isLoading={isPending}
|
||||
colorSchema="secondary"
|
||||
>
|
||||
Clear All Lockouts
|
||||
Reset All Lockouts
|
||||
</Button>
|
||||
)}
|
||||
</OrgPermissionCan>
|
||||
|
||||
+11
-3
@@ -41,6 +41,7 @@ type Props = {
|
||||
isOpen: boolean;
|
||||
onOpenChange: (isOpen: boolean) => void;
|
||||
onDeleteAuthMethod: () => void;
|
||||
onResetAllLockouts: () => void;
|
||||
};
|
||||
|
||||
type TRevokeOptions = {
|
||||
@@ -52,8 +53,12 @@ export const Content = ({
|
||||
identityId,
|
||||
authMethod,
|
||||
lockedOut,
|
||||
onDeleteAuthMethod
|
||||
}: Pick<Props, "authMethod" | "lockedOut" | "identityId" | "onDeleteAuthMethod">) => {
|
||||
onDeleteAuthMethod,
|
||||
onResetAllLockouts
|
||||
}: Pick<
|
||||
Props,
|
||||
"authMethod" | "lockedOut" | "identityId" | "onDeleteAuthMethod" | "onResetAllLockouts"
|
||||
>) => {
|
||||
const { currentOrg } = useOrganization();
|
||||
const orgId = currentOrg?.id || "";
|
||||
|
||||
@@ -161,6 +166,7 @@ export const Content = ({
|
||||
<Component
|
||||
identityId={identityId}
|
||||
onDelete={handleDelete}
|
||||
onResetAllLockouts={onResetAllLockouts}
|
||||
popUp={popUp}
|
||||
handlePopUpOpen={handlePopUpOpen}
|
||||
handlePopUpToggle={handlePopUpToggle}
|
||||
@@ -188,7 +194,8 @@ export const ViewIdentityAuthModal = ({
|
||||
onOpenChange,
|
||||
authMethod,
|
||||
identityId,
|
||||
lockedOut
|
||||
lockedOut,
|
||||
onResetAllLockouts
|
||||
}: Omit<Props, "onDeleteAuthMethod">) => {
|
||||
if (!identityId || !authMethod) return null;
|
||||
|
||||
@@ -200,6 +207,7 @@ export const ViewIdentityAuthModal = ({
|
||||
authMethod={authMethod}
|
||||
lockedOut={lockedOut}
|
||||
onDeleteAuthMethod={() => onOpenChange(false)}
|
||||
onResetAllLockouts={() => onResetAllLockouts()}
|
||||
/>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
|
||||
+3
-1
@@ -16,7 +16,8 @@ export const ViewIdentityLdapAuthContent = ({
|
||||
handlePopUpOpen,
|
||||
onDelete,
|
||||
popUp,
|
||||
lockedOut
|
||||
lockedOut,
|
||||
onResetAllLockouts
|
||||
}: ViewAuthMethodProps) => {
|
||||
const { data, isPending } = useGetIdentityLdapAuth(identityId);
|
||||
const clearLockoutsResult = useClearIdentityLdapAuthLockouts();
|
||||
@@ -106,6 +107,7 @@ export const ViewIdentityLdapAuthContent = ({
|
||||
lockedOut={lockedOut}
|
||||
clearLockoutsResult={clearLockoutsResult}
|
||||
data={data}
|
||||
onResetAllLockouts={onResetAllLockouts}
|
||||
/>
|
||||
</ViewIdentityContentWrapper>
|
||||
);
|
||||
|
||||
+3
-1
@@ -22,7 +22,8 @@ export const ViewIdentityUniversalAuthContent = ({
|
||||
handlePopUpOpen,
|
||||
onDelete,
|
||||
popUp,
|
||||
lockedOut
|
||||
lockedOut,
|
||||
onResetAllLockouts
|
||||
}: ViewAuthMethodProps) => {
|
||||
const { data, isPending } = useGetIdentityUniversalAuth(identityId);
|
||||
const { data: clientSecrets = [], isPending: clientSecretsPending } =
|
||||
@@ -94,6 +95,7 @@ export const ViewIdentityUniversalAuthContent = ({
|
||||
lockedOut={lockedOut}
|
||||
clearLockoutsResult={clearLockoutsResult}
|
||||
data={data}
|
||||
onResetAllLockouts={onResetAllLockouts}
|
||||
/>
|
||||
<div className="col-span-2 my-3">
|
||||
<div className="mb-3 border-b border-mineshaft-500 pb-2">
|
||||
|
||||
+1
@@ -10,4 +10,5 @@ export type ViewAuthMethodProps = {
|
||||
) => void;
|
||||
popUp: UsePopUpState<["revokeAuthMethod", "upgradePlan", "identityAuthMethod"]>;
|
||||
lockedOut: boolean;
|
||||
onResetAllLockouts: () => void;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user