Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify ops/ctl web applications #1016

Merged
merged 70 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
36a8e47
Bump next-auth from 4.9.0 to 4.10.3 in /clients/ops/privacy-center (#…
dependabot[bot] Aug 16, 2022
85daf69
Bump fideslib (#1092)
sanders41 Aug 16, 2022
367613f
983 Adds infra for email config and dispatch (#1059)
eastandwestwind Aug 17, 2022
80c8266
Create a Saas Connector from a Template [#814] (#1076)
galvana Aug 17, 2022
f7011e1
Update the "instantiate_connection_from_template" to return a portion…
pattisdr Aug 17, 2022
cef5901
Adds `AuditLog` and `ExecutionLog`s to `seed_test_data` command (#1097)
Aug 17, 2022
fc644d9
Reduce Idle Connections from Health Checks [#1102] (#1107)
pattisdr Aug 17, 2022
df98af5
Escape redis user and password (#1104)
sanders41 Aug 18, 2022
d19d556
pass in analytics id env to worker (#1113)
eastandwestwind Aug 19, 2022
4d9efb6
Adds tests for email endpoints and dispatch service (#1112)
eastandwestwind Aug 19, 2022
9dbe9ef
Endpoint to Verify User Identity [#1062] (#1111)
pattisdr Aug 19, 2022
bc3d8f2
Bump hashicorp/vault-action from 2.4.1 to 2.4.2 (#1119)
dependabot[bot] Aug 22, 2022
324e9d8
Bump fastapi[all] from 0.79.0 to 0.79.1 (#1120)
dependabot[bot] Aug 22, 2022
d2a7a2f
Bump types-urllib3 from 1.26.22 to 1.26.23 (#1117)
dependabot[bot] Aug 22, 2022
b376762
Bump nox from 2022.1.7 to 2022.8.7 (#1118)
dependabot[bot] Aug 22, 2022
219f3b5
Bump faker from 14.0.0 to 14.1.0 (#1122)
dependabot[bot] Aug 22, 2022
46c7988
Bump sqlalchemy-redshift from 0.8.10 to 0.8.11 (#1121)
dependabot[bot] Aug 22, 2022
58b6c51
POC for dynamic routing (#1033)
TheAndrewJackson Aug 22, 2022
a165f54
Add Sass connector configuration (#1099)
chriscalhoun1974 Aug 22, 2022
8947239
1128-Add Retry button back into the subject request detail view (#1131)
chriscalhoun1974 Aug 23, 2022
36cc41e
Fix localhost setting for non-endpoint analytics calls [#1029] (#1130)
pattisdr Aug 23, 2022
62441f8
Add email_templates module (#1123)
TheAndrewJackson Aug 23, 2022
3eea294
Formatting Issues in Webhooks Documentation (#1114)
RobertKeyser Aug 23, 2022
7193f3c
Send Identity Verification Email [#1010] (#1115)
pattisdr Aug 23, 2022
39c3782
Support case-insensitive connection type search [Unticketed] (#1133)
pattisdr Aug 23, 2022
74717fb
Add option to login as root user from config (#1116)
sanders41 Aug 23, 2022
16c48d3
Move logging to %-style formatting [#837] (#1132)
pattisdr Aug 24, 2022
3fe74f4
Unify ops/ctl web applications
ThomasLaPiana Aug 24, 2022
3df7320
Merge remote-tracking branch 'origin/unified-fides' into ThomasLaPian…
ThomasLaPiana Aug 24, 2022
878dc76
Merge remote-tracking branch 'fidesops/main' into ThomasLaPiana-unify…
ThomasLaPiana Aug 24, 2022
bc80deb
missed a file merge
ThomasLaPiana Aug 24, 2022
c555036
find and replace imports from the merge
ThomasLaPiana Aug 24, 2022
4c4034c
small tweaks
ThomasLaPiana Aug 24, 2022
b5ebbfb
move files from fidesops into fides after the merge
ThomasLaPiana Aug 24, 2022
49c4aef
all static checks passing
ThomasLaPiana Aug 24, 2022
f14d340
fix an import error
ThomasLaPiana Aug 24, 2022
c931426
merge alembic heads
ThomasLaPiana Aug 25, 2022
14224cd
merge the server code, remove duplicates
ThomasLaPiana Aug 25, 2022
b1eb345
isort run
ThomasLaPiana Aug 25, 2022
14647a7
small devx tweaks
ThomasLaPiana Aug 26, 2022
f8102b1
fix the database configuration
ThomasLaPiana Aug 26, 2022
1db80f3
ctl unit and integration tests are passing
ThomasLaPiana Aug 26, 2022
820d761
update ops tests, almost all unit tests passing
ThomasLaPiana Aug 26, 2022
8e6abcb
all ops units tests passing except for exception handler tests
ThomasLaPiana Aug 26, 2022
f1629d1
fix the ctl version check mock url
ThomasLaPiana Aug 26, 2022
757fba6
fix static checks
ThomasLaPiana Aug 26, 2022
8ce7fa6
specify the ctl directory for the external ctl tests
ThomasLaPiana Aug 26, 2022
6e2f115
remove the -x from the ctl external tests
ThomasLaPiana Aug 26, 2022
0a9d417
fix broken references to `ops_main`
ThomasLaPiana Aug 26, 2022
b0534c5
fix the redshift and snowflake account name
ThomasLaPiana Aug 29, 2022
d81c120
fix a reference to ops_main app
ThomasLaPiana Aug 29, 2022
034fa7a
fix the database error message
ThomasLaPiana Aug 29, 2022
b349bde
run isort
ThomasLaPiana Aug 29, 2022
f088c57
fix the postgres test host number
ThomasLaPiana Aug 29, 2022
9449290
finish merging ops_main and main, fix some small test issues in both …
ThomasLaPiana Aug 29, 2022
daec7ed
only 11 failing ops unit tests, mostly fixed by lib oauth updates
ThomasLaPiana Aug 29, 2022
e5fd2f2
clean up a few more tests, 4 ops unit tests still failing
ThomasLaPiana Aug 29, 2022
a7b2eb6
update run infrastructure to let the ops integration tests run
ThomasLaPiana Aug 29, 2022
253d4e4
run isort and remove a "no database" test
ThomasLaPiana Aug 29, 2022
72c0bfd
fix the postgres database test flakiness by checking for a subset of …
ThomasLaPiana Aug 29, 2022
04d1286
graft the ops templates
ThomasLaPiana Aug 29, 2022
3b086b8
Fix oauth endpoint tests
Aug 29, 2022
4d1d8ad
Fix failing unit tests
Aug 30, 2022
3c39a2e
removed the user_endpoint tests from ctl as they're redundant now
ThomasLaPiana Aug 30, 2022
ea1dd9b
fix the remaining broken ops integration tests
ThomasLaPiana Aug 30, 2022
0657234
update the unsafe PR checks workflow
ThomasLaPiana Aug 30, 2022
24f2ff1
fix pylint failure
ThomasLaPiana Aug 30, 2022
2541a48
set the datasets as plaintext, they aren't actually secrets
ThomasLaPiana Aug 31, 2022
e06d38f
start the app before running the external integration tests
ThomasLaPiana Aug 31, 2022
926794f
pin pydantic to <1.10.0
ThomasLaPiana Aug 31, 2022
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Fidesops CI Checks - Unsafe
name: Unsafe Code Checks
on:
push:
branches:
Expand All @@ -7,8 +7,8 @@ on:
types: [labeled]

env:
CONTAINER: fidesops-local
IMAGE: ethyca/fidesops:local
CONTAINER: fides-local
IMAGE: ethyca/fides:local

jobs:
Build:
Expand All @@ -22,7 +22,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build fidesops container
- name: Build container
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -32,7 +32,7 @@ jobs:
push: false
tags: ${{ env.IMAGE }}

- name: Upload fidesops container
- name: Upload container
uses: actions/upload-artifact@v3
with:
name: ${{ env.CONTAINER }}
Expand All @@ -44,13 +44,13 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run unsafe ci checks')
steps:
- name: Download fidesops container
- name: Download container
uses: actions/download-artifact@v3
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fidesops image
- name: Load image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
Expand All @@ -62,9 +62,9 @@ jobs:
- name: Integration Tests (External)
env:
REDSHIFT_TEST_URI: ${{ secrets.REDSHIFT_TEST_URI }}
REDSHIFT_TEST_DB_SCHEMA: ${{ secrets.REDSHIFT_TEST_DB_SCHEMA }}
REDSHIFT_TEST_DB_SCHEMA: fidesops_test
BIGQUERY_KEYFILE_CREDS: ${{ secrets.BIGQUERY_KEYFILE_CREDS }}
BIGQUERY_DATASET: ${{ secrets.BIGQUERY_DATASET }}
BIGQUERY_DATASET: fidesopstest
SNOWFLAKE_TEST_URI: ${{ secrets.SNOWFLAKE_TEST_URI }}
run: nox -s pytest_integration_external

Expand All @@ -76,13 +76,13 @@ jobs:
contents: read
id-token: write
steps:
- name: Download fidesops container
- name: Download container
uses: actions/download-artifact@v3
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fidesops image
- name: Load image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Install Nox
Expand All @@ -92,7 +92,7 @@ jobs:
uses: actions/checkout@v3

- name: Get Vault Token
uses: hashicorp/[email protected].1
uses: hashicorp/[email protected].2
with:
url: ${{ secrets.VAULT_ADDR }}
namespace: ${{ secrets.VAULT_NAMESPACE }}
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,13 @@ dmypy.json
.pyre/

.idea
.vscode

# VSCode
.vscode/*

# Congigure and save debugging details in VS Code launch.json file
!.vscode/launch.json

*.code-workspace
.mypy_cache
docker-stack.yml
Expand Down
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/clients/ops/admin-ui"
},
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "chrome",
"urlFilter": "http://localhost:3000/*", // use urlFilter instead of url!
"webRoot": "${workspaceFolder}/clients/ops/admin-ui"
}
]
}



6 changes: 1 addition & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ include README.md
include requirements.txt
include dev-requirements.txt
include versioneer.py
include src/fides/ops/alembic.ini
include src/fides/api/ctl/alembic.ini
include src/fides/_version.py
include src/fides/py.typed
include src/fides/templates/fides_datamap_template.xlsx

recursive-include src/fides/ui-build *

graft src/fides/ops/migrations

exclude src/fides/ops/migrations/README
exclude src/fides/ops/migrations/script.py.mako
graft src/fides/api/ops/email_templates/templates

global-exclude *.pyc
5 changes: 5 additions & 0 deletions clients/ops/admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ Admin UI for managing FidesOps privacy requests. A web application built in Next
Unless otherwise specified below, all unit tests should be colocated in the directory with the file(s) they are testing, in a `__tests__` subfolder.

The sole exception to this is the `pages` directory. Tests for Next.js pages live in the root `__tests__/pages` directory. Otherwise, Next.js attempts to include them in final build output, which breaks the build.

## Feature flags
During the software development process, one or more features may not be visible at runtime. To toggle a given feature, find the given feature flag `name` key located in the [flags.json](/clients/ops/admin-ui/src/flags.json) file. Update the `isActive` key value to `true/false`. If `true`, feature will be visible at runtime. Otherwise, feature will not be visible at runtime.

For techinical reference implementation, please reference [react-feature-flags](https://github.com/romaindso/react-feature-flags).
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe(`${DATASTORE_CONNECTION_ROUTE}`, () => {
expect(push).toHaveBeenCalledWith(LOGIN_ROUTE);
});

it(`Should stay on DatastoreConnectionPage when the user is already logged in`, async () => {
it.skip(`Should stay on DatastoreConnectionPage when the user is already logged in`, async () => {
await act(async () => {
const push = jest.fn();

Expand Down
12 changes: 12 additions & 0 deletions clients/ops/admin-ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export const USER_PRIVILEGES: UserPrivileges[] = [
privilege: "Approve subject requests",
scope: "privacy-request:review",
},
{
privilege: "Resume subject requests",
scope: "privacy-request:resume",
},
{
privilege: "View datastore connections",
scope: "connection:read",
Expand All @@ -25,6 +29,14 @@ export const USER_PRIVILEGES: UserPrivileges[] = [
privilege: "Create or Update datastore connections",
scope: "connection:create_or_update",
},
{
privilege: "Instantiate connections to SaaS datastores",
scope: "connection:instantiate",
},
{
privilege: "Read connection types",
scope: "connection_type:read",
},
{
privilege: "Delete datastore connections",
scope: "connection:delete",
Expand Down
16 changes: 16 additions & 0 deletions clients/ops/admin-ui/src/features/common/Icon/CircleHelp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { createIcon } from "@fidesui/react";

export default createIcon({
displayName: "CircleHelpIcon",
viewBox: "0 0 18 18",
defaultProps: {
width: "18px",
height: "18px",
},
path: (
<path
d="M9 1.5C4.85742 1.5 1.5 4.85742 1.5 9C1.5 13.1426 4.85742 16.5 9 16.5C13.1426 16.5 16.5 13.1426 16.5 9C16.5 4.85742 13.1426 1.5 9 1.5ZM9 13.2188C8.47266 13.2188 8.0625 12.8086 8.0625 12.2812C8.0625 11.7539 8.44629 11.3438 9 11.3438C9.50098 11.3438 9.9375 11.7539 9.9375 12.2812C9.9375 12.8086 9.50098 13.2188 9 13.2188ZM11.0244 9.05859L9.70312 9.87891V9.9375C9.70312 10.3184 9.38086 10.6406 9 10.6406C8.61914 10.6406 8.29688 10.3184 8.29688 9.9375V9.46875C8.29688 9.23438 8.41406 9 8.64844 8.85352L10.3184 7.85742C10.5234 7.74023 10.6406 7.53516 10.6406 7.30078C10.6406 6.94922 10.3213 6.65625 9.96973 6.65625H8.47266C8.09473 6.65625 7.82812 6.94922 7.82812 7.30078C7.82812 7.68164 7.50586 8.00391 7.125 8.00391C6.74414 8.00391 6.42188 7.68164 6.42188 7.30078C6.42188 6.1582 7.33008 5.25 8.44629 5.25H9.94336C11.1387 5.25 12.0469 6.1582 12.0469 7.30078C12.0469 8.00391 11.666 8.67773 11.0244 9.05859Z"
fill="#A0AEC0"
/>
),
});
16 changes: 16 additions & 0 deletions clients/ops/admin-ui/src/features/common/Icon/ErrorWarning.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { createIcon } from "@fidesui/react";

export default createIcon({
displayName: "ErrorWarningIcon",
viewBox: "0 0 20 20",
defaultProps: {
width: "20px",
height: "20px",
},
path: (
<path
d="M10.0003 18.3332C5.39783 18.3332 1.66699 14.6023 1.66699 9.99984C1.66699 5.39734 5.39783 1.6665 10.0003 1.6665C14.6028 1.6665 18.3337 5.39734 18.3337 9.99984C18.3337 14.6023 14.6028 18.3332 10.0003 18.3332ZM9.16699 12.4998V14.1665H10.8337V12.4998H9.16699ZM9.16699 5.83317V10.8332H10.8337V5.83317H9.16699Z"
fill="#E53E3E"
/>
),
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createIcon } from "@chakra-ui/react";

export default createIcon({
displayName: "GreenCheckCircle",
displayName: "GreenCheckCircleIcon",
viewBox: "0 0 16 16",
defaultProps: {
width: "16px",
Expand Down
4 changes: 3 additions & 1 deletion clients/ops/admin-ui/src/features/common/Icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export { default as ArrowDownLineIcon } from "./ArrowDownLine";
export { default as CircleHelpIcon } from "./CircleHelp";
export { default as CloseSolidIcon } from "./CloseSolid";
export { default as DownloadSolidIcon } from "./DownloadSolid";
export { default as ErrorWarningIcon } from "./ErrorWarning";
export { default as EyeIcon } from "./Eye";
export { default as GearIcon } from "./Gear";
export { default as GreenCheckCircle } from "./GreenCheckCircle";
export { default as GreenCheckCircleIcon } from "./GreenCheckCircle";
export { default as MoreIcon } from "./More";
export { default as SearchLineIcon } from "./SearchLine";
export { default as UserIcon } from "./User";
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const statusPropMap: {
bg: "blue.400",
label: "New",
},
identity_unverified: {
bg: "red.400",
label: "Unverified",
},
};

interface RequestBadgeProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ const MultiSelectDropdownList: React.FC<MultiSelectDropdownListProps> = ({
</Button>
<Spacer />
<Button
onClick={handleDone}
size="xs"
backgroundColor="primary.800"
color="white"
onClick={handleDone}
size="xs"
_hover={{ bg: "primary.400" }}
_active={{ bg: "primary.500" }}
>
Done
</Button>
Expand Down
5 changes: 5 additions & 0 deletions clients/ops/admin-ui/src/features/common/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { format } from "date-fns-tz";

export const capitalize = (text: string): string =>
text.replace(/^\w/, (c) => c.toUpperCase());

Expand All @@ -10,5 +12,8 @@ export const debounce = (fn: Function, ms = 0) => {
};
};

export const formatDate = (value: string | number | Date): string =>
format(new Date(value), "MMMM d, Y, KK:mm:ss z");

export const utf8ToB64 = (str: string): string =>
window.btoa(unescape(encodeURIComponent(str)));
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { SystemType } from "datastore-connections/constants";
import type { RootState } from "../../app/store";
import { BASE_URL, CONNECTION_TYPE_ROUTE } from "../../constants";
import { selectToken } from "../auth";
import { ConnectionOption, ConnectionTypeParams } from "./types";
import {
AllConnectionTypesResponse,
ConnectionTypeParams,
ConnectionTypeSecretSchemaReponse,
} from "./types";

// Helpers
const mapFiltersToSearchParams = ({
Expand Down Expand Up @@ -69,15 +73,27 @@ export const connectionTypeApi = createApi({
tagTypes: ["ConnectionType"],
endpoints: (build) => ({
getAllConnectionTypes: build.query<
ConnectionOption[],
AllConnectionTypesResponse,
Partial<ConnectionTypeParams>
>({
query: (filters) => ({
url: `${CONNECTION_TYPE_ROUTE}${mapFiltersToSearchParams(filters)}`,
}),
providesTags: () => ["ConnectionType"],
}),
getConnectionTypeSecretSchema: build.query<
ConnectionTypeSecretSchemaReponse,
string
>({
query: (connectionType) => ({
url: `${CONNECTION_TYPE_ROUTE}/${connectionType}/secret`,
}),
providesTags: () => ["ConnectionType"],
}),
}),
});

export const { useGetAllConnectionTypesQuery } = connectionTypeApi;
export const {
useGetAllConnectionTypesQuery,
useGetConnectionTypeSecretSchemaQuery,
} = connectionTypeApi;
22 changes: 22 additions & 0 deletions clients/ops/admin-ui/src/features/connection-type/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { SaasType, SystemType } from "datastore-connections/constants";

export type AllConnectionTypesResponse = {
items: ConnectionOption[];
total: number;
page: number;
size: number;
};

export type ConnectionOption = {
identifier: ConnectionType | SaasType;
type: SystemType;
Expand All @@ -9,3 +16,18 @@ export type ConnectionTypeParams = {
search: string;
system_type?: SystemType;
};

export type ConnectionTypeSecretSchemaReponse = {
additionalProperties: boolean;
description: string;
properties: {
[key: string]: {
default?: string;
title: string;
type: string;
};
};
required: string[];
title: string;
type: string;
};
Loading