mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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)
|
||||
}),
|
||||
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),
|
||||
secretPath: z
|
||||
.string()
|
||||
@@ -54,7 +54,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const { secretName } = req.params;
|
||||
const { secretPath, environment, workspaceId: projectId } = req.query;
|
||||
const { secretPath, environment, projectId } = req.query;
|
||||
|
||||
return server.services.secret.getSecretAccessList({
|
||||
actorId: req.permission.id,
|
||||
|
||||
@@ -1049,7 +1049,7 @@ export const RAW_SECRETS = {
|
||||
},
|
||||
GET_ACCESS_LIST: {
|
||||
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.",
|
||||
secretPath: "The folder path where the secret is located."
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ export const expandSecretReferencesFactory = ({
|
||||
};
|
||||
|
||||
export const reshapeBridgeSecret = (
|
||||
workspaceId: string,
|
||||
projectId: string,
|
||||
environment: string,
|
||||
secretPath: string,
|
||||
secret: Omit<TSecretsV2, "encryptedValue" | "encryptedComment"> & {
|
||||
@@ -809,7 +809,8 @@ export const reshapeBridgeSecret = (
|
||||
) => ({
|
||||
secretKey: secret.key,
|
||||
secretPath,
|
||||
workspace: workspaceId,
|
||||
workspace: projectId,
|
||||
projectId: projectId,
|
||||
environment,
|
||||
secretComment: secret.comment || "",
|
||||
version: secret.version,
|
||||
|
||||
@@ -94,6 +94,7 @@ export const getWebhookPayload = (event: TWebhookPayloads) => {
|
||||
event: event.type,
|
||||
project: {
|
||||
workspaceId: projectId,
|
||||
projectId,
|
||||
projectName,
|
||||
environment,
|
||||
secretPath
|
||||
@@ -147,6 +148,7 @@ export const getWebhookPayload = (event: TWebhookPayloads) => {
|
||||
event: event.type,
|
||||
project: {
|
||||
workspaceId: projectId,
|
||||
projectId: projectId,
|
||||
projectName,
|
||||
environment,
|
||||
secretPath,
|
||||
|
||||
@@ -47,7 +47,8 @@ import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProject,
|
||||
useProjectPermission
|
||||
useProjectPermission,
|
||||
useSubscription
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { getProjectBaseURL } from "@app/helpers/project";
|
||||
@@ -252,11 +253,12 @@ export const SecretDetailSidebar = ({
|
||||
secretId: secret?.id
|
||||
});
|
||||
|
||||
const { subscription } = useSubscription();
|
||||
const { data: secretAccessList, isPending } = useGetSecretAccessList({
|
||||
projectId: currentProject.id,
|
||||
environment,
|
||||
secretPath,
|
||||
secretKey
|
||||
secretKey: subscription?.secretAccessInsights ? secretKey : ""
|
||||
});
|
||||
|
||||
const handleTagSelect = (tag: WsTag) => {
|
||||
|
||||
Reference in New Issue
Block a user