@@ -60,7 +60,7 @@ const dataListFragment = graphql`
|
|||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataSensitivity
|
dataClassification
|
||||||
owner {
|
owner {
|
||||||
id
|
id
|
||||||
fullName
|
fullName
|
||||||
@@ -236,29 +236,27 @@ function DataListContent({
|
|||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Badge
|
<Badge
|
||||||
variant={
|
variant={
|
||||||
item?.dataSensitivity === "NONE"
|
item?.dataClassification === "PUBLIC"
|
||||||
? "default"
|
? "default"
|
||||||
: item?.dataSensitivity === "LOW"
|
: item?.dataClassification === "INTERNAL"
|
||||||
? "success"
|
? "success"
|
||||||
: item?.dataSensitivity === "MEDIUM"
|
: item?.dataClassification === "CONFIDENTIAL"
|
||||||
? "info"
|
? "info"
|
||||||
: item?.dataSensitivity === "HIGH"
|
: item?.dataClassification === "SECRET"
|
||||||
? "warning"
|
? "warning"
|
||||||
: "destructive"
|
: "destructive"
|
||||||
}
|
}
|
||||||
className="px-3 py-0.5 text-xs font-medium"
|
className="px-3 py-0.5 text-xs font-medium"
|
||||||
>
|
>
|
||||||
{item?.dataSensitivity === "NONE"
|
{item?.dataClassification === "PUBLIC"
|
||||||
? "No sensitive data"
|
? "Public"
|
||||||
: item?.dataSensitivity === "LOW"
|
: item?.dataClassification === "INTERNAL"
|
||||||
? "Public or non-sensitive data"
|
? "Internal"
|
||||||
: item?.dataSensitivity === "MEDIUM"
|
: item?.dataClassification === "CONFIDENTIAL"
|
||||||
? "Internal/restricted data"
|
? "Confidential"
|
||||||
: item?.dataSensitivity === "HIGH"
|
: item?.dataClassification === "SECRET"
|
||||||
? "Confidential data"
|
? "Secret"
|
||||||
: item?.dataSensitivity === "CRITICAL"
|
: "Unknown"}
|
||||||
? "Regulated/PII/financial data"
|
|
||||||
: "No sensitive data"}
|
|
||||||
</Badge>
|
</Badge>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
useMutation,
|
useMutation,
|
||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
import { Suspense, useEffect, useState, useCallback } from "react";
|
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 { useParams } from "react-router";
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { DatumViewSkeleton } from "./DatumPage";
|
import { DatumViewSkeleton } from "./DatumPage";
|
||||||
@@ -35,7 +35,7 @@ const datumViewQuery = graphql`
|
|||||||
... on Datum {
|
... on Datum {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataSensitivity
|
dataClassification
|
||||||
vendors {
|
vendors {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
@@ -75,7 +75,7 @@ const updateDatumMutation = graphql`
|
|||||||
datum {
|
datum {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataSensitivity
|
dataClassification
|
||||||
vendors {
|
vendors {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
@@ -93,13 +93,13 @@ const updateDatumMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
type DataSensitivity = "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
|
// type DataClassification = "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET";
|
||||||
|
|
||||||
interface Datum {
|
interface Datum {
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
readonly dataSensitivity?: DataSensitivity;
|
readonly dataClassification?: DataClassification;
|
||||||
readonly owner?: {
|
readonly owner?: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly fullName: string;
|
readonly fullName: string;
|
||||||
@@ -171,7 +171,7 @@ function DatumViewContent({
|
|||||||
const organization = data.organization as Organization;
|
const organization = data.organization as Organization;
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: datum?.name || "",
|
name: datum?.name || "",
|
||||||
dataSensitivity: datum?.dataSensitivity || "NONE",
|
dataClassification: datum?.dataClassification || "INTERNAL",
|
||||||
ownerId: datum?.owner?.id || "",
|
ownerId: datum?.owner?.id || "",
|
||||||
selectedVendorIds: datum?.vendors?.edges?.map(edge => edge?.node?.id).filter((id): id is string => id != null) || [],
|
selectedVendorIds: datum?.vendors?.edges?.map(edge => edge?.node?.id).filter((id): id is string => id != null) || [],
|
||||||
});
|
});
|
||||||
@@ -188,7 +188,7 @@ function DatumViewContent({
|
|||||||
input: {
|
input: {
|
||||||
id: nodeId,
|
id: nodeId,
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
dataSensitivity: formData.dataSensitivity,
|
dataClassification: formData.dataClassification,
|
||||||
ownerId: formData.ownerId,
|
ownerId: formData.ownerId,
|
||||||
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
||||||
},
|
},
|
||||||
@@ -233,7 +233,7 @@ function DatumViewContent({
|
|||||||
const datum = data.node as Datum | null;
|
const datum = data.node as Datum | null;
|
||||||
setFormData({
|
setFormData({
|
||||||
name: datum?.name || "",
|
name: datum?.name || "",
|
||||||
dataSensitivity: datum?.dataSensitivity || "NONE",
|
dataClassification: datum?.dataClassification || "INTERNAL",
|
||||||
ownerId: datum?.owner?.id || "",
|
ownerId: datum?.owner?.id || "",
|
||||||
selectedVendorIds: datum?.vendors?.edges?.map(edge => edge?.node?.id).filter((id): id is string => id != null) || [],
|
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>
|
<Label className="text-sm">Data Sensitivity</Label>
|
||||||
</div>
|
</div>
|
||||||
<Select
|
<Select
|
||||||
value={formData.dataSensitivity}
|
value={formData.dataClassification}
|
||||||
onValueChange={(value) => handleFieldChange("dataSensitivity", value)}
|
onValueChange={(value) => handleFieldChange("dataClassification", value)}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="w-full">
|
<SelectTrigger className="w-full">
|
||||||
<SelectValue placeholder="Select data sensitivity" />
|
<SelectValue placeholder="Select data sensitivity" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="NONE">No sensitive data</SelectItem>
|
<SelectItem value="PUBLIC">Public</SelectItem>
|
||||||
<SelectItem value="LOW">Public or non-sensitive data</SelectItem>
|
<SelectItem value="INTERNAL">Internal</SelectItem>
|
||||||
<SelectItem value="MEDIUM">Internal/restricted data</SelectItem>
|
<SelectItem value="CONFIDENTIAL">Confidential</SelectItem>
|
||||||
<SelectItem value="HIGH">Confidential data</SelectItem>
|
<SelectItem value="SECRET">Secret</SelectItem>
|
||||||
<SelectItem value="CRITICAL">Regulated/PII/financial data</SelectItem>
|
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const createDatumMutation = graphql`
|
|||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataSensitivity
|
dataClassification
|
||||||
owner {
|
owner {
|
||||||
id
|
id
|
||||||
fullName
|
fullName
|
||||||
@@ -129,7 +129,7 @@ function NewDataViewContent({
|
|||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: "",
|
name: "",
|
||||||
dataSensitivity: "NONE" as "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL",
|
dataClassification: "INTERNAL" as "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET",
|
||||||
ownerId: "",
|
ownerId: "",
|
||||||
selectedVendorIds: [] as string[],
|
selectedVendorIds: [] as string[],
|
||||||
});
|
});
|
||||||
@@ -184,7 +184,7 @@ function NewDataViewContent({
|
|||||||
input: {
|
input: {
|
||||||
organizationId: organizationId!,
|
organizationId: organizationId!,
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
dataSensitivity: formData.dataSensitivity,
|
dataClassification: formData.dataClassification,
|
||||||
ownerId: formData.ownerId,
|
ownerId: formData.ownerId,
|
||||||
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
vendorIds: formData.selectedVendorIds.length > 0 ? formData.selectedVendorIds : undefined,
|
||||||
} satisfies CreateDatumInput,
|
} satisfies CreateDatumInput,
|
||||||
@@ -278,19 +278,18 @@ function NewDataViewContent({
|
|||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label className="text-sm">Data Sensitivity</Label>
|
<Label className="text-sm">Data Sensitivity</Label>
|
||||||
<Select
|
<Select
|
||||||
value={formData.dataSensitivity}
|
value={formData.dataClassification}
|
||||||
onValueChange={(value: string) =>
|
onValueChange={(value: string) =>
|
||||||
handleFieldChange("dataSensitivity", value as "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL")}
|
handleFieldChange("dataClassification", value as "PUBLIC" | "INTERNAL" | "CONFIDENTIAL" | "SECRET")}
|
||||||
>
|
>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select data sensitivity" />
|
<SelectValue placeholder="Select data sensitivity" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="NONE">No sensitive data</SelectItem>
|
<SelectItem value="PUBLIC">Public</SelectItem>
|
||||||
<SelectItem value="LOW">Public or non-sensitive data</SelectItem>
|
<SelectItem value="INTERNAL">Internal</SelectItem>
|
||||||
<SelectItem value="MEDIUM">Internal/restricted data</SelectItem>
|
<SelectItem value="CONFIDENTIAL">Confidential</SelectItem>
|
||||||
<SelectItem value="HIGH">Confidential data</SelectItem>
|
<SelectItem value="SECRET">Secret</SelectItem>
|
||||||
<SelectItem value="CRITICAL">Regulated/PII/financial data</SelectItem>
|
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<9fb6bfbd0ba80aa33ef3d8edfdb53a19>>
|
* @generated SignedSource<<390d190ae303b0edd4858bc50f58c048>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -208,7 +208,7 @@ return {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -368,16 +368,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "1a9be11b8d32e569f75ae591226e7b8b",
|
"cacheID": "7a663a198e00b6cc15d889565e48f4e2",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "DataListViewPaginationQuery",
|
"name": "DataListViewPaginationQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<905fb20472d2c30aabb9a9afc41acf41>>
|
* @generated SignedSource<<f5c4ef95583024470ef959e39f4452a2>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -208,7 +208,7 @@ return {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -368,12 +368,12 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "0c5725c38efb32dc65674c4bbd8dd154",
|
"cacheID": "164b5819fe6d186b9baa512c67b59e9a",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "DataListViewQuery",
|
"name": "DataListViewQuery",
|
||||||
"operationKind": "query",
|
"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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ReaderFragment } from 'relay-runtime';
|
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";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type DataListView_data$data = {
|
export type DataListView_data$data = {
|
||||||
readonly data: {
|
readonly data: {
|
||||||
@@ -17,7 +17,7 @@ export type DataListView_data$data = {
|
|||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly createdAt: string;
|
readonly createdAt: string;
|
||||||
readonly dataSensitivity: DataSensitivity;
|
readonly dataClassification: DataClassification;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly owner: {
|
readonly owner: {
|
||||||
@@ -165,7 +165,7 @@ return {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -316,6 +316,6 @@ return {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "d1b1652f1f59c091709bce823b6a0eaa";
|
(node as any).hash = "b8465a1295d6d7351cee98f2e4f9756a";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<272734160b60bf94a6f031e685751b64>>
|
* @generated SignedSource<<435da2b0f7d8b9ec259d386a752c18b7>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
import { FragmentRefs } 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 = {
|
export type DatumViewQuery$variables = {
|
||||||
datumId: string;
|
datumId: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
@@ -18,7 +18,7 @@ export type DatumViewQuery$variables = {
|
|||||||
export type DatumViewQuery$data = {
|
export type DatumViewQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly createdAt?: string;
|
readonly createdAt?: string;
|
||||||
readonly dataSensitivity?: DataSensitivity;
|
readonly dataClassification?: DataClassification;
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
readonly owner?: {
|
readonly owner?: {
|
||||||
@@ -91,7 +91,7 @@ v4 = {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v5 = {
|
v5 = {
|
||||||
@@ -469,7 +469,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "c3fd8609637a69d90a532344150b4d6a",
|
"cacheID": "958954258516869d985feedba1cf9db3",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -486,11 +486,11 @@ return {
|
|||||||
},
|
},
|
||||||
"name": "DatumViewQuery",
|
"name": "DatumViewQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<4aa66259b93ace779a3e38430cf8c1ee>>
|
* @generated SignedSource<<6a2c795f1b3328794d9e3db73151feaa>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||||
export type UpdateDatumInput = {
|
export type UpdateDatumInput = {
|
||||||
dataSensitivity?: DataSensitivity | null | undefined;
|
dataClassification?: DataClassification | null | undefined;
|
||||||
id: string;
|
id: string;
|
||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
ownerId?: string | null | undefined;
|
ownerId?: string | null | undefined;
|
||||||
@@ -23,7 +23,7 @@ export type DatumViewUpdateDatumMutation$variables = {
|
|||||||
export type DatumViewUpdateDatumMutation$data = {
|
export type DatumViewUpdateDatumMutation$data = {
|
||||||
readonly updateDatum: {
|
readonly updateDatum: {
|
||||||
readonly datum: {
|
readonly datum: {
|
||||||
readonly dataSensitivity: DataSensitivity;
|
readonly dataClassification: DataClassification;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly owner: {
|
readonly owner: {
|
||||||
@@ -96,7 +96,7 @@ v2 = [
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -184,16 +184,16 @@ return {
|
|||||||
"selections": (v2/*: any*/)
|
"selections": (v2/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "1e5b2489558fef74becf57d2457a4891",
|
"cacheID": "ec5c79edccc379aae627f969ec18c55e",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "DatumViewUpdateDatumMutation",
|
"name": "DatumViewUpdateDatumMutation",
|
||||||
"operationKind": "mutation",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<5b93fe65ad69563bbcb6e75d0b913eb8>>
|
* @generated SignedSource<<87179d28750a2a84a6c1ea1b779cbd49>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type DataSensitivity = "CRITICAL" | "HIGH" | "LOW" | "MEDIUM" | "NONE";
|
export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET";
|
||||||
export type CreateDatumInput = {
|
export type CreateDatumInput = {
|
||||||
dataSensitivity: DataSensitivity;
|
dataClassification: DataClassification;
|
||||||
name: string;
|
name: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
ownerId: string;
|
ownerId: string;
|
||||||
@@ -25,7 +25,7 @@ export type NewDatumViewCreateDatumMutation$data = {
|
|||||||
readonly createDatum: {
|
readonly createDatum: {
|
||||||
readonly datumEdge: {
|
readonly datumEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly dataSensitivity: DataSensitivity;
|
readonly dataClassification: DataClassification;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly owner: {
|
readonly owner: {
|
||||||
@@ -103,7 +103,7 @@ v5 = {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dataSensitivity",
|
"name": "dataClassification",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -232,16 +232,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "0ab550803b091f5dfa1935f810eaecdc",
|
"cacheID": "1349272a7b0c9f14ee6e257f66ad5cea",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "NewDatumViewCreateDatumMutation",
|
"name": "NewDatumViewCreateDatumMutation",
|
||||||
"operationKind": "mutation",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Data struct {
|
type Data struct {
|
||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
OrganizationID gid.GID `db:"organization_id"`
|
OrganizationID gid.GID `db:"organization_id"`
|
||||||
OwnerID gid.GID `db:"owner_id"`
|
OwnerID gid.GID `db:"owner_id"`
|
||||||
DataSensitivity DataSensitivity `db:"data_sensitivity"`
|
DataClassification DataClassification `db:"data_classification"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
UpdatedAt time.Time `db:"updated_at"`
|
UpdatedAt time.Time `db:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Data) CursorKey(field DatumOrderField) page.CursorKey {
|
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)
|
return page.NewCursorKey(d.ID, d.CreatedAt)
|
||||||
case DatumOrderFieldName:
|
case DatumOrderFieldName:
|
||||||
return page.NewCursorKey(d.ID, d.Name)
|
return page.NewCursorKey(d.ID, d.Name)
|
||||||
case DatumOrderFieldDataSensitivity:
|
case DatumOrderFieldDataClassification:
|
||||||
return page.NewCursorKey(d.ID, d.DataSensitivity)
|
return page.NewCursorKey(d.ID, d.DataClassification)
|
||||||
}
|
}
|
||||||
|
|
||||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||||
@@ -63,7 +63,7 @@ SELECT
|
|||||||
name,
|
name,
|
||||||
owner_id,
|
owner_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
@@ -105,7 +105,7 @@ SELECT
|
|||||||
name,
|
name,
|
||||||
owner_id,
|
owner_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
@@ -148,7 +148,7 @@ SELECT
|
|||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
owner_id,
|
owner_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
@@ -193,7 +193,7 @@ SELECT
|
|||||||
name,
|
name,
|
||||||
organization_id,
|
organization_id,
|
||||||
owner_id,
|
owner_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
@@ -237,7 +237,7 @@ INSERT INTO data (
|
|||||||
name,
|
name,
|
||||||
owner_id,
|
owner_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
) VALUES (
|
) VALUES (
|
||||||
@@ -246,21 +246,21 @@ INSERT INTO data (
|
|||||||
@name,
|
@name,
|
||||||
@owner_id,
|
@owner_id,
|
||||||
@organization_id,
|
@organization_id,
|
||||||
@data_sensitivity,
|
@data_classification,
|
||||||
@created_at,
|
@created_at,
|
||||||
@updated_at
|
@updated_at
|
||||||
)
|
)
|
||||||
`
|
`
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"id": d.ID,
|
"id": d.ID,
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"name": d.Name,
|
"name": d.Name,
|
||||||
"owner_id": d.OwnerID,
|
"owner_id": d.OwnerID,
|
||||||
"organization_id": d.OrganizationID,
|
"organization_id": d.OrganizationID,
|
||||||
"data_sensitivity": d.DataSensitivity,
|
"data_classification": d.DataClassification,
|
||||||
"created_at": d.CreatedAt,
|
"created_at": d.CreatedAt,
|
||||||
"updated_at": d.UpdatedAt,
|
"updated_at": d.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := conn.Exec(ctx, q, args)
|
_, err := conn.Exec(ctx, q, args)
|
||||||
@@ -281,7 +281,7 @@ UPDATE data
|
|||||||
SET
|
SET
|
||||||
name = @name,
|
name = @name,
|
||||||
owner_id = @owner_id,
|
owner_id = @owner_id,
|
||||||
data_sensitivity = @data_sensitivity,
|
data_classification = @data_classification,
|
||||||
updated_at = @updated_at
|
updated_at = @updated_at
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
@@ -291,7 +291,7 @@ RETURNING
|
|||||||
name,
|
name,
|
||||||
owner_id,
|
owner_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
data_sensitivity,
|
data_classification,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
`
|
`
|
||||||
@@ -299,11 +299,11 @@ RETURNING
|
|||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"id": d.ID,
|
"id": d.ID,
|
||||||
"name": d.Name,
|
"name": d.Name,
|
||||||
"owner_id": d.OwnerID,
|
"owner_id": d.OwnerID,
|
||||||
"data_sensitivity": d.DataSensitivity,
|
"data_classification": d.DataClassification,
|
||||||
"updated_at": time.Now(),
|
"updated_at": time.Now(),
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
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
|
type DatumOrderField string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DatumOrderFieldCreatedAt DatumOrderField = "CREATED_AT"
|
DatumOrderFieldCreatedAt DatumOrderField = "CREATED_AT"
|
||||||
DatumOrderFieldName DatumOrderField = "NAME"
|
DatumOrderFieldName DatumOrderField = "NAME"
|
||||||
DatumOrderFieldDataSensitivity DatumOrderField = "DATA_SENSITIVITY"
|
DatumOrderFieldDataClassification DatumOrderField = "DATA_CLASSIFICATION"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p DatumOrderField) Column() string {
|
func (p DatumOrderField) Column() string {
|
||||||
@@ -43,7 +43,7 @@ func (p *DatumOrderField) UnmarshalText(text []byte) error {
|
|||||||
switch val {
|
switch val {
|
||||||
case string(DatumOrderFieldCreatedAt),
|
case string(DatumOrderFieldCreatedAt),
|
||||||
string(DatumOrderFieldName),
|
string(DatumOrderFieldName),
|
||||||
string(DatumOrderFieldDataSensitivity):
|
string(DatumOrderFieldDataClassification):
|
||||||
*p = DatumOrderField(val)
|
*p = DatumOrderField(val)
|
||||||
return nil
|
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 {
|
type CreateDatumRequest struct {
|
||||||
OrganizationID gid.GID
|
OrganizationID gid.GID
|
||||||
Name string
|
Name string
|
||||||
DataSensitivity coredata.DataSensitivity
|
DataClassification coredata.DataClassification
|
||||||
OwnerID gid.GID
|
OwnerID gid.GID
|
||||||
VendorIDs []gid.GID
|
VendorIDs []gid.GID
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDatumRequest struct {
|
type UpdateDatumRequest struct {
|
||||||
ID gid.GID
|
ID gid.GID
|
||||||
Name *string
|
Name *string
|
||||||
DataSensitivity *coredata.DataSensitivity
|
DataClassification *coredata.DataClassification
|
||||||
OwnerID *gid.GID
|
OwnerID *gid.GID
|
||||||
VendorIDs []gid.GID
|
VendorIDs []gid.GID
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s DatumService) Get(
|
func (s DatumService) Get(
|
||||||
@@ -126,21 +126,21 @@ func (s DatumService) Update(
|
|||||||
}
|
}
|
||||||
|
|
||||||
datum := &coredata.Data{
|
datum := &coredata.Data{
|
||||||
ID: req.ID,
|
ID: req.ID,
|
||||||
OrganizationID: existing.OrganizationID,
|
OrganizationID: existing.OrganizationID,
|
||||||
Name: existing.Name,
|
Name: existing.Name,
|
||||||
DataSensitivity: existing.DataSensitivity,
|
DataClassification: existing.DataClassification,
|
||||||
OwnerID: existing.OwnerID,
|
OwnerID: existing.OwnerID,
|
||||||
CreatedAt: existing.CreatedAt,
|
CreatedAt: existing.CreatedAt,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update fields from request
|
// Update fields from request
|
||||||
if req.Name != nil {
|
if req.Name != nil {
|
||||||
datum.Name = *req.Name
|
datum.Name = *req.Name
|
||||||
}
|
}
|
||||||
if req.DataSensitivity != nil {
|
if req.DataClassification != nil {
|
||||||
datum.DataSensitivity = *req.DataSensitivity
|
datum.DataClassification = *req.DataClassification
|
||||||
}
|
}
|
||||||
if req.OwnerID != nil {
|
if req.OwnerID != nil {
|
||||||
datum.OwnerID = *req.OwnerID
|
datum.OwnerID = *req.OwnerID
|
||||||
@@ -161,13 +161,13 @@ func (s DatumService) Create(
|
|||||||
datumID := gid.New(s.svc.scope.GetTenantID(), coredata.DatumEntityType)
|
datumID := gid.New(s.svc.scope.GetTenantID(), coredata.DatumEntityType)
|
||||||
|
|
||||||
datum := &coredata.Data{
|
datum := &coredata.Data{
|
||||||
ID: datumID,
|
ID: datumID,
|
||||||
OrganizationID: req.OrganizationID,
|
OrganizationID: req.OrganizationID,
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
DataSensitivity: req.DataSensitivity,
|
DataClassification: req.DataClassification,
|
||||||
OwnerID: req.OwnerID,
|
OwnerID: req.OwnerID,
|
||||||
CreatedAt: now,
|
CreatedAt: now,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.svc.pg.WithTx(
|
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") {
|
enum DatumOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.DatumOrderField") {
|
||||||
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
||||||
NAME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldName")
|
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
|
# Input Types
|
||||||
@@ -2029,7 +2041,7 @@ type DeleteAssetPayload {
|
|||||||
type Datum implements Node {
|
type Datum implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
dataSensitivity: DataSensitivity!
|
dataClassification: DataClassification!
|
||||||
owner: People! @goField(forceResolver: true)
|
owner: People! @goField(forceResolver: true)
|
||||||
vendors(
|
vendors(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -2051,7 +2063,7 @@ input DatumOrder {
|
|||||||
input CreateDatumInput {
|
input CreateDatumInput {
|
||||||
organizationId: ID!
|
organizationId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
dataSensitivity: DataSensitivity!
|
dataClassification: DataClassification!
|
||||||
ownerId: ID!
|
ownerId: ID!
|
||||||
vendorIds: [ID!]
|
vendorIds: [ID!]
|
||||||
}
|
}
|
||||||
@@ -2059,7 +2071,7 @@ input CreateDatumInput {
|
|||||||
input UpdateDatumInput {
|
input UpdateDatumInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
dataSensitivity: DataSensitivity
|
dataClassification: DataClassification
|
||||||
ownerId: ID
|
ownerId: ID
|
||||||
vendorIds: [ID!]
|
vendorIds: [ID!]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,14 +221,14 @@ type ComplexityRoot struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Datum struct {
|
Datum struct {
|
||||||
CreatedAt func(childComplexity int) int
|
CreatedAt func(childComplexity int) int
|
||||||
DataSensitivity func(childComplexity int) int
|
DataClassification func(childComplexity int) int
|
||||||
ID func(childComplexity int) int
|
ID func(childComplexity int) int
|
||||||
Name func(childComplexity int) int
|
Name func(childComplexity int) int
|
||||||
Organization func(childComplexity int) int
|
Organization func(childComplexity int) int
|
||||||
Owner func(childComplexity int) int
|
Owner func(childComplexity int) int
|
||||||
UpdatedAt 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
|
Vendors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorOrderBy) int
|
||||||
}
|
}
|
||||||
|
|
||||||
DatumConnection struct {
|
DatumConnection struct {
|
||||||
@@ -1518,12 +1518,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
|
|
||||||
return e.complexity.Datum.CreatedAt(childComplexity), true
|
return e.complexity.Datum.CreatedAt(childComplexity), true
|
||||||
|
|
||||||
case "Datum.dataSensitivity":
|
case "Datum.dataClassification":
|
||||||
if e.complexity.Datum.DataSensitivity == nil {
|
if e.complexity.Datum.DataClassification == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.Datum.DataSensitivity(childComplexity), true
|
return e.complexity.Datum.DataClassification(childComplexity), true
|
||||||
|
|
||||||
case "Datum.id":
|
case "Datum.id":
|
||||||
if e.complexity.Datum.ID == nil {
|
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") {
|
enum DatumOrderField @goModel(model: "github.com/getprobo/probo/pkg/coredata.DatumOrderField") {
|
||||||
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
CREATED_AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldCreatedAt")
|
||||||
NAME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.DatumOrderFieldName")
|
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
|
# Input Types
|
||||||
@@ -6723,7 +6735,7 @@ type DeleteAssetPayload {
|
|||||||
type Datum implements Node {
|
type Datum implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
dataSensitivity: DataSensitivity!
|
dataClassification: DataClassification!
|
||||||
owner: People! @goField(forceResolver: true)
|
owner: People! @goField(forceResolver: true)
|
||||||
vendors(
|
vendors(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -6745,7 +6757,7 @@ input DatumOrder {
|
|||||||
input CreateDatumInput {
|
input CreateDatumInput {
|
||||||
organizationId: ID!
|
organizationId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
dataSensitivity: DataSensitivity!
|
dataClassification: DataClassification!
|
||||||
ownerId: ID!
|
ownerId: ID!
|
||||||
vendorIds: [ID!]
|
vendorIds: [ID!]
|
||||||
}
|
}
|
||||||
@@ -6753,7 +6765,7 @@ input CreateDatumInput {
|
|||||||
input UpdateDatumInput {
|
input UpdateDatumInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
dataSensitivity: DataSensitivity
|
dataClassification: DataClassification
|
||||||
ownerId: ID
|
ownerId: ID
|
||||||
vendorIds: [ID!]
|
vendorIds: [ID!]
|
||||||
}
|
}
|
||||||
@@ -14755,8 +14767,8 @@ func (ec *executionContext) fieldContext_Datum_name(_ context.Context, field gra
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _Datum_dataSensitivity(ctx context.Context, field graphql.CollectedField, obj *types.Datum) (ret graphql.Marshaler) {
|
func (ec *executionContext) _Datum_dataClassification(ctx context.Context, field graphql.CollectedField, obj *types.Datum) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
fc, err := ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return graphql.Null
|
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) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return obj.DataSensitivity, nil
|
return obj.DataClassification, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -14781,19 +14793,19 @@ func (ec *executionContext) _Datum_dataSensitivity(ctx context.Context, field gr
|
|||||||
}
|
}
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(coredata.DataSensitivity)
|
res := resTmp.(coredata.DataClassification)
|
||||||
fc.Result = res
|
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{
|
fc = &graphql.FieldContext{
|
||||||
Object: "Datum",
|
Object: "Datum",
|
||||||
Field: field,
|
Field: field,
|
||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
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
|
return fc, nil
|
||||||
@@ -15285,8 +15297,8 @@ func (ec *executionContext) fieldContext_DatumEdge_node(_ context.Context, field
|
|||||||
return ec.fieldContext_Datum_id(ctx, field)
|
return ec.fieldContext_Datum_id(ctx, field)
|
||||||
case "name":
|
case "name":
|
||||||
return ec.fieldContext_Datum_name(ctx, field)
|
return ec.fieldContext_Datum_name(ctx, field)
|
||||||
case "dataSensitivity":
|
case "dataClassification":
|
||||||
return ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
return ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||||
case "owner":
|
case "owner":
|
||||||
return ec.fieldContext_Datum_owner(ctx, field)
|
return ec.fieldContext_Datum_owner(ctx, field)
|
||||||
case "vendors":
|
case "vendors":
|
||||||
@@ -29608,8 +29620,8 @@ func (ec *executionContext) fieldContext_UpdateDatumPayload_datum(_ context.Cont
|
|||||||
return ec.fieldContext_Datum_id(ctx, field)
|
return ec.fieldContext_Datum_id(ctx, field)
|
||||||
case "name":
|
case "name":
|
||||||
return ec.fieldContext_Datum_name(ctx, field)
|
return ec.fieldContext_Datum_name(ctx, field)
|
||||||
case "dataSensitivity":
|
case "dataClassification":
|
||||||
return ec.fieldContext_Datum_dataSensitivity(ctx, field)
|
return ec.fieldContext_Datum_dataClassification(ctx, field)
|
||||||
case "owner":
|
case "owner":
|
||||||
return ec.fieldContext_Datum_owner(ctx, field)
|
return ec.fieldContext_Datum_owner(ctx, field)
|
||||||
case "vendors":
|
case "vendors":
|
||||||
@@ -36225,7 +36237,7 @@ func (ec *executionContext) unmarshalInputCreateDatumInput(ctx context.Context,
|
|||||||
asMap[k] = v
|
asMap[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldsInOrder := [...]string{"organizationId", "name", "dataSensitivity", "ownerId", "vendorIds"}
|
fieldsInOrder := [...]string{"organizationId", "name", "dataClassification", "ownerId", "vendorIds"}
|
||||||
for _, k := range fieldsInOrder {
|
for _, k := range fieldsInOrder {
|
||||||
v, ok := asMap[k]
|
v, ok := asMap[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -36246,13 +36258,13 @@ func (ec *executionContext) unmarshalInputCreateDatumInput(ctx context.Context,
|
|||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
it.Name = data
|
it.Name = data
|
||||||
case "dataSensitivity":
|
case "dataClassification":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSensitivity"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataClassification"))
|
||||||
data, err := ec.unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx, v)
|
data, err := ec.unmarshalNDataClassification2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
it.DataSensitivity = data
|
it.DataClassification = data
|
||||||
case "ownerId":
|
case "ownerId":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
||||||
data, err := ec.unmarshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
|
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
|
asMap[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldsInOrder := [...]string{"id", "name", "dataSensitivity", "ownerId", "vendorIds"}
|
fieldsInOrder := [...]string{"id", "name", "dataClassification", "ownerId", "vendorIds"}
|
||||||
for _, k := range fieldsInOrder {
|
for _, k := range fieldsInOrder {
|
||||||
v, ok := asMap[k]
|
v, ok := asMap[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -38486,13 +38498,13 @@ func (ec *executionContext) unmarshalInputUpdateDatumInput(ctx context.Context,
|
|||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
it.Name = data
|
it.Name = data
|
||||||
case "dataSensitivity":
|
case "dataClassification":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataSensitivity"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dataClassification"))
|
||||||
data, err := ec.unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx, v)
|
data, err := ec.unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification(ctx, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
it.DataSensitivity = data
|
it.DataClassification = data
|
||||||
case "ownerId":
|
case "ownerId":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerId"))
|
||||||
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
|
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 {
|
if out.Values[i] == graphql.Null {
|
||||||
atomic.AddUint32(&out.Invalids, 1)
|
atomic.AddUint32(&out.Invalids, 1)
|
||||||
}
|
}
|
||||||
case "dataSensitivity":
|
case "dataClassification":
|
||||||
out.Values[i] = ec._Datum_dataSensitivity(ctx, field, obj)
|
out.Values[i] = ec._Datum_dataClassification(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
atomic.AddUint32(&out.Invalids, 1)
|
atomic.AddUint32(&out.Invalids, 1)
|
||||||
}
|
}
|
||||||
@@ -49024,6 +49036,38 @@ func (ec *executionContext) marshalNCursorKey2githubᚗcomᚋgetproboᚋproboᚋ
|
|||||||
return res
|
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) {
|
func (ec *executionContext) unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity(ctx context.Context, v any) (coredata.DataSensitivity, error) {
|
||||||
tmp, err := graphql.UnmarshalString(v)
|
tmp, err := graphql.UnmarshalString(v)
|
||||||
res := unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity[tmp]
|
res := unmarshalNDataSensitivity2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity[tmp]
|
||||||
@@ -49171,14 +49215,14 @@ func (ec *executionContext) marshalNDatumOrderField2githubᚗcomᚋgetproboᚋpr
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
unmarshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[string]coredata.DatumOrderField{
|
unmarshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[string]coredata.DatumOrderField{
|
||||||
"CREATED_AT": coredata.DatumOrderFieldCreatedAt,
|
"CREATED_AT": coredata.DatumOrderFieldCreatedAt,
|
||||||
"NAME": coredata.DatumOrderFieldName,
|
"NAME": coredata.DatumOrderFieldName,
|
||||||
"DATA_SENSITIVITY": coredata.DatumOrderFieldDataSensitivity,
|
"DATA_CLASSIFICATION": coredata.DatumOrderFieldDataClassification,
|
||||||
}
|
}
|
||||||
marshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[coredata.DatumOrderField]string{
|
marshalNDatumOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDatumOrderField = map[coredata.DatumOrderField]string{
|
||||||
coredata.DatumOrderFieldCreatedAt: "CREATED_AT",
|
coredata.DatumOrderFieldCreatedAt: "CREATED_AT",
|
||||||
coredata.DatumOrderFieldName: "NAME",
|
coredata.DatumOrderFieldName: "NAME",
|
||||||
coredata.DatumOrderFieldDataSensitivity: "DATA_SENSITIVITY",
|
coredata.DatumOrderFieldDataClassification: "DATA_CLASSIFICATION",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52369,39 +52413,37 @@ func (ec *executionContext) marshalOCursorKey2ᚖgithubᚗcomᚋgetproboᚋprobo
|
|||||||
return res
|
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 {
|
if v == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
tmp, err := graphql.UnmarshalString(v)
|
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)
|
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 {
|
if v == nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
_ = sel
|
_ = sel
|
||||||
_ = ctx
|
_ = 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
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
unmarshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity = map[string]coredata.DataSensitivity{
|
unmarshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[string]coredata.DataClassification{
|
||||||
"NONE": coredata.DataSensitivityNone,
|
"PUBLIC": coredata.DataClassificationPublic,
|
||||||
"LOW": coredata.DataSensitivityLow,
|
"INTERNAL": coredata.DataClassificationInternal,
|
||||||
"MEDIUM": coredata.DataSensitivityMedium,
|
"CONFIDENTIAL": coredata.DataClassificationConfidential,
|
||||||
"HIGH": coredata.DataSensitivityHigh,
|
"SECRET": coredata.DataClassificationSecret,
|
||||||
"CRITICAL": coredata.DataSensitivityCritical,
|
|
||||||
}
|
}
|
||||||
marshalODataSensitivity2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataSensitivity = map[coredata.DataSensitivity]string{
|
marshalODataClassification2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐDataClassification = map[coredata.DataClassification]string{
|
||||||
coredata.DataSensitivityNone: "NONE",
|
coredata.DataClassificationPublic: "PUBLIC",
|
||||||
coredata.DataSensitivityLow: "LOW",
|
coredata.DataClassificationInternal: "INTERNAL",
|
||||||
coredata.DataSensitivityMedium: "MEDIUM",
|
coredata.DataClassificationConfidential: "CONFIDENTIAL",
|
||||||
coredata.DataSensitivityHigh: "HIGH",
|
coredata.DataClassificationSecret: "SECRET",
|
||||||
coredata.DataSensitivityCritical: "CRITICAL",
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -7,12 +21,12 @@ import (
|
|||||||
|
|
||||||
func NewDatum(d *coredata.Data) *Datum {
|
func NewDatum(d *coredata.Data) *Datum {
|
||||||
return &Datum{
|
return &Datum{
|
||||||
ID: d.ID,
|
ID: d.ID,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
DataSensitivity: d.DataSensitivity,
|
DataClassification: d.DataClassification,
|
||||||
CreatedAt: d.CreatedAt,
|
CreatedAt: d.CreatedAt,
|
||||||
UpdatedAt: d.UpdatedAt,
|
UpdatedAt: d.UpdatedAt,
|
||||||
Organization: &Organization{ID: d.OrganizationID},
|
Organization: &Organization{ID: d.OrganizationID},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -176,11 +176,11 @@ type CreateControlPayload struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateDatumInput struct {
|
type CreateDatumInput struct {
|
||||||
OrganizationID gid.GID `json:"organizationId"`
|
OrganizationID gid.GID `json:"organizationId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
DataClassification coredata.DataClassification `json:"dataClassification"`
|
||||||
OwnerID gid.GID `json:"ownerId"`
|
OwnerID gid.GID `json:"ownerId"`
|
||||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateDatumPayload struct {
|
type CreateDatumPayload struct {
|
||||||
@@ -357,14 +357,14 @@ type CreateVendorRiskAssessmentPayload struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Datum struct {
|
type Datum struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
DataClassification coredata.DataClassification `json:"dataClassification"`
|
||||||
Owner *People `json:"owner"`
|
Owner *People `json:"owner"`
|
||||||
Vendors *VendorConnection `json:"vendors"`
|
Vendors *VendorConnection `json:"vendors"`
|
||||||
Organization *Organization `json:"organization"`
|
Organization *Organization `json:"organization"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Datum) IsNode() {}
|
func (Datum) IsNode() {}
|
||||||
@@ -972,11 +972,11 @@ type UpdateControlPayload struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDatumInput struct {
|
type UpdateDatumInput struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
DataSensitivity *coredata.DataSensitivity `json:"dataSensitivity,omitempty"`
|
DataClassification *coredata.DataClassification `json:"dataClassification,omitempty"`
|
||||||
OwnerID *gid.GID `json:"ownerId,omitempty"`
|
OwnerID *gid.GID `json:"ownerId,omitempty"`
|
||||||
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
VendorIds []gid.GID `json:"vendorIds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDatumPayload struct {
|
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())
|
svc := GetTenantService(ctx, r.proboSvc, input.OrganizationID.TenantID())
|
||||||
|
|
||||||
data, err := svc.Data.Create(ctx, probo.CreateDatumRequest{
|
data, err := svc.Data.Create(ctx, probo.CreateDatumRequest{
|
||||||
OrganizationID: input.OrganizationID,
|
OrganizationID: input.OrganizationID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
DataSensitivity: input.DataSensitivity,
|
DataClassification: input.DataClassification,
|
||||||
OwnerID: input.OwnerID,
|
OwnerID: input.OwnerID,
|
||||||
VendorIDs: input.VendorIds,
|
VendorIDs: input.VendorIds,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
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())
|
svc := GetTenantService(ctx, r.proboSvc, input.ID.TenantID())
|
||||||
|
|
||||||
datum, err := svc.Data.Update(ctx, probo.UpdateDatumRequest{
|
datum, err := svc.Data.Update(ctx, probo.UpdateDatumRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
DataSensitivity: input.DataSensitivity,
|
DataClassification: input.DataClassification,
|
||||||
OwnerID: input.OwnerID,
|
OwnerID: input.OwnerID,
|
||||||
VendorIDs: input.VendorIds,
|
VendorIDs: input.VendorIds,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user