mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
Merge remote-tracking branch 'origin' into stv3-org-roles
This commit is contained in:
@@ -204,20 +204,16 @@ export const login2 = async (req: Request, res: Response) => {
|
|||||||
* @param res
|
* @param res
|
||||||
*/
|
*/
|
||||||
export const sendMfaToken = async (req: Request, res: Response) => {
|
export const sendMfaToken = async (req: Request, res: Response) => {
|
||||||
const {
|
|
||||||
body: { email }
|
|
||||||
} = await validateRequest(reqValidator.SendMfaTokenV2, req);
|
|
||||||
|
|
||||||
const code = await TokenService.createToken({
|
const code = await TokenService.createToken({
|
||||||
type: TOKEN_EMAIL_MFA,
|
type: TOKEN_EMAIL_MFA,
|
||||||
email
|
email: req.user.email
|
||||||
});
|
});
|
||||||
|
|
||||||
// send MFA code [code] to [email]
|
// send MFA code [code] to [email]
|
||||||
await sendMail({
|
await sendMail({
|
||||||
template: "emailMfa.handlebars",
|
template: "emailMfa.handlebars",
|
||||||
subjectLine: "Infisical MFA code",
|
subjectLine: "Infisical MFA code",
|
||||||
recipients: [email],
|
recipients: [req.user.email],
|
||||||
substitutions: {
|
substitutions: {
|
||||||
code
|
code
|
||||||
}
|
}
|
||||||
@@ -236,17 +232,17 @@ export const sendMfaToken = async (req: Request, res: Response) => {
|
|||||||
*/
|
*/
|
||||||
export const verifyMfaToken = async (req: Request, res: Response) => {
|
export const verifyMfaToken = async (req: Request, res: Response) => {
|
||||||
const {
|
const {
|
||||||
body: { email, mfaToken }
|
body: { mfaToken }
|
||||||
} = await validateRequest(reqValidator.VerifyMfaTokenV2, req);
|
} = await validateRequest(reqValidator.VerifyMfaTokenV2, req);
|
||||||
|
|
||||||
await TokenService.validateToken({
|
await TokenService.validateToken({
|
||||||
type: TOKEN_EMAIL_MFA,
|
type: TOKEN_EMAIL_MFA,
|
||||||
email,
|
email: req.user.email,
|
||||||
token: mfaToken
|
token: mfaToken
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = await User.findOne({
|
const user = await User.findOne({
|
||||||
email
|
email: req.user.email
|
||||||
}).select(
|
}).select(
|
||||||
"+salt +verifier +encryptionVersion +protectedKey +protectedKeyIV +protectedKeyTag +publicKey +encryptedPrivateKey +iv +tag +devices"
|
"+salt +verifier +encryptionVersion +protectedKey +protectedKeyIV +protectedKeyTag +publicKey +encryptedPrivateKey +iv +tag +devices"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ router.post(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//remove above ones after depreciation
|
//remove above ones after depreciation
|
||||||
router.post("/mfa/send", authLimiter, authController.sendMfaToken);
|
router.post("/mfa/send", authLimiter, requireMfaAuth, authController.sendMfaToken);
|
||||||
|
|
||||||
router.post("/mfa/verify", authLimiter, requireMfaAuth, authController.verifyMfaToken);
|
router.post("/mfa/verify", authLimiter, requireMfaAuth, authController.verifyMfaToken);
|
||||||
|
|
||||||
|
|||||||
@@ -84,15 +84,8 @@ export const ResetPasswordV1 = z.object({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
export const SendMfaTokenV2 = z.object({
|
|
||||||
body: z.object({
|
|
||||||
email: z.string().email().trim()
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
export const VerifyMfaTokenV2 = z.object({
|
export const VerifyMfaTokenV2 = z.object({
|
||||||
body: z.object({
|
body: z.object({
|
||||||
email: z.string().email().trim(),
|
|
||||||
mfaToken: z.string().trim()
|
mfaToken: z.string().trim()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ var agentCmd = &cobra.Command{
|
|||||||
infisical agent
|
infisical agent
|
||||||
`,
|
`,
|
||||||
Use: "agent",
|
Use: "agent",
|
||||||
Short: "agent",
|
Short: "Used to launch a client daemon that streamlines authentication and secret retrieval processes in some environments",
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
|
|||||||
@@ -689,12 +689,12 @@ func init() {
|
|||||||
|
|
||||||
// Add createCmd flags here
|
// Add createCmd flags here
|
||||||
createCmd.Flags().StringP("path", "p", "/", "Path to where the folder should be created")
|
createCmd.Flags().StringP("path", "p", "/", "Path to where the folder should be created")
|
||||||
createCmd.Flags().StringP("name", "n", "", "Name of the folder to be created")
|
createCmd.Flags().StringP("name", "n", "", "Name of the folder to be created in selected `--path`")
|
||||||
folderCmd.AddCommand(createCmd)
|
folderCmd.AddCommand(createCmd)
|
||||||
|
|
||||||
// Add deleteCmd flags here
|
// Add deleteCmd flags here
|
||||||
deleteCmd.Flags().StringP("path", "p", "/", "Path to the folder to be deleted")
|
deleteCmd.Flags().StringP("path", "p", "/", "Path to the folder to be deleted")
|
||||||
deleteCmd.Flags().StringP("name", "n", "", "Name of the folder to be deleted")
|
deleteCmd.Flags().StringP("name", "n", "", "Name of the folder to be deleted within selected `--path`")
|
||||||
folderCmd.AddCommand(deleteCmd)
|
folderCmd.AddCommand(deleteCmd)
|
||||||
|
|
||||||
secretsCmd.AddCommand(folderCmd)
|
secretsCmd.AddCommand(folderCmd)
|
||||||
|
|||||||
@@ -134,6 +134,73 @@ $ infisical secrets set STRIPE_API_KEY=sjdgwkeudyjwe DOMAIN=example.com HASH=jeb
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="infisical secrets folders">
|
||||||
|
This command allows you to fetch, create and delete folders from within a path from a given project.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ infisical secrets folders
|
||||||
|
```
|
||||||
|
|
||||||
|
### sub commands
|
||||||
|
<Accordion title="get">
|
||||||
|
Used to fetch all folders within a path in a given project
|
||||||
|
```
|
||||||
|
infisical secrets folders get --path=/some/path/to/folder
|
||||||
|
```
|
||||||
|
#### Flags
|
||||||
|
<Accordion title="--path">
|
||||||
|
The path from where folders should be fetched from
|
||||||
|
|
||||||
|
Default value: `/`
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="--token">
|
||||||
|
Fetch folders using the Infisical service token
|
||||||
|
|
||||||
|
Default value: ``
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="create">
|
||||||
|
Used to create a folder by name within a path.
|
||||||
|
```
|
||||||
|
infisical secrets folders create --path=/some/path/to/folder --name=folder-name
|
||||||
|
```
|
||||||
|
### Flags
|
||||||
|
<Accordion title="--path">
|
||||||
|
Path to where the folder should be created
|
||||||
|
|
||||||
|
Default value: `/`
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="--name">
|
||||||
|
Name of the folder to be created in selected `--path`
|
||||||
|
|
||||||
|
Default value: ``
|
||||||
|
</Accordion>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="delete">
|
||||||
|
Used to delete a folder by name within a path.
|
||||||
|
```
|
||||||
|
infisical secrets folders delete --path=/some/path/to/folder --name=folder-name
|
||||||
|
```
|
||||||
|
### Flags
|
||||||
|
<Accordion title="--path">
|
||||||
|
Path to where the folder should be created
|
||||||
|
|
||||||
|
Default value: `/`
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="--name">
|
||||||
|
Name of the folder to be deleted within selected `--path`
|
||||||
|
|
||||||
|
Default value: ``
|
||||||
|
</Accordion>
|
||||||
|
</Accordion>
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="infisical secrets generate-example-env">
|
<Accordion title="infisical secrets generate-example-env">
|
||||||
This command allows you to generate an example .env file from your secrets and with their associated comments and tags. This is useful when you would like to let
|
This command allows you to generate an example .env file from your secrets and with their associated comments and tags. This is useful when you would like to let
|
||||||
others who work on the project but do not use Infisical become aware of the required environment variables and their intended values.
|
others who work on the project but do not use Infisical become aware of the required environment variables and their intended values.
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import {
|
|||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api";
|
||||||
|
|
||||||
import { FolderBreadCrumbs } from "./components/FolderBreadCrumbs";
|
import { FolderBreadCrumbs } from "./components/FolderBreadCrumbs";
|
||||||
import { ProjectIndexSecretsSection } from "./components/ProjectIndexSecretsSection";
|
// import { ProjectIndexSecretsSection } from "./components/ProjectIndexSecretsSection";
|
||||||
import { SecretOverviewFolderRow } from "./components/SecretOverviewFolderRow";
|
import { SecretOverviewFolderRow } from "./components/SecretOverviewFolderRow";
|
||||||
import { SecretOverviewTableRow } from "./components/SecretOverviewTableRow";
|
import { SecretOverviewTableRow } from "./components/SecretOverviewTableRow";
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ export const SecretOverviewPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto px-6 text-mineshaft-50 dark:[color-scheme:dark]">
|
<div className="container mx-auto px-6 text-mineshaft-50 dark:[color-scheme:dark]">
|
||||||
<ProjectIndexSecretsSection decryptFileKey={latestFileKey!} />
|
{/* <ProjectIndexSecretsSection decryptFileKey={latestFileKey!} /> */}
|
||||||
<div className="relative right-5 ml-4">
|
<div className="relative right-5 ml-4">
|
||||||
<NavHeader pageName={t("dashboard.title")} isProjectRelated />
|
<NavHeader pageName={t("dashboard.title")} isProjectRelated />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user