mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 21:28:27 +00:00
misc: addressed comments
This commit is contained in:
@@ -4,7 +4,7 @@ import { RelaysSchema } from "@app/db/schemas";
|
|||||||
import { getConfig } from "@app/lib/config/env";
|
import { getConfig } from "@app/lib/config/env";
|
||||||
import { crypto } from "@app/lib/crypto/cryptography";
|
import { crypto } from "@app/lib/crypto/cryptography";
|
||||||
import { UnauthorizedError } from "@app/lib/errors";
|
import { UnauthorizedError } from "@app/lib/errors";
|
||||||
import { writeLimit } from "@app/server/config/rateLimiter";
|
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||||
import { slugSchema } from "@app/server/lib/schemas";
|
import { slugSchema } from "@app/server/lib/schemas";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
@@ -107,6 +107,9 @@ export const registerRelayRouter = async (server: FastifyZodProvider) => {
|
|||||||
200: RelaysSchema.array()
|
200: RelaysSchema.array()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
config: {
|
||||||
|
rateLimit: readLimit
|
||||||
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
return server.services.relay.getRelays({
|
return server.services.relay.getRelays({
|
||||||
|
|||||||
@@ -1083,7 +1083,7 @@ export const relayServiceFactory = ({
|
|||||||
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionRelayActions.DeleteRelays, OrgPermissionSubjects.Relay);
|
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionRelayActions.DeleteRelays, OrgPermissionSubjects.Relay);
|
||||||
|
|
||||||
const relay = await relayDAL.findById(id);
|
const relay = await relayDAL.findById(id);
|
||||||
if (!relay || relay.orgId !== actorOrgId) {
|
if (!relay || relay.orgId !== actorOrgId || relay.orgId === null) {
|
||||||
throw new NotFoundError({ message: "Relay not found" });
|
throw new NotFoundError({ message: "Relay not found" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -163,7 +163,7 @@ export const OrgRelayPermissionRow = ({ isEditable, control, setValue }: Props)
|
|||||||
}
|
}
|
||||||
field.onChange(e);
|
field.onChange(e);
|
||||||
}}
|
}}
|
||||||
id={`permissions.relays.${action}`}
|
id={`permissions.relay.${action}`}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
|||||||
Reference in New Issue
Block a user