mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 12:28:56 +00:00
Fix merge conflicts
This commit is contained in:
@@ -53,13 +53,13 @@ const identityAccessTokenSchema = new Schema(
|
|||||||
accessTokenTTL: { // seconds
|
accessTokenTTL: { // seconds
|
||||||
// incremental lifetime
|
// incremental lifetime
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 7200,
|
default: 2592000, // 30 days
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
accessTokenMaxTTL: { // seconds
|
accessTokenMaxTTL: { // seconds
|
||||||
// max lifetime
|
// max lifetime
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 7200,
|
default: 2592000, // 30 days
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
accessTokenTrustedIps: {
|
accessTokenTrustedIps: {
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ export const AddUniversalAuthToIdentityV1 = z.object({
|
|||||||
.min(1)
|
.min(1)
|
||||||
.default([{ ipAddress: "0.0.0.0/0" }]),
|
.default([{ ipAddress: "0.0.0.0/0" }]),
|
||||||
accessTokenTTL: z.number().int().min(0).default(7200),
|
accessTokenTTL: z.number().int().min(0).default(7200),
|
||||||
accessTokenMaxTTL: z.number().int().min(0).default(2592000),
|
accessTokenMaxTTL: z.number().int().refine(value => value !== 0, {
|
||||||
|
message: "accessTokenMaxTTL must have a non zero number",
|
||||||
|
}).default(2592000), // 30 days
|
||||||
accessTokenNumUsesLimit: z.number().int().min(0).default(0)
|
accessTokenNumUsesLimit: z.number().int().min(0).default(0)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -143,7 +145,9 @@ export const UpdateUniversalAuthToIdentityV1 = z.object({
|
|||||||
.optional(),
|
.optional(),
|
||||||
accessTokenTTL: z.number().int().min(0).optional(),
|
accessTokenTTL: z.number().int().min(0).optional(),
|
||||||
accessTokenNumUsesLimit: z.number().int().min(0).optional(),
|
accessTokenNumUsesLimit: z.number().int().min(0).optional(),
|
||||||
accessTokenMaxTTL: z.number().int().min(0).optional(),
|
accessTokenMaxTTL: z.number().int().refine(value => value !== 0, {
|
||||||
|
message: "accessTokenMaxTTL must have a non zero number",
|
||||||
|
}).optional(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,8 @@ func init() {
|
|||||||
func executeSingleCommandWithEnvs(args []string, secretsCount int, env []string) error {
|
func executeSingleCommandWithEnvs(args []string, secretsCount int, env []string) error {
|
||||||
command := args[0]
|
command := args[0]
|
||||||
argsForCommand := args[1:]
|
argsForCommand := args[1:]
|
||||||
color.Green("Injecting %v Infisical secrets into your application process", secretsCount)
|
|
||||||
|
log.Info().Msgf(color.GreenString("Injecting %v Infisical secrets into your application process", secretsCount))
|
||||||
|
|
||||||
cmd := exec.Command(command, argsForCommand...)
|
cmd := exec.Command(command, argsForCommand...)
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
@@ -232,7 +233,7 @@ func executeMultipleCommandWithEnvs(fullCommand string, secretsCount int, env []
|
|||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Env = env
|
cmd.Env = env
|
||||||
|
|
||||||
color.Green("Injecting %v Infisical secrets into your application process", secretsCount)
|
log.Info().Msgf(color.GreenString("Injecting %v Infisical secrets into your application process", secretsCount))
|
||||||
log.Debug().Msgf("executing command: %s %s %s \n", shell[0], shell[1], fullCommand)
|
log.Debug().Msgf("executing command: %s %s %s \n", shell[0], shell[1], fullCommand)
|
||||||
|
|
||||||
return execCmd(cmd)
|
return execCmd(cmd)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@@ -21,16 +20,16 @@ func CheckForUpdate() {
|
|||||||
if checkEnv := os.Getenv("INFISICAL_DISABLE_UPDATE_CHECK"); checkEnv != "" {
|
if checkEnv := os.Getenv("INFISICAL_DISABLE_UPDATE_CHECK"); checkEnv != "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
latestVersion, publishedDate, err := getLatestTag("Infisical", "infisical")
|
latestVersion, _, err := getLatestTag("Infisical", "infisical")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug().Err(err)
|
log.Debug().Err(err)
|
||||||
// do nothing and continue
|
// do nothing and continue
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
daysSinceRelease, _ := daysSinceDate(publishedDate)
|
// daysSinceRelease, _ := daysSinceDate(publishedDate)
|
||||||
|
|
||||||
if latestVersion != CLI_VERSION && daysSinceRelease > 2 {
|
if latestVersion != CLI_VERSION {
|
||||||
yellow := color.New(color.FgYellow).SprintFunc()
|
yellow := color.New(color.FgYellow).SprintFunc()
|
||||||
blue := color.New(color.FgCyan).SprintFunc()
|
blue := color.New(color.FgCyan).SprintFunc()
|
||||||
black := color.New(color.FgBlack).SprintFunc()
|
black := color.New(color.FgBlack).SprintFunc()
|
||||||
@@ -151,15 +150,15 @@ func IsRunningInDocker() bool {
|
|||||||
return strings.Contains(string(cgroup), "docker")
|
return strings.Contains(string(cgroup), "docker")
|
||||||
}
|
}
|
||||||
|
|
||||||
func daysSinceDate(dateString string) (int, error) {
|
// func daysSinceDate(dateString string) (int, error) {
|
||||||
layout := "2006-01-02T15:04:05Z"
|
// layout := "2006-01-02T15:04:05Z"
|
||||||
parsedDate, err := time.Parse(layout, dateString)
|
// parsedDate, err := time.Parse(layout, dateString)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return 0, err
|
// return 0, err
|
||||||
}
|
// }
|
||||||
|
|
||||||
currentTime := time.Now()
|
// currentTime := time.Now()
|
||||||
difference := currentTime.Sub(parsedDate)
|
// difference := currentTime.Sub(parsedDate)
|
||||||
days := int(difference.Hours() / 24)
|
// days := int(difference.Hours() / 24)
|
||||||
return days, nil
|
// return days, nil
|
||||||
}
|
// }
|
||||||
|
|||||||
+6
-6
@@ -89,7 +89,7 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
resolver: yupResolver(schema),
|
resolver: yupResolver(schema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
accessTokenTTL: "7200",
|
accessTokenTTL: "7200",
|
||||||
accessTokenMaxTTL: "0",
|
accessTokenMaxTTL: "2592000",
|
||||||
accessTokenNumUsesLimit: "0",
|
accessTokenNumUsesLimit: "0",
|
||||||
clientSecretTrustedIps: [{
|
clientSecretTrustedIps: [{
|
||||||
ipAddress: "0.0.0.0/0"
|
ipAddress: "0.0.0.0/0"
|
||||||
@@ -112,7 +112,7 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
} = useFieldArray({ control, name: "accessTokenTrustedIps" });
|
} = useFieldArray({ control, name: "accessTokenTrustedIps" });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) { // TODO: fix data type
|
if (data) {
|
||||||
reset({
|
reset({
|
||||||
accessTokenTTL: String(data.accessTokenTTL),
|
accessTokenTTL: String(data.accessTokenTTL),
|
||||||
accessTokenMaxTTL: String(data.accessTokenMaxTTL),
|
accessTokenMaxTTL: String(data.accessTokenMaxTTL),
|
||||||
@@ -137,7 +137,7 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
} else {
|
} else {
|
||||||
reset({
|
reset({
|
||||||
accessTokenTTL: "7200",
|
accessTokenTTL: "7200",
|
||||||
accessTokenMaxTTL: "7200",
|
accessTokenMaxTTL: "2592000",
|
||||||
accessTokenNumUsesLimit: "0",
|
accessTokenNumUsesLimit: "0",
|
||||||
clientSecretTrustedIps: [{
|
clientSecretTrustedIps: [{
|
||||||
ipAddress: "0.0.0.0/0"
|
ipAddress: "0.0.0.0/0"
|
||||||
@@ -231,7 +231,7 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
/>
|
/>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue="7200"
|
defaultValue="2592000"
|
||||||
name="accessTokenMaxTTL"
|
name="accessTokenMaxTTL"
|
||||||
render={({ field, fieldState: { error } }) => (
|
render={({ field, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
@@ -241,9 +241,9 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
placeholder="7200"
|
placeholder="2592000"
|
||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="1"
|
||||||
step="1"
|
step="1"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user