mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 17:25:44 +00:00
feat: fixed access list broken in ui
This commit is contained in:
@@ -34,7 +34,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
|
|||||||
secretName: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.secretName)
|
secretName: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.secretName)
|
||||||
}),
|
}),
|
||||||
querystring: z.object({
|
querystring: z.object({
|
||||||
workspaceId: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.workspaceId),
|
projectId: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.projectId),
|
||||||
environment: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.environment),
|
environment: z.string().trim().describe(RAW_SECRETS.GET_ACCESS_LIST.environment),
|
||||||
secretPath: z
|
secretPath: z
|
||||||
.string()
|
.string()
|
||||||
@@ -54,7 +54,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
|
|||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
const { secretName } = req.params;
|
const { secretName } = req.params;
|
||||||
const { secretPath, environment, workspaceId: projectId } = req.query;
|
const { secretPath, environment, projectId } = req.query;
|
||||||
|
|
||||||
return server.services.secret.getSecretAccessList({
|
return server.services.secret.getSecretAccessList({
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
|
|||||||
@@ -1049,7 +1049,7 @@ export const RAW_SECRETS = {
|
|||||||
},
|
},
|
||||||
GET_ACCESS_LIST: {
|
GET_ACCESS_LIST: {
|
||||||
secretName: "The name of the secret to get the access list for.",
|
secretName: "The name of the secret to get the access list for.",
|
||||||
workspaceId: "The ID of the project where the secret is located.",
|
projectId: "The ID of the project where the secret is located.",
|
||||||
environment: "The slug of the environment where the the secret is located.",
|
environment: "The slug of the environment where the the secret is located.",
|
||||||
secretPath: "The folder path where the secret is located."
|
secretPath: "The folder path where the secret is located."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -782,7 +782,7 @@ export const expandSecretReferencesFactory = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const reshapeBridgeSecret = (
|
export const reshapeBridgeSecret = (
|
||||||
workspaceId: string,
|
projectId: string,
|
||||||
environment: string,
|
environment: string,
|
||||||
secretPath: string,
|
secretPath: string,
|
||||||
secret: Omit<TSecretsV2, "encryptedValue" | "encryptedComment"> & {
|
secret: Omit<TSecretsV2, "encryptedValue" | "encryptedComment"> & {
|
||||||
@@ -809,7 +809,8 @@ export const reshapeBridgeSecret = (
|
|||||||
) => ({
|
) => ({
|
||||||
secretKey: secret.key,
|
secretKey: secret.key,
|
||||||
secretPath,
|
secretPath,
|
||||||
workspace: workspaceId,
|
workspace: projectId,
|
||||||
|
projectId: projectId,
|
||||||
environment,
|
environment,
|
||||||
secretComment: secret.comment || "",
|
secretComment: secret.comment || "",
|
||||||
version: secret.version,
|
version: secret.version,
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export const getWebhookPayload = (event: TWebhookPayloads) => {
|
|||||||
event: event.type,
|
event: event.type,
|
||||||
project: {
|
project: {
|
||||||
workspaceId: projectId,
|
workspaceId: projectId,
|
||||||
|
projectId,
|
||||||
projectName,
|
projectName,
|
||||||
environment,
|
environment,
|
||||||
secretPath
|
secretPath
|
||||||
@@ -147,6 +148,7 @@ export const getWebhookPayload = (event: TWebhookPayloads) => {
|
|||||||
event: event.type,
|
event: event.type,
|
||||||
project: {
|
project: {
|
||||||
workspaceId: projectId,
|
workspaceId: projectId,
|
||||||
|
projectId: projectId,
|
||||||
projectName,
|
projectName,
|
||||||
environment,
|
environment,
|
||||||
secretPath,
|
secretPath,
|
||||||
|
|||||||
+4
-2
@@ -47,7 +47,8 @@ import {
|
|||||||
ProjectPermissionActions,
|
ProjectPermissionActions,
|
||||||
ProjectPermissionSub,
|
ProjectPermissionSub,
|
||||||
useProject,
|
useProject,
|
||||||
useProjectPermission
|
useProjectPermission,
|
||||||
|
useSubscription
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||||
import { getProjectBaseURL } from "@app/helpers/project";
|
import { getProjectBaseURL } from "@app/helpers/project";
|
||||||
@@ -252,11 +253,12 @@ export const SecretDetailSidebar = ({
|
|||||||
secretId: secret?.id
|
secretId: secret?.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { subscription } = useSubscription();
|
||||||
const { data: secretAccessList, isPending } = useGetSecretAccessList({
|
const { data: secretAccessList, isPending } = useGetSecretAccessList({
|
||||||
projectId: currentProject.id,
|
projectId: currentProject.id,
|
||||||
environment,
|
environment,
|
||||||
secretPath,
|
secretPath,
|
||||||
secretKey
|
secretKey: subscription?.secretAccessInsights ? secretKey : ""
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleTagSelect = (tag: WsTag) => {
|
const handleTagSelect = (tag: WsTag) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user