mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
WIP: Mock API for providers and start rendering data
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import data from "../../../dataProviders.json";
|
||||
|
||||
export async function GET() {
|
||||
// Simulate fetching data with a delay
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
|
||||
return NextResponse.json({ providers: data });
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import "server-only";
|
||||
|
||||
export default async function getProvider() {
|
||||
const res = await fetch("http://localhost:3000/api/providers");
|
||||
const product = await res.json();
|
||||
|
||||
return product;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./dataProvider";
|
||||
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"links": {
|
||||
"first": "https://api.prowler.com/api/v1/providers?page%5Bnumber%5D=1",
|
||||
"last": "https://api.prowler.com/api/v1/providers?page%5Bnumber%5D=1",
|
||||
"next": null,
|
||||
"prev": null
|
||||
},
|
||||
"data": [
|
||||
{
|
||||
"id": "5fd8f121-269e-4715-84cf-f92373f15dfa",
|
||||
"type": "providers",
|
||||
"attributes": {
|
||||
"provider": "aws",
|
||||
"provider_id": "1234567890",
|
||||
"alias": "mock_aws_connected",
|
||||
"connection": {
|
||||
"connected": true,
|
||||
"last_checked_at": "2024-07-17T09:55:14.191475Z"
|
||||
},
|
||||
"scanner_args": {
|
||||
"only_logs": true,
|
||||
"excluded_checks": [
|
||||
"awslambda_function_no_secrets_in_code",
|
||||
"cloudwatch_log_group_no_secrets_in_logs"
|
||||
],
|
||||
"aws_retries_max_attempts": 5
|
||||
},
|
||||
"inserted_at": "2024-07-17T09:55:14.191475Z",
|
||||
"updated_at": "2024-07-17T09:55:14.191475Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "eea048ab-7cb3-47eb-9e5e-dce591ade41f"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "16aaeb4e-d3cd-4bb6-86f8-6c39cf93821e",
|
||||
"type": "providers",
|
||||
"attributes": {
|
||||
"provider": "aws",
|
||||
"provider_id": "1234567891",
|
||||
"alias": "mock_aws_not_connected",
|
||||
"connection": {
|
||||
"connected": false,
|
||||
"last_checked_at": "2024-07-17T09:55:18.987425Z"
|
||||
},
|
||||
"scanner_args": {
|
||||
"only_logs": true,
|
||||
"excluded_checks": [
|
||||
"awslambda_function_no_secrets_in_code",
|
||||
"cloudwatch_log_group_no_secrets_in_logs"
|
||||
],
|
||||
"aws_retries_max_attempts": 5
|
||||
},
|
||||
"inserted_at": "2024-07-17T09:50:18.987425Z",
|
||||
"updated_at": "2024-07-17T09:55:18.987425Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "a8f5e964-5964-4aaf-9176-844e2c3b0716"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "63f16b03-7849-4054-b40b-300e331f46f0",
|
||||
"type": "providers",
|
||||
"attributes": {
|
||||
"provider": "gcp",
|
||||
"provider_id": "1234567895",
|
||||
"alias": "mock_gcp",
|
||||
"connection": {
|
||||
"connected": true,
|
||||
"last_checked_at": "2024-07-17T09:55:18.987425Z"
|
||||
},
|
||||
"scanner_args": {
|
||||
"only_logs": true,
|
||||
"excluded_checks": [
|
||||
"apikeys_key_exists",
|
||||
"cloudsql_instance_public_ip"
|
||||
],
|
||||
"excluded_services": ["kms"]
|
||||
},
|
||||
"inserted_at": "2024-07-17T09:50:18.987425Z",
|
||||
"updated_at": "2024-07-17T09:55:18.987425Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "eea048ab-7cb3-47eb-9e5e-dce591ade41f"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"pages": 1,
|
||||
"count": 3
|
||||
},
|
||||
"version": "v1"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export const fetcher = (url: string) => fetch(url).then((res) => res.json());
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./capitalize";
|
||||
Reference in New Issue
Block a user