mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
improvements: address feedback
This commit is contained in:
@@ -135,6 +135,18 @@ Below is a comprehensive list of all available project-level subjects and their
|
||||
| `edit` | Modify token properties |
|
||||
| `delete` | Revoke or remove service tokens |
|
||||
|
||||
#### Subject: `app-connections`
|
||||
|
||||
Supports conditions and permission inversion
|
||||
|
||||
| Action | Description |
|
||||
| ------------------------- | ---------------------------------- |
|
||||
| `read-app-connections` | View app connection configurations |
|
||||
| `create-app-connections` | Create new app connections |
|
||||
| `edit-app-connections` | Modify existing app connections |
|
||||
| `delete-app-connections` | Remove app connections |
|
||||
| `connect-app-connections` | Use app connections |
|
||||
|
||||
### Secrets Management
|
||||
|
||||
#### Subject: `secrets`
|
||||
|
||||
@@ -107,7 +107,7 @@ export const SecretRotationV2ConnectionField = ({ onChange: callback, isUpdate }
|
||||
{!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
|
||||
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
|
||||
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
|
||||
You do not have access to any ${appName} Connections. Contact an admin to create one.
|
||||
You do not have access to any {appName} Connections. Contact an admin to create one.
|
||||
</p>
|
||||
)}
|
||||
<AddAppConnectionModal
|
||||
|
||||
@@ -108,7 +108,7 @@ export const SecretScanningDataSourceConnectionField = ({
|
||||
{!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
|
||||
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
|
||||
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
|
||||
You do not have access to any ${connectionName} Connections. Contact an admin to create
|
||||
You do not have access to any {connectionName} Connections. Contact an admin to create
|
||||
one.
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -91,7 +91,7 @@ export const SecretSyncConnectionField = ({ onChange: callback }: Props) => {
|
||||
{!isPending && !availableConnections?.length && !canCreateConnection && (
|
||||
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
|
||||
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
|
||||
You do not have access to any ${appName} Connections. Contact an admin to create one.
|
||||
You do not have access to any {appName} Connections. Contact an admin to create one.
|
||||
</p>
|
||||
)}
|
||||
<AddAppConnectionModal
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
TAppConnectionResponse,
|
||||
TCreateAppConnectionDTO,
|
||||
TDeleteAppConnectionDTO,
|
||||
TMigrateAppConnectionDTO,
|
||||
TUpdateAppConnectionDTO
|
||||
} from "@app/hooks/api/appConnections/types";
|
||||
|
||||
@@ -62,21 +61,3 @@ export const useDeleteAppConnection = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useMigrateAppConnection = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async ({ connectionId, app }: TMigrateAppConnectionDTO) => {
|
||||
const { data } = await apiRequest.post(
|
||||
`/api/v1/app-connections/${app}/${connectionId}/migrate`
|
||||
);
|
||||
|
||||
return data;
|
||||
},
|
||||
onSuccess: ({ projectId, app }) => {
|
||||
queryClient.invalidateQueries({ queryKey: appConnectionKeys.list(projectId) });
|
||||
queryClient.invalidateQueries({ queryKey: appConnectionKeys.listAvailable(app, projectId) });
|
||||
// queryClient.invalidateQueries({ queryKey: appConnectionKeys.byId(app, connectionId) });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||
|
||||
import { AppConnection } from "../enums";
|
||||
import { TOnePassConnection } from "./1password-connection";
|
||||
import { TAppConnectionOption } from "./app-options";
|
||||
@@ -196,22 +194,18 @@ export type TDeleteAppConnectionDTO = {
|
||||
// [AppConnection.Okta]: TOktaConnection;
|
||||
// };
|
||||
|
||||
export type TMigrateAppConnectionDTO = {
|
||||
app: AppConnection;
|
||||
connectionId: string;
|
||||
};
|
||||
|
||||
export type AppConnectionUsage = {
|
||||
projects: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
type: ProjectType;
|
||||
resources: {
|
||||
secretSyncs: Array<{ id: string; name: string }>;
|
||||
externalCas: Array<{ id: string; name: string }>;
|
||||
secretRotations: Array<{ id: string; name: string }>;
|
||||
dataSources: Array<{ id: string; name: string }>;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
// scott: we will need this once we have individual app connection page
|
||||
// export type AppConnectionUsage = {
|
||||
// projects: Array<{
|
||||
// id: string;
|
||||
// name: string;
|
||||
// slug: string;
|
||||
// type: ProjectType;
|
||||
// resources: {
|
||||
// secretSyncs: Array<{ id: string; name: string }>;
|
||||
// externalCas: Array<{ id: string; name: string }>;
|
||||
// secretRotations: Array<{ id: string; name: string }>;
|
||||
// dataSources: Array<{ id: string; name: string }>;
|
||||
// };
|
||||
// }>;
|
||||
// };
|
||||
|
||||
@@ -31,7 +31,7 @@ const Content = ({ onComplete, projectId, projectType, app }: ContentProps) => {
|
||||
return (
|
||||
<AppConnectionForm
|
||||
onComplete={onComplete}
|
||||
onBack={() => setSelectedApp(null)}
|
||||
onBack={app ? undefined : () => setSelectedApp(null)}
|
||||
app={(app ?? selectedApp)!}
|
||||
projectId={projectId}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user