mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
feat(secret-sync): add blockLocalAndPrivateIpAddresses on secret-sync fns functions
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { request } from "@app/lib/config/request";
|
import { request } from "@app/lib/config/request";
|
||||||
|
import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";
|
||||||
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
|
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
|
||||||
import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
|
import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
|
||||||
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
|
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
|
||||||
@@ -184,6 +185,8 @@ export const ZabbixSyncFns = {
|
|||||||
syncSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => {
|
syncSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => {
|
||||||
const { connection, environment, destinationConfig } = secretSync;
|
const { connection, environment, destinationConfig } = secretSync;
|
||||||
const { apiToken, instanceUrl } = connection.credentials;
|
const { apiToken, instanceUrl } = connection.credentials;
|
||||||
|
await blockLocalAndPrivateIpAddresses(instanceUrl);
|
||||||
|
|
||||||
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
||||||
let secrets: TZabbixSecret[] = [];
|
let secrets: TZabbixSecret[] = [];
|
||||||
try {
|
try {
|
||||||
@@ -226,6 +229,8 @@ export const ZabbixSyncFns = {
|
|||||||
removeSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => {
|
removeSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => {
|
||||||
const { connection, destinationConfig } = secretSync;
|
const { connection, destinationConfig } = secretSync;
|
||||||
const { apiToken, instanceUrl } = connection.credentials;
|
const { apiToken, instanceUrl } = connection.credentials;
|
||||||
|
await blockLocalAndPrivateIpAddresses(instanceUrl);
|
||||||
|
|
||||||
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -247,6 +252,7 @@ export const ZabbixSyncFns = {
|
|||||||
getSecrets: async (secretSync: TZabbixSyncWithCredentials) => {
|
getSecrets: async (secretSync: TZabbixSyncWithCredentials) => {
|
||||||
const { connection, destinationConfig } = secretSync;
|
const { connection, destinationConfig } = secretSync;
|
||||||
const { apiToken, instanceUrl } = connection.credentials;
|
const { apiToken, instanceUrl } = connection.credentials;
|
||||||
|
await blockLocalAndPrivateIpAddresses(instanceUrl);
|
||||||
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user