mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
Initialize TrustedIP upon creating a new workspace
This commit is contained in:
@@ -5,6 +5,10 @@ import {
|
|||||||
Secret,
|
Secret,
|
||||||
Workspace,
|
Workspace,
|
||||||
} from "../models";
|
} from "../models";
|
||||||
|
import {
|
||||||
|
IPType,
|
||||||
|
TrustedIP
|
||||||
|
} from "../ee/models";
|
||||||
import { createBot } from "../helpers/bot";
|
import { createBot } from "../helpers/bot";
|
||||||
import { EELicenseService } from "../ee/services";
|
import { EELicenseService } from "../ee/services";
|
||||||
import { SecretService } from "../services";
|
import { SecretService } from "../services";
|
||||||
@@ -40,6 +44,16 @@ export const createWorkspace = async ({
|
|||||||
await SecretService.createSecretBlindIndexData({
|
await SecretService.createSecretBlindIndexData({
|
||||||
workspaceId: workspace._id,
|
workspaceId: workspace._id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// initialize default trusted ip of 0.0.0.0/0
|
||||||
|
await new TrustedIP({
|
||||||
|
workspace: workspace._id,
|
||||||
|
ipAddress: "0.0.0.0",
|
||||||
|
type: IPType.IPV4,
|
||||||
|
prefix: 0,
|
||||||
|
isActive: true,
|
||||||
|
comment: ""
|
||||||
|
}).save()
|
||||||
|
|
||||||
await EELicenseService.refreshPlan(organizationId);
|
await EELicenseService.refreshPlan(organizationId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user