@@ -60,7 +60,7 @@ const dataListFragment = graphql`
|
||||
node {
|
||||
id
|
||||
name
|
||||
dataSensitivity
|
||||
dataClassification
|
||||
owner {
|
||||
id
|
||||
fullName
|
||||
@@ -236,29 +236,27 @@ function DataListContent({
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge
|
||||
variant={
|
||||
item?.dataSensitivity === "NONE"
|
||||
item?.dataClassification === "PUBLIC"
|
||||
? "default"
|
||||
: item?.dataSensitivity === "LOW"
|
||||
: item?.dataClassification === "INTERNAL"
|
||||
? "success"
|
||||
: item?.dataSensitivity === "MEDIUM"
|
||||
: item?.dataClassification === "CONFIDENTIAL"
|
||||
? "info"
|
||||
: item?.dataSensitivity === "HIGH"
|
||||
: item?.dataClassification === "SECRET"
|
||||
? "warning"
|
||||
: "destructive"
|
||||
}
|
||||
className="px-3 py-0.5 text-xs font-medium"
|
||||
>
|
||||
{item?.dataSensitivity === "NONE"
|
||||
? "No sensitive data"
|
||||
: item?.dataSensitivity === "LOW"
|
||||
? "Public or non-sensitive data"
|
||||
: item?.dataSensitivity === "MEDIUM"
|
||||
? "Internal/restricted data"
|
||||
: item?.dataSensitivity === "HIGH"
|
||||
? "Confidential data"
|
||||
: item?.dataSensitivity === "CRITICAL"
|
||||
? "Regulated/PII/financial data"
|
||||
: "No sensitive data"}
|
||||
{item?.dataClassification === "PUBLIC"
|
||||
? "Public"
|
||||
: item?.dataClassification === "INTERNAL"
|
||||
? "Internal"
|
||||
: item?.dataClassification === "CONFIDENTIAL"
|
||||
? "Confidential"
|
||||
: item?.dataClassification === "SECRET"
|
||||
? "Secret"
|
||||
: "Unknown"}
|
||||
</Badge>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
useMutation,
|
||||
} from "react-relay";
|
||||
import { Suspense, useEffect, useState, useCallback } from "react";
|
||||
import type { DatumViewQuery as DatumViewQueryType } from "./__generated__/DatumViewQuery.graphql";
|
||||
import type { DataClassification, DatumViewQuery as DatumViewQueryType } from "./__generated__/DatumViewQuery.graphql";
|
||||
import { useParams } from "react-router";
|
||||
import { PageTemplate } from "@/components/PageTemplate";
|
||||
import { DatumViewSkeleton } from "./DatumPage";
|
||||
@@ -35,7 +35,7 @@ const datumViewQuery = graphql`
|
||||
... on Datum {
|
||||
id
|
||||
name
|
||||
dataSensitivity
|
||||
dataClassification
|
||||
vendors {
|
||||
edges {
|
||||
node {
|
||||
@@ -75,7 +75,7 @@ const updateDatumMutation = graphql`
|
||||
datum {
|
||||
id
|
||||
name
|
||||
dataSensitivity
|
||||
dataClassification
|
||||
vendors {
|
||||
edges {
|
||||
node {
|
||||
@@ -93,13 +93,13 @@ const updateDatumMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
type DataSensitivity = "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
|
||||
// type DataClassification = "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET";
|
||||
|
||||
interface Datum {
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly description?: string;
|
||||
readonly dataSensitivity?: DataSensitivity;
|
||||
readonly dataClassification?: DataClassification;
|
||||
readonly owner?: {
|
||||
readonly id: string;
|
||||
readonly fullName: string;
|
||||
@@ -171,7 +171,7 @@ function DatumViewContent({
|
||||
const organization = data.organization as Organization;
|
||||
const [formData, setFormData] = useState({
|
||||
name: datum?.name || "",
|
||||
dataSensitivity: datum?.dataSensitivity || "NONE",
|
||||
dataClassification: datum?.dataClassification || "INTERNAL",
|
||||
ownerId: datum?.owner?.id || "",
|
||||
selectedVendorIds: datum?.vendors?.edges?.map(edge => edge?.node?.id).filter((id): id is string => id != null) || [],
|
||||
});
|
||||
@@ -188,7 +188,7 @@ function DatumViewContent({
|
||||
input: {
|
||||
id: nodeId,
|
||||
name: formData.name,
|
||||
dataSensitivity: formData.dataSensitivity,
|
||||
dataClassification: formData.dataClassification,
|
||||
ownerId: formData.ownerId,
|
||||
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
||||
},
|
||||
@@ -233,7 +233,7 @@ function DatumViewContent({
|
||||
const datum = data.node as Datum | null;
|
||||
setFormData({
|
||||
name: datum?.name || "",
|
||||
dataSensitivity: datum?.dataSensitivity || "NONE",
|
||||
dataClassification: datum?.dataClassification || "INTERNAL",
|
||||
ownerId: datum?.owner?.id || "",
|
||||
selectedVendorIds: datum?.vendors?.edges?.map(edge => edge?.node?.id).filter((id): id is string => id != null) || [],
|
||||
});
|
||||
@@ -317,18 +317,17 @@ function DatumViewContent({
|
||||
<Label className="text-sm">Data Sensitivity</Label>
|
||||
</div>
|
||||
<Select
|
||||
value={formData.dataSensitivity}
|
||||
onValueChange={(value) => handleFieldChange("dataSensitivity", value)}
|
||||
value={formData.dataClassification}
|
||||
onValueChange={(value) => handleFieldChange("dataClassification", value)}
|
||||
>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="Select data sensitivity" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="NONE">No sensitive data</SelectItem>
|
||||
<SelectItem value="LOW">Public or non-sensitive data</SelectItem>
|
||||
<SelectItem value="MEDIUM">Internal/restricted data</SelectItem>
|
||||
<SelectItem value="HIGH">Confidential data</SelectItem>
|
||||
<SelectItem value="CRITICAL">Regulated/PII/financial data</SelectItem>
|
||||
<SelectItem value="PUBLIC">Public</SelectItem>
|
||||
<SelectItem value="INTERNAL">Internal</SelectItem>
|
||||
<SelectItem value="CONFIDENTIAL">Confidential</SelectItem>
|
||||
<SelectItem value="SECRET">Secret</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@ const createDatumMutation = graphql`
|
||||
node {
|
||||
id
|
||||
name
|
||||
dataSensitivity
|
||||
dataClassification
|
||||
owner {
|
||||
id
|
||||
fullName
|
||||
@@ -129,7 +129,7 @@ function NewDataViewContent({
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
name: "",
|
||||
dataSensitivity: "NONE" as "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL",
|
||||
dataClassification: "INTERNAL" as "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET",
|
||||
ownerId: "",
|
||||
selectedVendorIds: [] as string[],
|
||||
});
|
||||
@@ -184,7 +184,7 @@ function NewDataViewContent({
|
||||
input: {
|
||||
organizationId: organizationId!,
|
||||
name: formData.name,
|
||||
dataSensitivity: formData.dataSensitivity,
|
||||
dataClassification: formData.dataClassification,
|
||||
ownerId: formData.ownerId,
|
||||
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
||||
} satisfies CreateDatumInput,
|
||||
@@ -278,19 +278,18 @@ function NewDataViewContent({
|
||||
<div className="space-y-2">
|
||||
<Label className="text-sm">Data Sensitivity</Label>
|
||||
<Select
|
||||
value={formData.dataSensitivity}
|
||||
value={formData.dataClassification}
|
||||
onValueChange={(value: string) =>
|
||||
handleFieldChange("dataSensitivity", value as "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL")}
|
||||
handleFieldChange("dataClassification", value as "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET")}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select data sensitivity" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="NONE">No sensitive data</SelectItem>
|
||||
<SelectItem value="LOW">Public or non-sensitive data</SelectItem>
|
||||
<SelectItem value="MEDIUM">Internal/restricted data</SelectItem>
|
||||
<SelectItem value="HIGH">Confidential data</SelectItem>
|
||||
<SelectItem value="CRITICAL">Regulated/PII/financial data</SelectItem>
|
||||
<SelectItem value="PUBLIC">Public</SelectItem>
|
||||
<SelectItem value="INTERNAL">Internal</SelectItem>
|
||||
<SelectItem value="CONFIDENTIAL">Confidential</SelectItem>
|
||||
<SelectItem value="SECRET">Secret</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<9fb6bfbd0ba80aa33ef3d8edfdb53a19>>
|
||||
* @generated SignedSource<<390d190ae303b0edd4858bc50f58c048>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -208,7 +208,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -368,16 +368,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "1a9be11b8d32e569f75ae591226e7b8b",
|
||||
"cacheID": "7a663a198e00b6cc15d889565e48f4e2",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DataListViewPaginationQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query DataListViewPaginationQuery(\n $after: CursorKey\n $before: CursorKey\n $first: Int\n $last: Int\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DataListView_data_pbnwq\n id\n }\n}\n\nfragment DataListView_data_pbnwq on Organization {\n id\n data(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n dataSensitivity\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
|
||||
"text": "query DataListViewPaginationQuery(\n $after: CursorKey\n $before: CursorKey\n $first: Int\n $last: Int\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DataListView_data_pbnwq\n id\n }\n}\n\nfragment DataListView_data_pbnwq on Organization {\n id\n data(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "d1b1652f1f59c091709bce823b6a0eaa";
|
||||
(node as any).hash = "b8465a1295d6d7351cee98f2e4f9756a";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<905fb20472d2c30aabb9a9afc41acf41>>
|
||||
* @generated SignedSource<<f5c4ef95583024470ef959e39f4452a2>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -208,7 +208,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -368,12 +368,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "0c5725c38efb32dc65674c4bbd8dd154",
|
||||
"cacheID": "164b5819fe6d186b9baa512c67b59e9a",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DataListViewQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query DataListViewQuery(\n $organizationId: ID!\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n organization: node(id: $organizationId) {\n __typename\n ...DataListView_data_pbnwq\n id\n }\n}\n\nfragment DataListView_data_pbnwq on Organization {\n id\n data(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n dataSensitivity\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
|
||||
"text": "query DataListViewQuery(\n $organizationId: ID!\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n organization: node(id: $organizationId) {\n __typename\n ...DataListView_data_pbnwq\n id\n }\n}\n\nfragment DataListView_data_pbnwq on Organization {\n id\n data(first: $first, after: $after, last: $last, before: $before, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<25f5cfd4e1e5f0724a1082db9d9b10d6>>
|
||||
* @generated SignedSource<<63f7ca6490b6387c5950790772723ebc>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
||||
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DataListView_data$data = {
|
||||
readonly data: {
|
||||
@@ -17,7 +17,7 @@ export type DataListView_data$data = {
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly createdAt: string;
|
||||
readonly dataSensitivity: DataSensitivity;
|
||||
readonly dataClassification: DataClassification;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly owner: {
|
||||
@@ -165,7 +165,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -316,6 +316,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "d1b1652f1f59c091709bce823b6a0eaa";
|
||||
(node as any).hash = "b8465a1295d6d7351cee98f2e4f9756a";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<272734160b60bf94a6f031e685751b64>>
|
||||
* @generated SignedSource<<435da2b0f7d8b9ec259d386a752c18b7>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
||||
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||
export type DatumViewQuery$variables = {
|
||||
datumId: string;
|
||||
organizationId: string;
|
||||
@@ -18,7 +18,7 @@ export type DatumViewQuery$variables = {
|
||||
export type DatumViewQuery$data = {
|
||||
readonly node: {
|
||||
readonly createdAt?: string;
|
||||
readonly dataSensitivity?: DataSensitivity;
|
||||
readonly dataClassification?: DataClassification;
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly owner?: {
|
||||
@@ -91,7 +91,7 @@ v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
v5 = {
|
||||
@@ -469,7 +469,7 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "c3fd8609637a69d90a532344150b4d6a",
|
||||
"cacheID": "958954258516869d985feedba1cf9db3",
|
||||
"id": null,
|
||||
"metadata": {
|
||||
"connection": [
|
||||
@@ -486,11 +486,11 @@ return {
|
||||
},
|
||||
"name": "DatumViewQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query DatumViewQuery(\n $datumId: ID!\n $organizationId: ID!\n) {\n node(id: $datumId) {\n __typename\n ... on Datum {\n id\n name\n dataSensitivity\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n }\n id\n }\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n ...PeopleSelector_organization\n vendors(first: 100, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n\nfragment PeopleSelector_organization on Organization {\n id\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n"
|
||||
"text": "query DatumViewQuery(\n $datumId: ID!\n $organizationId: ID!\n) {\n node(id: $datumId) {\n __typename\n ... on Datum {\n id\n name\n dataClassification\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n }\n id\n }\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n ...PeopleSelector_organization\n vendors(first: 100, orderBy: {direction: ASC, field: NAME}) {\n edges {\n node {\n id\n name\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n\nfragment PeopleSelector_organization on Organization {\n id\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "2f759d45493db37e45b3a7166dd36c2e";
|
||||
(node as any).hash = "836074301e1d6f8c2aec59fc569bd68e";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4aa66259b93ace779a3e38430cf8c1ee>>
|
||||
* @generated SignedSource<<6a2c795f1b3328794d9e3db73151feaa>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,9 +9,9 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
||||
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||
export type UpdateDatumInput = {
|
||||
dataSensitivity?: DataSensitivity | null | undefined;
|
||||
dataClassification?: DataClassification | null | undefined;
|
||||
id: string;
|
||||
name?: string | null | undefined;
|
||||
ownerId?: string | null | undefined;
|
||||
@@ -23,7 +23,7 @@ export type DatumViewUpdateDatumMutation$variables = {
|
||||
export type DatumViewUpdateDatumMutation$data = {
|
||||
readonly updateDatum: {
|
||||
readonly datum: {
|
||||
readonly dataSensitivity: DataSensitivity;
|
||||
readonly dataClassification: DataClassification;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly owner: {
|
||||
@@ -96,7 +96,7 @@ v2 = [
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -184,16 +184,16 @@ return {
|
||||
"selections": (v2/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "1e5b2489558fef74becf57d2457a4891",
|
||||
"cacheID": "ec5c79edccc379aae627f969ec18c55e",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DatumViewUpdateDatumMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation DatumViewUpdateDatumMutation(\n $input: UpdateDatumInput!\n) {\n updateDatum(input: $input) {\n datum {\n id\n name\n dataSensitivity\n vendors {\n edges {\n node {\n id\n }\n }\n }\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
"text": "mutation DatumViewUpdateDatumMutation(\n $input: UpdateDatumInput!\n) {\n updateDatum(input: $input) {\n datum {\n id\n name\n dataClassification\n vendors {\n edges {\n node {\n id\n }\n }\n }\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "ac445fa9f2ccebef8203e0138c794ea8";
|
||||
(node as any).hash = "38b1842eb3e3549efc9e961c56c22879";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5b93fe65ad69563bbcb6e75d0b913eb8>>
|
||||
* @generated SignedSource<<87179d28750a2a84a6c1ea1b779cbd49>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,9 +9,9 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
||||
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||
export type CreateDatumInput = {
|
||||
dataSensitivity: DataSensitivity;
|
||||
dataClassification: DataClassification;
|
||||
name: string;
|
||||
organizationId: string;
|
||||
ownerId: string;
|
||||
@@ -25,7 +25,7 @@ export type NewDatumViewCreateDatumMutation$data = {
|
||||
readonly createDatum: {
|
||||
readonly datumEdge: {
|
||||
readonly node: {
|
||||
readonly dataSensitivity: DataSensitivity;
|
||||
readonly dataClassification: DataClassification;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly owner: {
|
||||
@@ -103,7 +103,7 @@ v5 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "dataSensitivity",
|
||||
"name": "dataClassification",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -232,16 +232,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "0ab550803b091f5dfa1935f810eaecdc",
|
||||
"cacheID": "1349272a7b0c9f14ee6e257f66ad5cea",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NewDatumViewCreateDatumMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NewDatumViewCreateDatumMutation(\n $input: CreateDatumInput!\n) {\n createDatum(input: $input) {\n datumEdge {\n node {\n id\n name\n dataSensitivity\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n }\n }\n }\n}\n"
|
||||
"text": "mutation NewDatumViewCreateDatumMutation(\n $input: CreateDatumInput!\n) {\n createDatum(input: $input) {\n datumEdge {\n node {\n id\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors {\n edges {\n node {\n id\n name\n }\n }\n }\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "697a260fb7d44115c617682d38b9259d";
|
||||
(node as any).hash = "9b5546ff1b7563fdb7db2bbcba53f3fe";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -27,13 +27,13 @@ import (
|
||||
)
|
||||
|
||||
type Data struct {
|
||||
ID gid.GID `db:"id"`
|
||||
Name string `db:"name"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
DataSensitivity DataSensitivity `db:"data_sensitivity"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
ID gid.GID `db:"id"`
|
||||
Name string `db:"name"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
DataClassification DataClassification `db:"data_classification"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
func (d *Data) CursorKey(field DatumOrderField) page.CursorKey {
|
||||
@@ -42,8 +42,8 @@ func (d *Data) CursorKey(field DatumOrderField) page.CursorKey {
|
||||
return page.NewCursorKey(d.ID, d.CreatedAt)
|
||||
case DatumOrderFieldName:
|
||||
return page.NewCursorKey(d.ID, d.Name)
|
||||
case DatumOrderFieldDataSensitivity:
|
||||
return page.NewCursorKey(d.ID, d.DataSensitivity)
|
||||
case DatumOrderFieldDataClassification:
|
||||
return page.NewCursorKey(d.ID, d.DataClassification)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
@@ -63,7 +63,7 @@ SELECT
|
||||
name,
|
||||
owner_id,
|
||||
organization_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
@@ -105,7 +105,7 @@ SELECT
|
||||
name,
|
||||
owner_id,
|
||||
organization_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
@@ -148,7 +148,7 @@ SELECT
|
||||
id,
|
||||
name,
|
||||
owner_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
@@ -193,7 +193,7 @@ SELECT
|
||||
name,
|
||||
organization_id,
|
||||
owner_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
@@ -237,7 +237,7 @@ INSERT INTO data (
|
||||
name,
|
||||
owner_id,
|
||||
organization_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@@ -246,21 +246,21 @@ INSERT INTO data (
|
||||
@name,
|
||||
@owner_id,
|
||||
@organization_id,
|
||||
@data_sensitivity,
|
||||
@data_classification,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": d.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"name": d.Name,
|
||||
"owner_id": d.OwnerID,
|
||||
"organization_id": d.OrganizationID,
|
||||
"data_sensitivity": d.DataSensitivity,
|
||||
"created_at": d.CreatedAt,
|
||||
"updated_at": d.UpdatedAt,
|
||||
"id": d.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"name": d.Name,
|
||||
"owner_id": d.OwnerID,
|
||||
"organization_id": d.OrganizationID,
|
||||
"data_classification": d.DataClassification,
|
||||
"created_at": d.CreatedAt,
|
||||
"updated_at": d.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
@@ -281,7 +281,7 @@ UPDATE data
|
||||
SET
|
||||
name = @name,
|
||||
owner_id = @owner_id,
|
||||
data_sensitivity = @data_sensitivity,
|
||||
data_classification = @data_classification,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
@@ -291,7 +291,7 @@ RETURNING
|
||||
name,
|
||||
owner_id,
|
||||
organization_id,
|
||||
data_sensitivity,
|
||||
data_classification,
|
||||
created_at,
|
||||
updated_at
|
||||
`
|
||||
@@ -299,11 +299,11 @@ RETURNING
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": d.ID,
|
||||
"name": d.Name,
|
||||
"owner_id": d.OwnerID,
|
||||
"data_sensitivity": d.DataSensitivity,
|
||||
"updated_at": time.Now(),
|
||||
"id": d.ID,
|
||||
"name": d.Name,
|
||||
"owner_id": d.OwnerID,
|
||||
"data_classification": d.DataClassification,
|
||||
"updated_at": time.Now(),
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
|
||||
24
pkg/coredata/data_classification.go
Normal file
24
pkg/coredata/data_classification.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
type DataClassification string
|
||||
|
||||
const (
|
||||
DataClassificationPublic DataClassification = "PUBLIC"
|
||||
DataClassificationInternal DataClassification = "INTERNAL"
|
||||
DataClassificationConfidential DataClassification = "CONFIDENTIAL"
|
||||
DataClassificationSecret DataClassification = "SECRET"
|
||||
)
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
type DatumOrderField string
|
||||
|
||||
const (
|
||||
DatumOrderFieldCreatedAt DatumOrderField = "CREATED_AT"
|
||||
DatumOrderFieldName DatumOrderField = "NAME"
|
||||
DatumOrderFieldDataSensitivity DatumOrderField = "DATA_SENSITIVITY"
|
||||
DatumOrderFieldCreatedAt DatumOrderField = "CREATED_AT"
|
||||
DatumOrderFieldName DatumOrderField = "NAME"
|
||||
DatumOrderFieldDataClassification DatumOrderField = "DATA_CLASSIFICATION"
|
||||
)
|
||||
|
||||
func (p DatumOrderField) Column() string {
|
||||
@@ -43,7 +43,7 @@ func (p *DatumOrderField) UnmarshalText(text []byte) error {
|
||||
switch val {
|
||||
case string(DatumOrderFieldCreatedAt),
|
||||
string(DatumOrderFieldName),
|
||||
string(DatumOrderFieldDataSensitivity):
|
||||
string(DatumOrderFieldDataClassification):
|
||||
*p = DatumOrderField(val)
|
||||
return nil
|
||||
}
|
||||
|
||||
24
pkg/coredata/migrations/20250609T193222Z.sql
Normal file
24
pkg/coredata/migrations/20250609T193222Z.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE TYPE data_classification_type AS ENUM (
|
||||
'PUBLIC',
|
||||
'INTERNAL',
|
||||
'CONFIDENTIAL',
|
||||
'SECRET'
|
||||
);
|
||||
|
||||
ALTER TABLE data
|
||||
ADD COLUMN data_classification data_classification_type;
|
||||
|
||||
UPDATE data
|
||||
SET data_classification = CASE
|
||||
WHEN data_sensitivity = 'NONE' THEN 'PUBLIC'::data_classification_type
|
||||
WHEN data_sensitivity = 'LOW' THEN 'INTERNAL'::data_classification_type
|
||||
WHEN data_sensitivity = 'MEDIUM' THEN 'INTERNAL'::data_classification_type
|
||||
WHEN data_sensitivity = 'HIGH' THEN 'CONFIDENTIAL'::data_classification_type
|
||||
WHEN data_sensitivity = 'CRITICAL' THEN 'SECRET'::data_classification_type
|
||||
END;
|
||||
|
||||
ALTER TABLE data
|
||||
ALTER COLUMN data_classification SET NOT NULL;
|
||||
|
||||
ALTER TABLE data
|
||||
DROP COLUMN data_sensitivity;
|
||||
@@ -30,19 +30,19 @@ type DatumService struct {
|
||||
}
|
||||
|
||||
type CreateDatumRequest struct {
|
||||
OrganizationID gid.GID
|
||||
Name string
|
||||
DataSensitivity coredata.DataSensitivity
|
||||
OwnerID gid.GID
|
||||
VendorIDs []gid.GID
|
||||
OrganizationID gid.GID
|
||||
Name string
|
||||
DataClassification coredata.DataClassification
|
||||
OwnerID gid.GID
|
||||
VendorIDs []gid.GID
|
||||
}
|
||||
|
||||
type UpdateDatumRequest struct {
|
||||
ID gid.GID
|
||||
Name *string
|
||||
DataSensitivity *coredata.DataSensitivity
|
||||
OwnerID *gid.GID
|
||||
VendorIDs []gid.GID
|
||||
ID gid.GID
|
||||
Name *string
|
||||
DataClassification *coredata.DataClassification
|
||||
OwnerID *gid.GID
|
||||
VendorIDs []gid.GID
|
||||
}
|
||||
|
||||
func (s DatumService) Get(
|
||||
@@ -126,21 +126,21 @@ func (s DatumService) Update(
|
||||
}
|
||||
|
||||
datum := &coredata.Data{
|
||||
ID: req.ID,
|
||||
OrganizationID: existing.OrganizationID,
|
||||
Name: existing.Name,
|
||||
DataSensitivity: existing.DataSensitivity,
|
||||
OwnerID: existing.OwnerID,
|
||||
CreatedAt: existing.CreatedAt,
|
||||
UpdatedAt: now,
|
||||
ID: req.ID,
|
||||
OrganizationID: existing.OrganizationID,
|
||||
Name: existing.Name,
|
||||
DataClassification: existing.DataClassification,
|
||||
OwnerID: existing.OwnerID,
|
||||
CreatedAt: existing.CreatedAt,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
// Update fields from request
|
||||
if req.Name != nil {
|
||||
datum.Name = *req.Name
|
||||
}
|
||||
if req.DataSensitivity != nil {
|
||||
datum.DataSensitivity = *req.DataSensitivity
|
||||
if req.DataClassification != nil {
|
||||
datum.DataClassification = *req.DataClassification
|
||||
}
|
||||
if req.OwnerID != nil {
|
||||
datum.OwnerID = *req.OwnerID
|
||||
@@ -161,13 +161,13 @@ func (s DatumService) Create(
|
||||
datumID := gid.New(s.svc.scope.GetTenantID(), coredata.DatumEntityType)
|
||||
|
||||
datum := &coredata.Data{
|
||||
ID: datumID,
|
||||
OrganizationID: req.OrganizationID,
|
||||
Name: req.Name,
|
||||
DataSensitivity: req.DataSensitivity,
|
||||
OwnerID: req.OwnerID,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
ID: datumID,
|
||||
OrganizationID: req.OrganizationID,
|
||||
Name: req.Name,
|
||||
DataClassification: req.DataClassification,
|
||||
OwnerID: req.OwnerID,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
err := s.svc.pg.WithTx(
|
||||
|
||||
@@ -367,7 +367,19 @@ enum AssetOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.Ass
|
||||
enum DatumOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.DatumOrderField") {
|
||||
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
||||
NAME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldName")
|
||||
DATA_SENSITIVITY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldDataSensitivity")
|
||||
DATA_CLASSIFICATION @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldDataClassification")
|
||||
}
|
||||
|
||||
enum DataClassification
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.DataClassification") {
|
||||
PUBLIC
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationPublic")
|
||||
INTERNAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationInternal")
|
||||
CONFIDENTIAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationConfidential")
|
||||
SECRET
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationSecret")
|
||||
}
|
||||
|
||||
# Input Types
|
||||
@@ -2029,7 +2041,7 @@ type DeleteAssetPayload {
|
||||
type Datum implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
dataSensitivity: DataSensitivity!
|
||||
dataClassification: DataClassification!
|
||||
owner: People! @goField(forceResolver: true)
|
||||
vendors(
|
||||
first: Int
|
||||
@@ -2051,7 +2063,7 @@ input DatumOrder {
|
||||
input CreateDatumInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
dataSensitivity: DataSensitivity!
|
||||
dataClassification: DataClassification!
|
||||
ownerId: ID!
|
||||
vendorIds: [ID!]
|
||||
}
|
||||
@@ -2059,7 +2071,7 @@ input CreateDatumInput {
|
||||
input UpdateDatumInput {
|
||||
id: ID!
|
||||
name: String
|
||||
dataSensitivity: DataSensitivity
|
||||
dataClassification: DataClassification
|
||||
ownerId: ID
|
||||
vendorIds: [ID!]
|
||||
}
|
||||
|
||||
@@ -221,14 +221,14 @@ type ComplexityRoot struct {
|
||||
}
|
||||
|
||||
Datum struct {
|
||||
CreatedAt func(childComplexity int) int
|
||||
DataSensitivity func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
Name func(childComplexity int) int
|
||||
Organization func(childComplexity int) int
|
||||
Owner func(childComplexity int) int
|
||||
UpdatedAt func(childComplexity int) int
|
||||
Vendors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorOrderBy) int
|
||||
CreatedAt func(childComplexity int) int
|
||||
DataClassification func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
Name func(childComplexity int) int
|
||||
Organization func(childComplexity int) int
|
||||
Owner func(childComplexity int) int
|
||||
UpdatedAt func(childComplexity int) int
|
||||
Vendors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorOrderBy) int
|
||||
}
|
||||
|
||||
DatumConnection struct {
|
||||
@@ -1518,12 +1518,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
|
||||
return e.complexity.Datum.CreatedAt(childComplexity), true
|
||||
|
||||
case "Datum.dataSensitivity":
|
||||
if e.complexity.Datum.DataSensitivity == nil {
|
||||
case "Datum.dataClassification":
|
||||
if e.complexity.Datum.DataClassification == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Datum.DataSensitivity(childComplexity), true
|
||||
return e.complexity.Datum.DataClassification(childComplexity), true
|
||||
|
||||
case "Datum.id":
|
||||
if e.complexity.Datum.ID == nil {
|
||||
@@ -5061,7 +5061,19 @@ enum AssetOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.Ass
|
||||
enum DatumOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.DatumOrderField") {
|
||||
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
||||
NAME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldName")
|
||||
DATA_SENSITIVITY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldDataSensitivity")
|
||||
DATA_CLASSIFICATION @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldDataClassification")
|
||||
}
|
||||
|
||||
enum DataClassification
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.DataClassification") {
|
||||
PUBLIC
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationPublic")
|
||||
INTERNAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationInternal")
|
||||
CONFIDENTIAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationConfidential")
|
||||
SECRET
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataClassificationSecret")
|
||||
}
|
||||
|
||||
# Input Types
|
||||
@@ -6723,7 +6735,7 @@ type DeleteAssetPayload {
|
||||
type Datum implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
dataSensitivity: DataSensitivity!
|
||||
dataClassification: DataClassification!
|
||||
owner: People! @goField(forceResolver: true)
|
||||
vendors(
|
||||
first: Int
|
||||
@@ -6745,7 +6757,7 @@ input DatumOrder {
|
||||
input CreateDatumInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
dataSensitivity: DataSensitivity!
|
||||
dataClassification: DataClassification!
|
||||
ownerId: ID!
|
||||
vendorIds: [ID!]
|
||||
}
|
||||
@@ -6753,7 +6765,7 @@ input CreateDatumInput {
|
||||
input UpdateDatumInput {
|
||||
id: ID!
|
||||
name: String
|
||||
dataSensitivity: DataSensitivity
|
||||
dataClassification: DataClassification
|
||||
ownerId: ID
|
||||
vendorIds: [ID!]
|
||||
}
|
||||
@@ -14755,8 +14767,8 @@ func (ec *executionContext) fieldContext_Datum_name(_ context.Context, field gra
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Datum_dataSensitivity(ctx context.Context, field graphql.CollectedField, obj *types.Datum) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
||||
func (ec *executionContext) _Datum_dataClassification(ctx context.Context, field graphql.CollectedField, obj *types.Datum) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
@@ -14769,7 +14781,7 @@ func (ec *executionContext) _Datum_dataSensitivity(ctx context.Context, field gr
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.DataSensitivity, nil
|
||||
return obj.DataClassification, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
@@ -14781,19 +14793,19 @@ func (ec *executionContext) _Datum_dataSensitivity(ctx context.Context, field gr
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(coredata.DataSensitivity)
|
||||
res := resTmp.(coredata.DataClassification)
|
||||
fc.Result = res
|
||||
return ec.marshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx, field.Selections, res)
|
||||
return ec.marshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Datum_dataSensitivity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
func (ec *executionContext) fieldContext_Datum_dataClassification(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Datum",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type DataSensitivity does not have child fields")
|
||||
return nil, errors.New("field of type DataClassification does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
@@ -15285,8 +15297,8 @@ func (ec *executionContext) fieldContext_DatumEdge_node(_ context.Context, field
|
||||
return ec.fieldContext_Datum_id(ctx, field)
|
||||
case "name":
|
||||
return ec.fieldContext_Datum_name(ctx, field)
|
||||
case "dataSensitivity":
|
||||
return ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
||||
case "dataClassification":
|
||||
return ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||
case "owner":
|
||||
return ec.fieldContext_Datum_owner(ctx, field)
|
||||
case "vendors":
|
||||
@@ -29608,8 +29620,8 @@ func (ec *executionContext) fieldContext_UpdateDatumPayload_datum(_ context.Cont
|
||||
return ec.fieldContext_Datum_id(ctx, field)
|
||||
case "name":
|
||||
return ec.fieldContext_Datum_name(ctx, field)
|
||||
case "dataSensitivity":
|
||||
return ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
||||
case "dataClassification":
|
||||
return ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||
case "owner":
|
||||
return ec.fieldContext_Datum_owner(ctx, field)
|
||||
case "vendors":
|
||||
@@ -36225,7 +36237,7 @@ func (ec *executionContext) unmarshalInputCreateDatumInput(ctx context.Context,
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"organizationId", "name", "dataSensitivity", "ownerId", "vendorIds"}
|
||||
fieldsInOrder := [...]string{"organizationId", "name", "dataClassification", "ownerId", "vendorIds"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -36246,13 +36258,13 @@ func (ec *executionContext) unmarshalInputCreateDatumInput(ctx context.Context,
|
||||
return it, err
|
||||
}
|
||||
it.Name = data
|
||||
case "dataSensitivity":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSensitivity"))
|
||||
data, err := ec.unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx, v)
|
||||
case "dataClassification":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataClassification"))
|
||||
data, err := ec.unmarshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.DataSensitivity = data
|
||||
it.DataClassification = data
|
||||
case "ownerId":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
||||
data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
|
||||
@@ -38465,7 +38477,7 @@ func (ec *executionContext) unmarshalInputUpdateDatumInput(ctx context.Context,
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"id", "name", "dataSensitivity", "ownerId", "vendorIds"}
|
||||
fieldsInOrder := [...]string{"id", "name", "dataClassification", "ownerId", "vendorIds"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -38486,13 +38498,13 @@ func (ec *executionContext) unmarshalInputUpdateDatumInput(ctx context.Context,
|
||||
return it, err
|
||||
}
|
||||
it.Name = data
|
||||
case "dataSensitivity":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSensitivity"))
|
||||
data, err := ec.unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx, v)
|
||||
case "dataClassification":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataClassification"))
|
||||
data, err := ec.unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.DataSensitivity = data
|
||||
it.DataClassification = data
|
||||
case "ownerId":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
||||
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
|
||||
@@ -41109,8 +41121,8 @@ func (ec *executionContext) _Datum(ctx context.Context, sel ast.SelectionSet, ob
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "dataSensitivity":
|
||||
out.Values[i] = ec._Datum_dataSensitivity(ctx, field, obj)
|
||||
case "dataClassification":
|
||||
out.Values[i] = ec._Datum_dataClassification(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
@@ -49024,6 +49036,38 @@ func (ec *executionContext) marshalNCursorKey2githubᚗcomᚋgetproboᚋproboᚋ
|
||||
return res
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx context.Context, v any) (coredata.DataClassification, error) {
|
||||
tmp, err := graphql.UnmarshalString(v)
|
||||
res := unmarshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification[tmp]
|
||||
return res, graphql.ErrorOnPath(ctx, err)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx context.Context, sel ast.SelectionSet, v coredata.DataClassification) graphql.Marshaler {
|
||||
_ = sel
|
||||
res := graphql.MarshalString(marshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification[v])
|
||||
if res == graphql.Null {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
var (
|
||||
unmarshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[string]coredata.DataClassification{
|
||||
"PUBLIC": coredata.DataClassificationPublic,
|
||||
"INTERNAL": coredata.DataClassificationInternal,
|
||||
"CONFIDENTIAL": coredata.DataClassificationConfidential,
|
||||
"SECRET": coredata.DataClassificationSecret,
|
||||
}
|
||||
marshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[coredata.DataClassification]string{
|
||||
coredata.DataClassificationPublic: "PUBLIC",
|
||||
coredata.DataClassificationInternal: "INTERNAL",
|
||||
coredata.DataClassificationConfidential: "CONFIDENTIAL",
|
||||
coredata.DataClassificationSecret: "SECRET",
|
||||
}
|
||||
)
|
||||
|
||||
func (ec *executionContext) unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx context.Context, v any) (coredata.DataSensitivity, error) {
|
||||
tmp, err := graphql.UnmarshalString(v)
|
||||
res := unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity[tmp]
|
||||
@@ -49171,14 +49215,14 @@ func (ec *executionContext) marshalNDatumOrderField2githubᚗcomᚋgetproboᚋpr
|
||||
|
||||
var (
|
||||
unmarshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[string]coredata.DatumOrderField{
|
||||
"CREATED_AT": coredata.DatumOrderFieldCreatedAt,
|
||||
"NAME": coredata.DatumOrderFieldName,
|
||||
"DATA_SENSITIVITY": coredata.DatumOrderFieldDataSensitivity,
|
||||
"CREATED_AT": coredata.DatumOrderFieldCreatedAt,
|
||||
"NAME": coredata.DatumOrderFieldName,
|
||||
"DATA_CLASSIFICATION": coredata.DatumOrderFieldDataClassification,
|
||||
}
|
||||
marshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[coredata.DatumOrderField]string{
|
||||
coredata.DatumOrderFieldCreatedAt: "CREATED_AT",
|
||||
coredata.DatumOrderFieldName: "NAME",
|
||||
coredata.DatumOrderFieldDataSensitivity: "DATA_SENSITIVITY",
|
||||
coredata.DatumOrderFieldCreatedAt: "CREATED_AT",
|
||||
coredata.DatumOrderFieldName: "NAME",
|
||||
coredata.DatumOrderFieldDataClassification: "DATA_CLASSIFICATION",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -52369,39 +52413,37 @@ func (ec *executionContext) marshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋprobo
|
||||
return res
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx context.Context, v any) (*coredata.DataSensitivity, error) {
|
||||
func (ec *executionContext) unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx context.Context, v any) (*coredata.DataClassification, error) {
|
||||
if v == nil {
|
||||
return nil, nil
|
||||
}
|
||||
tmp, err := graphql.UnmarshalString(v)
|
||||
res := unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity[tmp]
|
||||
res := unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification[tmp]
|
||||
return &res, graphql.ErrorOnPath(ctx, err)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx context.Context, sel ast.SelectionSet, v *coredata.DataSensitivity) graphql.Marshaler {
|
||||
func (ec *executionContext) marshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx context.Context, sel ast.SelectionSet, v *coredata.DataClassification) graphql.Marshaler {
|
||||
if v == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
_ = sel
|
||||
_ = ctx
|
||||
res := graphql.MarshalString(marshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity[*v])
|
||||
res := graphql.MarshalString(marshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification[*v])
|
||||
return res
|
||||
}
|
||||
|
||||
var (
|
||||
unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity = map[string]coredata.DataSensitivity{
|
||||
"NONE": coredata.DataSensitivityNone,
|
||||
"LOW": coredata.DataSensitivityLow,
|
||||
"MEDIUM": coredata.DataSensitivityMedium,
|
||||
"HIGH": coredata.DataSensitivityHigh,
|
||||
"CRITICAL": coredata.DataSensitivityCritical,
|
||||
unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[string]coredata.DataClassification{
|
||||
"PUBLIC": coredata.DataClassificationPublic,
|
||||
"INTERNAL": coredata.DataClassificationInternal,
|
||||
"CONFIDENTIAL": coredata.DataClassificationConfidential,
|
||||
"SECRET": coredata.DataClassificationSecret,
|
||||
}
|
||||
marshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity = map[coredata.DataSensitivity]string{
|
||||
coredata.DataSensitivityNone: "NONE",
|
||||
coredata.DataSensitivityLow: "LOW",
|
||||
coredata.DataSensitivityMedium: "MEDIUM",
|
||||
coredata.DataSensitivityHigh: "HIGH",
|
||||
coredata.DataSensitivityCritical: "CRITICAL",
|
||||
marshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[coredata.DataClassification]string{
|
||||
coredata.DataClassificationPublic: "PUBLIC",
|
||||
coredata.DataClassificationInternal: "INTERNAL",
|
||||
coredata.DataClassificationConfidential: "CONFIDENTIAL",
|
||||
coredata.DataClassificationSecret: "SECRET",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
@@ -7,12 +21,12 @@ import (
|
||||
|
||||
func NewDatum(d *coredata.Data) *Datum {
|
||||
return &Datum{
|
||||
ID: d.ID,
|
||||
Name: d.Name,
|
||||
DataSensitivity: d.DataSensitivity,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
Organization: &Organization{ID: d.OrganizationID},
|
||||
ID: d.ID,
|
||||
Name: d.Name,
|
||||
DataClassification: d.DataClassification,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
Organization: &Organization{ID: d.OrganizationID},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -176,11 +176,11 @@ type CreateControlPayload struct {
|
||||
}
|
||||
|
||||
type CreateDatumInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
||||
OwnerID gid.GID `json:"ownerId"`
|
||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
DataClassification coredata.DataClassification `json:"dataClassification"`
|
||||
OwnerID gid.GID `json:"ownerId"`
|
||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||
}
|
||||
|
||||
type CreateDatumPayload struct {
|
||||
@@ -357,14 +357,14 @@ type CreateVendorRiskAssessmentPayload struct {
|
||||
}
|
||||
|
||||
type Datum struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
||||
Owner *People `json:"owner"`
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
Organization *Organization `json:"organization"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DataClassification coredata.DataClassification `json:"dataClassification"`
|
||||
Owner *People `json:"owner"`
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
Organization *Organization `json:"organization"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Datum) IsNode() {}
|
||||
@@ -972,11 +972,11 @@ type UpdateControlPayload struct {
|
||||
}
|
||||
|
||||
type UpdateDatumInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
DataSensitivity *coredata.DataSensitivity `json:"dataSensitivity,omitempty"`
|
||||
OwnerID *gid.GID `json:"ownerId,omitempty"`
|
||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
DataClassification *coredata.DataClassification `json:"dataClassification,omitempty"`
|
||||
OwnerID *gid.GID `json:"ownerId,omitempty"`
|
||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateDatumPayload struct {
|
||||
|
||||
@@ -1844,11 +1844,11 @@ func (r *mutationResolver) CreateDatum(ctx context.Context, input types.CreateDa
|
||||
svc := GetTenantService(ctx, r.proboSvc, input.OrganizationID.TenantID())
|
||||
|
||||
data, err := svc.Data.Create(ctx, probo.CreateDatumRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Name: input.Name,
|
||||
DataSensitivity: input.DataSensitivity,
|
||||
OwnerID: input.OwnerID,
|
||||
VendorIDs: input.VendorIds,
|
||||
OrganizationID: input.OrganizationID,
|
||||
Name: input.Name,
|
||||
DataClassification: input.DataClassification,
|
||||
OwnerID: input.OwnerID,
|
||||
VendorIDs: input.VendorIds,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@@ -1865,11 +1865,11 @@ func (r *mutationResolver) UpdateDatum(ctx context.Context, input types.UpdateDa
|
||||
svc := GetTenantService(ctx, r.proboSvc, input.ID.TenantID())
|
||||
|
||||
datum, err := svc.Data.Update(ctx, probo.UpdateDatumRequest{
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
DataSensitivity: input.DataSensitivity,
|
||||
OwnerID: input.OwnerID,
|
||||
VendorIDs: input.VendorIds,
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
DataClassification: input.DataClassification,
|
||||
OwnerID: input.OwnerID,
|
||||
VendorIDs: input.VendorIds,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user