mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 07:26:45 +00:00
feat: updated by review comment
This commit is contained in:
@@ -2,6 +2,7 @@ import { ForbiddenError } from "@casl/ability";
|
|||||||
import { RawAxiosRequestHeaders } from "axios";
|
import { RawAxiosRequestHeaders } from "axios";
|
||||||
|
|
||||||
import { SecretKeyEncoding } from "@app/db/schemas";
|
import { SecretKeyEncoding } from "@app/db/schemas";
|
||||||
|
import { getConfig } from "@app/lib/config/env";
|
||||||
import { request } from "@app/lib/config/request";
|
import { request } from "@app/lib/config/request";
|
||||||
import { infisicalSymmetricDecrypt, infisicalSymmetricEncypt } from "@app/lib/crypto/encryption";
|
import { infisicalSymmetricDecrypt, infisicalSymmetricEncypt } from "@app/lib/crypto/encryption";
|
||||||
import { BadRequestError, NotFoundError, UnauthorizedError } from "@app/lib/errors";
|
import { BadRequestError, NotFoundError, UnauthorizedError } from "@app/lib/errors";
|
||||||
@@ -60,7 +61,8 @@ export const auditLogStreamServiceFactory = ({
|
|||||||
);
|
);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Settings);
|
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Settings);
|
||||||
|
|
||||||
await blockLocalAndPrivateIpAddresses(url);
|
const appCfg = getConfig();
|
||||||
|
if (appCfg.isCloud) await blockLocalAndPrivateIpAddresses(url);
|
||||||
|
|
||||||
const totalStreams = await auditLogStreamDAL.find({ orgId: actorOrgId });
|
const totalStreams = await auditLogStreamDAL.find({ orgId: actorOrgId });
|
||||||
if (totalStreams.length >= plan.auditLogStreamLimit) {
|
if (totalStreams.length >= plan.auditLogStreamLimit) {
|
||||||
@@ -131,8 +133,8 @@ export const auditLogStreamServiceFactory = ({
|
|||||||
const { orgId } = logStream;
|
const { orgId } = logStream;
|
||||||
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
|
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);
|
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);
|
||||||
|
const appCfg = getConfig();
|
||||||
if (url) await blockLocalAndPrivateIpAddresses(url);
|
if (url && appCfg.isCloud) await blockLocalAndPrivateIpAddresses(url);
|
||||||
|
|
||||||
// testing connection first
|
// testing connection first
|
||||||
const streamHeaders: RawAxiosRequestHeaders = { "Content-Type": "application/json" };
|
const streamHeaders: RawAxiosRequestHeaders = { "Content-Type": "application/json" };
|
||||||
|
|||||||
@@ -3578,7 +3578,7 @@ const syncSecretsTeamCity = async ({
|
|||||||
.filter((parameter) => !parameter.inherited)
|
.filter((parameter) => !parameter.inherited)
|
||||||
.reduce(
|
.reduce(
|
||||||
(obj, secret) => {
|
(obj, secret) => {
|
||||||
const secretName = secret.name.replace("env.", "");
|
const secretName = secret.name.startsWith(".env") ? secret.name.slice(4) : secret.name;
|
||||||
return {
|
return {
|
||||||
...obj,
|
...obj,
|
||||||
[secretName]: secret.value
|
[secretName]: secret.value
|
||||||
@@ -3635,7 +3635,7 @@ const syncSecretsTeamCity = async ({
|
|||||||
)
|
)
|
||||||
).data.property.reduce(
|
).data.property.reduce(
|
||||||
(obj, secret) => {
|
(obj, secret) => {
|
||||||
const secretName = secret.name.replace("env.", "");
|
const secretName = secret.name.startsWith("env.") ? secret.name.slice(4) : secret.name;
|
||||||
return {
|
return {
|
||||||
...obj,
|
...obj,
|
||||||
[secretName]: secret.value
|
[secretName]: secret.value
|
||||||
|
|||||||
Reference in New Issue
Block a user