mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 01:29:27 +00:00
Address PR comments
This commit is contained in:
@@ -43,12 +43,15 @@ export const useUpdateDynamicSecret = () => {
|
||||
);
|
||||
return data.dynamicSecret;
|
||||
},
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug }) => {
|
||||
onSuccess: (_, { path, environmentSlug, projectSlug, name }) => {
|
||||
// TODO: optimize but currently don't pass projectId
|
||||
queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dynamicSecretKeys.list({ path, projectSlug, environmentSlug })
|
||||
});
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: dynamicSecretKeys.details({ path, projectSlug, environmentSlug, name })
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -363,13 +363,15 @@ export type TDynamicSecretProvider =
|
||||
projectId: string;
|
||||
clusterId: string;
|
||||
roles: string[];
|
||||
buckets: string | Array<{
|
||||
name: string;
|
||||
scopes?: Array<{
|
||||
name: string;
|
||||
collections?: string[];
|
||||
}>;
|
||||
}>;
|
||||
buckets:
|
||||
| string
|
||||
| Array<{
|
||||
name: string;
|
||||
scopes?: Array<{
|
||||
name: string;
|
||||
collections?: string[];
|
||||
}>;
|
||||
}>;
|
||||
passwordRequirements?: {
|
||||
length: number;
|
||||
required: {
|
||||
|
||||
+14
-19
@@ -109,7 +109,11 @@ const BucketScopesConfiguration = ({
|
||||
|
||||
{scopeFields[scopeIndex]?.collections?.map(
|
||||
(collection: string, collectionIndex: number) => (
|
||||
<div key={collection} className="flex items-center space-x-2">
|
||||
<div
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
key={`collection-${bucketIndex}-${scopeIndex}-${collectionIndex}`}
|
||||
className="flex items-center space-x-2"
|
||||
>
|
||||
<FormControl className="flex-1">
|
||||
<Input
|
||||
value={collection || ""}
|
||||
@@ -171,21 +175,11 @@ const BucketScopesConfiguration = ({
|
||||
};
|
||||
|
||||
const couchbaseRoles = [
|
||||
{ value: "data_reader", label: "Data Reader", description: "Read access to bucket data" },
|
||||
{
|
||||
value: "data_writer",
|
||||
label: "Data Writer",
|
||||
description: "Read and write access to bucket data"
|
||||
},
|
||||
{
|
||||
value: "read",
|
||||
label: "Read",
|
||||
description: "Read access to bucket data (alias for data_reader)"
|
||||
},
|
||||
{ value: "read", label: "Read", description: "Read-only access to bucket data" },
|
||||
{
|
||||
value: "write",
|
||||
label: "Write",
|
||||
description: "Read and write access to bucket data (alias for data_writer)"
|
||||
description: "Full write access to bucket data"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -295,7 +289,7 @@ export const CouchbaseInputForm = ({
|
||||
defaultValues: {
|
||||
provider: {
|
||||
url: "https://cloudapi.cloud.couchbase.com",
|
||||
roles: ["data_reader"],
|
||||
roles: ["read"],
|
||||
buckets: "*",
|
||||
useAdvancedBuckets: false,
|
||||
passwordRequirements: {
|
||||
@@ -540,7 +534,7 @@ export const CouchbaseInputForm = ({
|
||||
<Controller
|
||||
control={control}
|
||||
name="provider.roles"
|
||||
defaultValue={["data_reader"]}
|
||||
defaultValue={["read"]}
|
||||
render={({ field: { value, onChange }, fieldState: { error } }) => (
|
||||
<FormControl
|
||||
label="Roles"
|
||||
@@ -574,7 +568,7 @@ export const CouchbaseInputForm = ({
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<FormControl
|
||||
label="Advanced Bucket Configuration"
|
||||
helperText="Enable to configure specific scopes and collections within buckets"
|
||||
helperText="Enable to configure specific buckets, scopes and collections. When disabled, '*' grants access to all buckets, scopes, and collections."
|
||||
>
|
||||
<Switch
|
||||
id="advanced-buckets-switch"
|
||||
@@ -604,13 +598,13 @@ export const CouchbaseInputForm = ({
|
||||
className="w-full"
|
||||
isError={Boolean(error?.message)}
|
||||
errorText={error?.message}
|
||||
helperText="Specify bucket names separated by commas (e.g., 'bucket1,bucket2') or use '*' for all buckets"
|
||||
helperText="Specify bucket names separated by commas (e.g., 'bucket1,bucket2') or use '*' for all buckets, scopes, and collections"
|
||||
>
|
||||
<Input
|
||||
{...field}
|
||||
value={typeof field.value === "string" ? field.value : "*"}
|
||||
onChange={(e) => field.onChange(e.target.value)}
|
||||
placeholder="* (all buckets) or bucket1,bucket2,bucket3"
|
||||
placeholder="* (all buckets, scopes & collections) or bucket1,bucket2,bucket3"
|
||||
/>
|
||||
</FormControl>
|
||||
)}
|
||||
@@ -625,7 +619,8 @@ export const CouchbaseInputForm = ({
|
||||
Advanced Bucket Configuration
|
||||
</div>
|
||||
<div className="text-sm text-mineshaft-400">
|
||||
Configure specific buckets with their scopes and collections
|
||||
Configure specific buckets with their scopes and collections. Leave scopes
|
||||
empty for access to all scopes in a bucket.
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
+14
-19
@@ -109,7 +109,11 @@ const BucketScopesConfiguration = ({
|
||||
|
||||
{scopeFields[scopeIndex]?.collections?.map(
|
||||
(collection: string, collectionIndex: number) => (
|
||||
<div key={collection} className="flex items-center space-x-2">
|
||||
<div
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
key={`collection-${bucketIndex}-${scopeIndex}-${collectionIndex}`}
|
||||
className="flex items-center space-x-2"
|
||||
>
|
||||
<FormControl className="flex-1">
|
||||
<Input
|
||||
value={collection || ""}
|
||||
@@ -133,7 +137,7 @@ const BucketScopesConfiguration = ({
|
||||
size="sm"
|
||||
onClick={() => removeCollection(bucketIndex, scopeIndex, collectionIndex)}
|
||||
>
|
||||
<FontAwesomeIcon icon={faTrash} className="text-red-400" />
|
||||
<FontAwesomeIcon icon={faTrash} className="mb-4 text-red-400" />
|
||||
</IconButton>
|
||||
</div>
|
||||
)
|
||||
@@ -170,21 +174,11 @@ const BucketScopesConfiguration = ({
|
||||
};
|
||||
|
||||
const couchbaseRoles = [
|
||||
{ value: "data_reader", label: "Data Reader", description: "Read access to bucket data" },
|
||||
{
|
||||
value: "data_writer",
|
||||
label: "Data Writer",
|
||||
description: "Read and write access to bucket data"
|
||||
},
|
||||
{
|
||||
value: "read",
|
||||
label: "Read",
|
||||
description: "Read access to bucket data (alias for data_reader)"
|
||||
},
|
||||
{ value: "read", label: "Read", description: "Read-only access to bucket data" },
|
||||
{
|
||||
value: "write",
|
||||
label: "Write",
|
||||
description: "Read and write access to bucket data (alias for data_writer)"
|
||||
description: "Full write access to bucket data"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -548,7 +542,7 @@ export const EditDynamicSecretCouchbaseForm = ({
|
||||
<Controller
|
||||
control={control}
|
||||
name="inputs.roles"
|
||||
defaultValue={["data_reader"]}
|
||||
defaultValue={["read"]}
|
||||
render={({ field: { value, onChange }, fieldState: { error } }) => (
|
||||
<FormControl
|
||||
label="Roles"
|
||||
@@ -581,7 +575,7 @@ export const EditDynamicSecretCouchbaseForm = ({
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<FormControl
|
||||
label="Advanced Bucket Configuration"
|
||||
helperText="Enable to configure specific scopes and collections within buckets"
|
||||
helperText="Enable to configure specific buckets, scopes and collections. When disabled, '*' grants access to all buckets, scopes, and collections."
|
||||
>
|
||||
<Switch
|
||||
id="advanced-buckets-switch"
|
||||
@@ -611,13 +605,13 @@ export const EditDynamicSecretCouchbaseForm = ({
|
||||
className="w-full"
|
||||
isError={Boolean(error?.message)}
|
||||
errorText={error?.message}
|
||||
helperText="Specify bucket names separated by commas (e.g., 'bucket1,bucket2') or use '*' for all buckets"
|
||||
helperText="Specify bucket names separated by commas (e.g., 'bucket1,bucket2') or use '*' for all buckets, scopes, and collections"
|
||||
>
|
||||
<Input
|
||||
{...field}
|
||||
value={typeof field.value === "string" ? field.value : "*"}
|
||||
onChange={(e) => field.onChange(e.target.value)}
|
||||
placeholder="* (all buckets) or bucket1,bucket2,bucket3"
|
||||
placeholder="* (all buckets, scopes & collections) or bucket1,bucket2,bucket3"
|
||||
/>
|
||||
</FormControl>
|
||||
)}
|
||||
@@ -632,7 +626,8 @@ export const EditDynamicSecretCouchbaseForm = ({
|
||||
Advanced Bucket Configuration
|
||||
</div>
|
||||
<div className="text-sm text-mineshaft-400">
|
||||
Configure specific buckets with their scopes and collections
|
||||
Configure specific buckets with their scopes and collections. Leave scopes
|
||||
empty for access to all scopes in a bucket.
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user