PR fix suggestions for aws secret rotations

This commit is contained in:
carlosmonastyrski
2025-04-22 17:40:15 -03:00
parent b85809293c
commit 5819b8c576
15 changed files with 66 additions and 48 deletions
@@ -25,7 +25,7 @@ export const AwsIamUserSecretRotationParametersFields = () => {
return (
<>
<Controller
name="parameters.clientName"
name="parameters.userName"
control={control}
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl
@@ -70,13 +70,13 @@ export const AwsIamUserSecretRotationParametersFields = () => {
)}
/>
<Controller
control={control}
name="parameters.region"
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl isError={Boolean(error)} errorText={error?.message} label="Region">
<AwsRegionSelect value={value} onChange={onChange} />
</FormControl>
)}
control={control}
name="parameters.region"
/>
</>
);
@@ -19,11 +19,11 @@ export const AwsIamUserSecretRotationReviewFields = () => {
<>
<SecretRotationReviewSection label="Parameters">
<GenericFieldLabel label="Region">{parameters.region}</GenericFieldLabel>
<GenericFieldLabel label="User Name">{parameters.clientName}</GenericFieldLabel>
<GenericFieldLabel label="User Name">{parameters.userName}</GenericFieldLabel>
</SecretRotationReviewSection>
<SecretRotationReviewSection label="Secrets Mapping">
<GenericFieldLabel label="Access Key ID">{accessKeyId}</GenericFieldLabel>
<GenericFieldLabel label="Access Key Secret">{secretAccessKey}</GenericFieldLabel>
<GenericFieldLabel label="Secret Access Key ID">{accessKeyId}</GenericFieldLabel>
<GenericFieldLabel label="Secret Access Key">{secretAccessKey}</GenericFieldLabel>
</SecretRotationReviewSection>
</>
);
@@ -35,7 +35,7 @@ export const AwsIamUserSecretRotationSecretsMappingFields = () => {
)
},
{
name: "Client Secret",
name: "Secret Access Key",
input: (
<Controller
render={({ field: { value, onChange }, fieldState: { error } }) => (
@@ -7,7 +7,7 @@ export const AwsIamUserSecretRotationSchema = z
.object({
type: z.literal(SecretRotation.AwsIamUserSecret),
parameters: z.object({
clientName: z.string().trim().min(1, "Client Name required"),
userName: z.string().trim().min(1, "User Name required"),
region: z.string().trim().min(1, "Region required")
}),
secretsMapping: z.object({
@@ -28,7 +28,4 @@ export type TAwsConnectionListIamUsersResponse = {
iamUsers: TAwsConnectionIamUser[];
};
export type TAwsIamUserSecret = {
arn: string;
UserName: string;
};
export type TAwsIamUserSecret = TAwsConnectionIamUser;
@@ -9,7 +9,7 @@ export type TAwsIamUserSecretRotation = TSecretRotationV2Base & {
type: SecretRotation.AwsIamUserSecret;
parameters: {
region: string;
clientName: string;
userName: string;
};
secretsMapping: {
accessKeyId: string;
@@ -8,7 +8,7 @@ import {
TAwsIamUserSecretRotation,
TAwsIamUserSecretRotationGeneratedCredentialsResponse,
TAwsIamUserSecretRotationOption
} from "@app/hooks/api/secretRotationsV2/types/aws-iam-access-key-rotation";
} from "@app/hooks/api/secretRotationsV2/types/aws-iam-user-secret-rotation";
import {
TMsSqlCredentialsRotation,
TMsSqlCredentialsRotationGeneratedCredentialsResponse