Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ All notable changes to the **Prowler UI** are documented in this file.

---

## [1.16.2] (Prowler v5.16.2) (UNRELEASED)

### 🐞 Fixed

- OCI update credentials form failing silently due to missing provider UID [(#9746)](https://github.com/prowler-cloud/prowler/pull/9746)

---

## [1.16.1] (Prowler v5.16.1)

### 🔄 Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";

import { getProvider } from "@/actions/providers/providers";
import { CredentialsUpdateInfo } from "@/components/providers";
import {
UpdateViaCredentialsForm,
Expand All @@ -20,24 +21,47 @@ interface Props {

export default async function UpdateCredentialsPage({ searchParams }: Props) {
const resolvedSearchParams = await searchParams;
const { type: providerType, via } = resolvedSearchParams;
const { type: providerType, via, id: providerId } = resolvedSearchParams;
const formType = getProviderFormType(providerType, via);

let providerUid: string | undefined;
if (providerId) {
const formData = new FormData();
formData.append("id", providerId);
const providerResponse = await getProvider(formData);
if (providerResponse?.data?.attributes?.uid) {
providerUid = providerResponse.data.attributes.uid;
}
}

switch (formType) {
case "selector":
return (
<CredentialsUpdateInfo providerType={providerType} initialVia={via} />
);

case "credentials":
return <UpdateViaCredentialsForm searchParams={resolvedSearchParams} />;
return (
<UpdateViaCredentialsForm
searchParams={resolvedSearchParams}
providerUid={providerUid}
/>
);

case "role":
return <UpdateViaRoleForm searchParams={resolvedSearchParams} />;
return (
<UpdateViaRoleForm
searchParams={resolvedSearchParams}
providerUid={providerUid}
/>
);

case "service-account":
return (
<UpdateViaServiceAccountForm searchParams={resolvedSearchParams} />
<UpdateViaServiceAccountForm
searchParams={resolvedSearchParams}
providerUid={providerUid}
/>
);

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { BaseCredentialsForm } from "./base-credentials-form";

export const UpdateViaCredentialsForm = ({
searchParams,
providerUid,
}: {
searchParams: { type: string; id: string; secretId?: string };
providerUid?: string;
}) => {
const providerType = searchParams.type as ProviderType;
const providerId = searchParams.id;
Expand All @@ -24,6 +26,7 @@ export const UpdateViaCredentialsForm = ({
<BaseCredentialsForm
providerType={providerType}
providerId={providerId}
providerUid={providerUid}
onSubmit={handleUpdateCredentials}
successNavigationUrl={successNavigationUrl}
submitButtonText="Next"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { BaseCredentialsForm } from "./base-credentials-form";

export const UpdateViaRoleForm = ({
searchParams,
providerUid,
}: {
searchParams: { type: string; id: string; secretId?: string };
providerUid?: string;
}) => {
const providerType = searchParams.type as ProviderType;
const providerId = searchParams.id;
Expand All @@ -24,6 +26,7 @@ export const UpdateViaRoleForm = ({
<BaseCredentialsForm
providerType={providerType}
providerId={providerId}
providerUid={providerUid}
onSubmit={handleUpdateCredentials}
successNavigationUrl={successNavigationUrl}
submitButtonText="Next"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { BaseCredentialsForm } from "./base-credentials-form";

export const UpdateViaServiceAccountForm = ({
searchParams,
providerUid,
}: {
searchParams: { type: string; id: string; secretId?: string };
providerUid?: string;
}) => {
const providerType = searchParams.type as ProviderType;
const providerId = searchParams.id;
Expand All @@ -24,6 +26,7 @@ export const UpdateViaServiceAccountForm = ({
<BaseCredentialsForm
providerType={providerType}
providerId={providerId}
providerUid={providerUid}
onSubmit={handleUpdateCredentials}
successNavigationUrl={successNavigationUrl}
submitButtonText="Next"
Expand Down
Loading