mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 20:26:17 +00:00
misc: addressed review comments
This commit is contained in:
@@ -249,7 +249,11 @@ export const DynamicSecretTotpSchema = z.discriminatedUnion("configType", [
|
|||||||
}),
|
}),
|
||||||
z.object({
|
z.object({
|
||||||
configType: z.literal(TotpConfigType.MANUAL),
|
configType: z.literal(TotpConfigType.MANUAL),
|
||||||
secret: z.string().min(1),
|
secret: z
|
||||||
|
.string()
|
||||||
|
.trim()
|
||||||
|
.min(1)
|
||||||
|
.transform((val) => val.replace(/\s+/g, "")),
|
||||||
period: z.number().optional(),
|
period: z.number().optional(),
|
||||||
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
||||||
digits: z.number().optional()
|
digits: z.number().optional()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ The Infisical TOTP dynamic secret allows you to generate time-based one-time pas
|
|||||||
|
|
||||||
## Prerequisite
|
## Prerequisite
|
||||||
|
|
||||||
- Infisical requires the OTP url from the TOTP provider.
|
- Infisical requires either the OTP url or the secret key from the TOTP provider.
|
||||||
|
|
||||||
## Set up Dynamic Secrets with TOTP
|
## Set up Dynamic Secrets with TOTP
|
||||||
|
|
||||||
@@ -41,10 +41,10 @@ The Infisical TOTP dynamic secret allows you to generate time-based one-time pas
|
|||||||
<ParamField path="Period" type="number">
|
<ParamField path="Period" type="number">
|
||||||
Time interval in seconds between generating new TOTP codes.
|
Time interval in seconds between generating new TOTP codes.
|
||||||
</ParamField>
|
</ParamField>
|
||||||
<ParamField path="Digits" type="number" required>
|
<ParamField path="Digits" type="number">
|
||||||
Number of digits to generate in each TOTP code.
|
Number of digits to generate in each TOTP code.
|
||||||
</ParamField>
|
</ParamField>
|
||||||
<ParamField path="Algorithm" type="string" required>
|
<ParamField path="Algorithm" type="string">
|
||||||
Hash algorithm to use when generating TOTP codes. The supported algorithms are sha1, sha256, and sha512.
|
Hash algorithm to use when generating TOTP codes. The supported algorithms are sha1, sha256, and sha512.
|
||||||
</ParamField>
|
</ParamField>
|
||||||
|
|
||||||
@@ -58,33 +58,13 @@ The Infisical TOTP dynamic secret allows you to generate time-based one-time pas
|
|||||||
</Step>
|
</Step>
|
||||||
<Step title="Generate dynamic secrets">
|
<Step title="Generate dynamic secrets">
|
||||||
Once you've successfully configured the dynamic secret, you're ready to generate on-demand TOTPs.
|
Once you've successfully configured the dynamic secret, you're ready to generate on-demand TOTPs.
|
||||||
To do this, simply click on the 'Generate' button which appears when hovering over the dynamic secret item.
|
To do this, simply click on the 'Generate' button which appears when hovering over the dynamic secret item.
|
||||||
Alternatively, you can initiate the creation of a new lease by selecting 'New Lease' from the dynamic secret lease list section.
|
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||
|
|
||||||
|
Once you click the `Generate` button, a new secret lease will be generated and the TOTP will be shown to you.
|
||||||
Once you click the `Generate` or the `New Lease` button, a new secret lease will be generated and the TOTP will be shown to you.
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
</Step>
|
</Step>
|
||||||
</Steps>
|
</Steps>
|
||||||
|
|
||||||
## Audit or Revoke Leases
|
|
||||||
|
|
||||||
Once you have created one or more leases, you will be able to access them by clicking on the respective dynamic secret item on the dashboard.
|
|
||||||
This will allow you to see the lease details and delete the lease ahead of its expiration time.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Renew Leases
|
|
||||||
|
|
||||||
To extend the life of the generated dynamic secret lease past its initial time to live, simply click on the **Renew** button as illustrated below.
|
|
||||||

|
|
||||||
|
|
||||||
<Warning>
|
|
||||||
Lease renewals cannot exceed the maximum TTL set when configuring the dynamic
|
|
||||||
secret.
|
|
||||||
</Warning>
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 464 KiB |
+10
-2
@@ -39,7 +39,11 @@ const formSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
z.object({
|
z.object({
|
||||||
configType: z.literal(ConfigType.MANUAL),
|
configType: z.literal(ConfigType.MANUAL),
|
||||||
secret: z.string().min(1),
|
secret: z
|
||||||
|
.string()
|
||||||
|
.trim()
|
||||||
|
.min(1)
|
||||||
|
.transform((val) => val.replace(/\s+/g, "")),
|
||||||
period: z.number().optional(),
|
period: z.number().optional(),
|
||||||
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
||||||
digits: z.number().optional()
|
digits: z.number().optional()
|
||||||
@@ -214,7 +218,7 @@ export const TotpInputForm = ({
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row gap-2">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="provider.period"
|
name="provider.period"
|
||||||
@@ -287,6 +291,10 @@ export const TotpInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="mb-8 text-sm font-normal text-gray-400">
|
||||||
|
The period, digits, and algorithm values can remain at their defaults unless
|
||||||
|
your TOTP provider specifies otherwise.
|
||||||
|
</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+10
@@ -101,10 +101,20 @@ export const DynamicSecretListView = ({
|
|||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onKeyDown={(evt) => {
|
onKeyDown={(evt) => {
|
||||||
|
// no lease view for TOTP because it's irrelevant
|
||||||
|
if (secret.type === DynamicSecretProviders.Totp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (evt.key === "Enter" && !isRevoking)
|
if (evt.key === "Enter" && !isRevoking)
|
||||||
handlePopUpOpen("dynamicSecretLeases", secret.id);
|
handlePopUpOpen("dynamicSecretLeases", secret.id);
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
// no lease view for TOTP because it's irrelevant
|
||||||
|
if (secret.type === DynamicSecretProviders.Totp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isRevoking) {
|
if (!isRevoking) {
|
||||||
handlePopUpOpen("dynamicSecretLeases", secret.id);
|
handlePopUpOpen("dynamicSecretLeases", secret.id);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -40,7 +40,11 @@ const formSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
z.object({
|
z.object({
|
||||||
configType: z.literal(ConfigType.MANUAL),
|
configType: z.literal(ConfigType.MANUAL),
|
||||||
secret: z.string().min(1),
|
secret: z
|
||||||
|
.string()
|
||||||
|
.trim()
|
||||||
|
.min(1)
|
||||||
|
.transform((val) => val.replace(/\s+/g, "")),
|
||||||
period: z.number().optional(),
|
period: z.number().optional(),
|
||||||
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
|
||||||
digits: z.number().optional()
|
digits: z.number().optional()
|
||||||
@@ -218,7 +222,7 @@ export const EditDynamicSecretTotpForm = ({
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row gap-2">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="inputs.period"
|
name="inputs.period"
|
||||||
|
|||||||
Reference in New Issue
Block a user