mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-12 19:29:15 +00:00
- Swap database column names to include "seconds" - Use MS for frontend
time display
This commit is contained in:
@@ -1436,8 +1436,8 @@ export const useAddIdentityLdapAuth = () => {
|
||||
accessTokenTrustedIps,
|
||||
lockoutEnabled,
|
||||
lockoutThreshold,
|
||||
lockoutDuration,
|
||||
lockoutCounterReset
|
||||
lockoutDurationSeconds,
|
||||
lockoutCounterResetSeconds
|
||||
}) => {
|
||||
const { data } = await apiRequest.post<{ identityLdapAuth: IdentityLdapAuth }>(
|
||||
`/api/v1/auth/ldap-auth/identities/${identityId}`,
|
||||
@@ -1456,8 +1456,8 @@ export const useAddIdentityLdapAuth = () => {
|
||||
accessTokenTrustedIps,
|
||||
lockoutEnabled,
|
||||
lockoutThreshold,
|
||||
lockoutDuration,
|
||||
lockoutCounterReset
|
||||
lockoutDurationSeconds,
|
||||
lockoutCounterResetSeconds
|
||||
}
|
||||
);
|
||||
return data.identityLdapAuth;
|
||||
@@ -1493,8 +1493,8 @@ export const useUpdateIdentityLdapAuth = () => {
|
||||
accessTokenTrustedIps,
|
||||
lockoutEnabled,
|
||||
lockoutThreshold,
|
||||
lockoutDuration,
|
||||
lockoutCounterReset
|
||||
lockoutDurationSeconds,
|
||||
lockoutCounterResetSeconds
|
||||
}) => {
|
||||
const { data } = await apiRequest.patch<{ identityLdapAuth: IdentityLdapAuth }>(
|
||||
`/api/v1/auth/ldap-auth/identities/${identityId}`,
|
||||
@@ -1513,8 +1513,8 @@ export const useUpdateIdentityLdapAuth = () => {
|
||||
accessTokenTrustedIps,
|
||||
lockoutEnabled,
|
||||
lockoutThreshold,
|
||||
lockoutDuration,
|
||||
lockoutCounterReset
|
||||
lockoutDurationSeconds,
|
||||
lockoutCounterResetSeconds
|
||||
}
|
||||
);
|
||||
return data.identityLdapAuth;
|
||||
|
||||
@@ -606,8 +606,8 @@ export type AddIdentityLdapAuthDTO = {
|
||||
|
||||
lockoutEnabled: boolean;
|
||||
lockoutThreshold: number;
|
||||
lockoutDuration: number;
|
||||
lockoutCounterReset: number;
|
||||
lockoutDurationSeconds: number;
|
||||
lockoutCounterResetSeconds: number;
|
||||
};
|
||||
|
||||
export type UpdateIdentityLdapAuthDTO = {
|
||||
@@ -633,8 +633,8 @@ export type UpdateIdentityLdapAuthDTO = {
|
||||
|
||||
lockoutEnabled?: boolean;
|
||||
lockoutThreshold?: number;
|
||||
lockoutDuration?: number;
|
||||
lockoutCounterReset?: number;
|
||||
lockoutDurationSeconds?: number;
|
||||
lockoutCounterResetSeconds?: number;
|
||||
};
|
||||
|
||||
export type DeleteIdentityLdapAuthDTO = {
|
||||
@@ -663,8 +663,8 @@ export type IdentityLdapAuth = {
|
||||
|
||||
lockoutEnabled: boolean;
|
||||
lockoutThreshold: number;
|
||||
lockoutDuration: number;
|
||||
lockoutCounterReset: number;
|
||||
lockoutDurationSeconds: number;
|
||||
lockoutCounterResetSeconds: number;
|
||||
};
|
||||
|
||||
export type ClearIdentityLdapAuthLockoutsDTO = {
|
||||
|
||||
+9
-6
@@ -245,8 +245,8 @@ export const IdentityLdapAuthForm = ({
|
||||
if (data) {
|
||||
const detectedScope = determineScope(data);
|
||||
|
||||
const lockoutDurationObj = getObjectFromSeconds(data.lockoutDuration);
|
||||
const lockoutCounterResetObj = getObjectFromSeconds(data.lockoutCounterReset);
|
||||
const lockoutDurationObj = getObjectFromSeconds(data.lockoutDurationSeconds);
|
||||
const lockoutCounterResetObj = getObjectFromSeconds(data.lockoutCounterResetSeconds);
|
||||
|
||||
reset({
|
||||
scope: detectedScope,
|
||||
@@ -334,8 +334,11 @@ export const IdentityLdapAuthForm = ({
|
||||
lockoutCounterResetUnit
|
||||
} = formData;
|
||||
|
||||
const lockoutDuration = durationToSeconds(Number(lockoutDurationValue), lockoutDurationUnit);
|
||||
const lockoutCounterReset = durationToSeconds(
|
||||
const lockoutDurationSeconds = durationToSeconds(
|
||||
Number(lockoutDurationValue),
|
||||
lockoutDurationUnit
|
||||
);
|
||||
const lockoutCounterResetSeconds = durationToSeconds(
|
||||
Number(lockoutCounterResetValue),
|
||||
lockoutCounterResetUnit
|
||||
);
|
||||
@@ -352,8 +355,8 @@ export const IdentityLdapAuthForm = ({
|
||||
accessTokenTrustedIps,
|
||||
lockoutEnabled,
|
||||
lockoutThreshold: Number(lockoutThreshold),
|
||||
lockoutDuration,
|
||||
lockoutCounterReset
|
||||
lockoutDurationSeconds,
|
||||
lockoutCounterResetSeconds
|
||||
};
|
||||
|
||||
// Add scope-specific fields
|
||||
|
||||
+5
-4
@@ -1,5 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { UseMutationResult } from "@tanstack/react-query";
|
||||
import ms from "ms";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { OrgPermissionCan } from "@app/components/permissions";
|
||||
@@ -20,8 +21,8 @@ export const LockoutFields = ({
|
||||
data: {
|
||||
lockoutEnabled: boolean;
|
||||
lockoutThreshold: number;
|
||||
lockoutDuration: number;
|
||||
lockoutCounterReset: number;
|
||||
lockoutDurationSeconds: number;
|
||||
lockoutCounterResetSeconds: number;
|
||||
};
|
||||
}) => {
|
||||
const { mutateAsync, isPending } = clearLockoutsResult;
|
||||
@@ -70,10 +71,10 @@ export const LockoutFields = ({
|
||||
{data.lockoutThreshold}
|
||||
</IdentityAuthFieldDisplay>
|
||||
<IdentityAuthFieldDisplay label="Lockout Duration">
|
||||
{data.lockoutDuration} seconds
|
||||
{ms(data.lockoutDurationSeconds * 1000, { long: true })}
|
||||
</IdentityAuthFieldDisplay>
|
||||
<IdentityAuthFieldDisplay label="Lockout Counter Reset">
|
||||
{data.lockoutCounterReset} seconds
|
||||
{ms(data.lockoutCounterResetSeconds * 1000, { long: true })}
|
||||
</IdentityAuthFieldDisplay>
|
||||
</>
|
||||
);
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
import { faBan, faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import ms from "ms";
|
||||
|
||||
import { EmptyState, IconButton, Spinner, Tooltip } from "@app/components/v2";
|
||||
import { useTimedReset } from "@app/hooks";
|
||||
|
||||
Reference in New Issue
Block a user