diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index af9eee32fd..9dfa42e70c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -24,4 +24,4 @@ jobs: - name: Install dependencies run: npm install - name: Run Healthcheck - run: npm healthcheck + run: npm run healthcheck diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 2b280ad451..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.11.9-slim - -COPY requirements.txt /requirements.txt -COPY be_poc /be_poc - -RUN python -m pip install -r /requirements.txt -WORKDIR /be_poc -RUN python manage.py migrate && \ - python manage.py loaddata dummy_accounts - -ENTRYPOINT ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/README.md b/README.md index 1843bf36d7..08df0a9c7c 100644 --- a/README.md +++ b/README.md @@ -51,41 +51,3 @@ After modifying the `.npmrc` file, you need to run `pnpm install` again to ensur ## License Licensed under the [MIT license](https://github.com/nextui-org/next-app-template/blob/main/LICENSE). - -# Prowler Django REST API (PoC) - -## Requirements - -- Have `docker` and `docker compose` installed. - -## How to run the REST API - -### Build the service image - -``` -docker compose build django-be-poc -``` - -### Start the service - -``` -docker compose up django-be-poc -``` - -## API - -The API will be accessible through HTTP, port `8080`. For instance, `http://localhost:8080/api/v1/`. - -### Implemented endpoints for the PoC: - -``` -/api/v1/providers/{provider_id}/accounts (the only available provider is 'aws') -``` - -### Expected response with `curl` - -```shellsession -curl http://localhost:8080/api/v1/providers/aws/accounts - -[{"id":1,"type":"Cloudy","enable":true,"provider_id":"aws","provider_data":{"test":"test value"},"inserted_at":"2024-06-24T10:20:18.309000Z","updated_at":"2024-06-24T10:20:18.309000Z","connected":true,"last_checked_at":"2024-06-24T10:20:04Z","alias":"dummy_alias","scanner_configuration":{"full_scan":true},"account_id":1}]% -``` diff --git a/app/about/layout.tsx b/app/about/layout.tsx index 98956a52ad..cfdc03b801 100644 --- a/app/about/layout.tsx +++ b/app/about/layout.tsx @@ -1,13 +1,7 @@ -export default function AboutLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function AboutLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/blog/layout.tsx b/app/blog/layout.tsx index 911d0bcf41..365caee773 100644 --- a/app/blog/layout.tsx +++ b/app/blog/layout.tsx @@ -1,13 +1,7 @@ -export default function BlogLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function BlogLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/clouds/layout.tsx b/app/clouds/layout.tsx index d9ca1e80e4..8c8daab55d 100644 --- a/app/clouds/layout.tsx +++ b/app/clouds/layout.tsx @@ -1,8 +1,4 @@ -export default function CloudsLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function CloudsLayout({ children }: { children: React.ReactNode }) { return (
{children}
diff --git a/app/clouds/page.tsx b/app/clouds/page.tsx index a6f35d6e16..48d18551f8 100644 --- a/app/clouds/page.tsx +++ b/app/clouds/page.tsx @@ -1,43 +1,34 @@ "use client"; -import useSWR from "swr"; -import React from "react"; - +// import { PencilSquareIcon } from "@heroicons/react/24/solid"; +// import { TrashIcon } from "@heroicons/react/24/solid"; +// import { EyeIcon } from "@heroicons/react/24/solid"; import { + // Chip, + // getKeyValue, Table, - TableHeader, TableBody, - TableColumn, - TableRow, TableCell, - User, - Chip, - Tooltip, - getKeyValue, + TableColumn, + TableHeader, + TableRow, + // Tooltip, + // User, } from "@nextui-org/react"; -import { fetcher } from "@/utils/fetcher"; -import { title } from "@/components/primitives"; +import React from "react"; +import useSWR from "swr"; -import { PencilSquareIcon } from "@heroicons/react/24/solid"; -import { TrashIcon } from "@heroicons/react/24/solid"; -import { EyeIcon } from "@heroicons/react/24/solid"; +import { title } from "@/components/primitives"; +import { fetcher } from "@/utils/fetcher"; export default function CloudsPage() { - const getAccounts = useSWR( - `http://localhost:8080/api/v1/providers/aws/accounts`, - fetcher, - ); + const getAccounts = useSWR("http://localhost:8080/api/v1/providers/aws/accounts", fetcher); - const getAudits = useSWR( - `http://localhost:8080/api/v1/providers/aws/audits`, - fetcher, - ); + const getAudits = useSWR("http://localhost:8080/api/v1/providers/aws/audits", fetcher); // TODO FIX TYPE CHECKING - const getScanDetails = (account_id: Number, detail: String) => { - const scan = - getAudits.data && - getAudits.data.find((audit: any) => audit.account_id === account_id); + const getScanDetails = (account_id: number, detail: string) => { + const scan = getAudits.data && getAudits.data.find((audit: any) => audit.account_id === account_id); if (detail === "status") { return scan?.audit_complete && "Completed"; @@ -79,12 +70,8 @@ export default function CloudsPage() {

Cloud Accounts

- {getAccounts.error && ( - Failed to load - )} - {getAccounts.isLoading && ( - Loading - )} + {getAccounts.error && Failed to load} + {getAccounts.isLoading && Loading}

{getAccounts.data && ( diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx index eaf63f3b99..e3d89f490a 100644 --- a/app/docs/layout.tsx +++ b/app/docs/layout.tsx @@ -1,13 +1,7 @@ -export default function DocsLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function DocsLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/error.tsx b/app/error.tsx index 9ed5104e8a..388b7fcc7b 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -2,13 +2,7 @@ import { useEffect } from "react"; -export default function Error({ - error, - reset, -}: { - error: Error; - reset: () => void; -}) { +export default function Error({ error, reset }: { error: Error; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service /* eslint-disable no-console */ diff --git a/app/layout.tsx b/app/layout.tsx index d81ea47ba9..39517f2bf1 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,10 +1,11 @@ -import { Metadata, Viewport } from "next"; -import clsx from "clsx"; - import "@/styles/globals.css"; -import { siteConfig } from "@/config/site"; -import { fontSans } from "@/config/fonts"; + +import clsx from "clsx"; +import { Metadata, Viewport } from "next"; + import { Navbar } from "@/components/navbar"; +import { fontSans } from "@/config/fonts"; +import { siteConfig } from "@/config/site"; import { Providers } from "./providers"; @@ -26,26 +27,15 @@ export const viewport: Viewport = { ], }; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - +
-
- {children} -
+
{children}
diff --git a/app/login/layout.tsx b/app/login/layout.tsx index d3a4a58ea4..561d6bcc49 100644 --- a/app/login/layout.tsx +++ b/app/login/layout.tsx @@ -1,13 +1,7 @@ -export default function LoginLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function LoginLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/login/page.tsx b/app/login/page.tsx index 113f81418e..c348917daf 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -1,17 +1,9 @@ "use client"; -import React from "react"; -import { - Card, - CardHeader, - CardBody, - CardFooter, - Input, - Link, - Button, -} from "@nextui-org/react"; import { EyeIcon } from "@heroicons/react/24/solid"; import { EyeSlashIcon } from "@heroicons/react/24/solid"; +import { Button, Card, CardBody, CardFooter, CardHeader, Input, Link } from "@nextui-org/react"; +import React from "react"; export default function LoginPage() { const [isVisible, setIsVisible] = React.useState(false); @@ -26,22 +18,13 @@ export default function LoginPage() {

Login

- + +