From 5012f132193d55d72d2248d1f9e15417507b4e25 Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Mon, 15 Jan 2024 10:37:13 +0100 Subject: [PATCH] Init commit --- CODEOWNERS | 9 +++ README.md | 0 .../java/dapla-kuben-resource-model/README.md | 0 src/custom-metadata.schema.json | 51 +++++++++++++ src/metadata-field.schema.json | 31 ++++++++ src/metadata.yaml | 74 +++++++++++++++++++ src/platform-managed-metadata.schema.json | 59 +++++++++++++++ src/team-metadata.schema.json | 64 ++++++++++++++++ 8 files changed, 288 insertions(+) create mode 100644 CODEOWNERS create mode 100644 README.md create mode 100644 generated/java/dapla-kuben-resource-model/README.md create mode 100644 src/custom-metadata.schema.json create mode 100644 src/metadata-field.schema.json create mode 100644 src/metadata.yaml create mode 100644 src/platform-managed-metadata.schema.json create mode 100644 src/team-metadata.schema.json diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..95de78c --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,9 @@ +# Docs for CODEOWNERS file: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @statisticsnorway/dapla-skyinfra-developers will be requested for +# review when someone opens a pull request. + +* @statisticsnorway/dapla-platform-developers diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/generated/java/dapla-kuben-resource-model/README.md b/generated/java/dapla-kuben-resource-model/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/custom-metadata.schema.json b/src/custom-metadata.schema.json new file mode 100644 index 0000000..18bd0f3 --- /dev/null +++ b/src/custom-metadata.schema.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://dapla.ssb.no/1.0.0/custom-team-metadata.schema.json", + "title": "CustomMetadata", + "description": "Custom metadata fields that the team manages", + "examples": [ + { + "version": "1.0.0", + "kind": "CustomMetadata", + "metadata": { + "name": "my-name" + }, + "spec": { + "my-field": "123", + "some-other-field": "123" + } + } + ], + "type": "object", + "properties": { + "version": { + "description": "The version of this specification", + "type": "string", + "pattern": "^\\d\\.\\d\\.\\d(-(alpha|beta|rc)\\d*)?$" + }, + "kind": { + "description": "Which kind of metadata are being described", + "type": "string", + "enum": [ + "CustomMetadata" + ] + }, + "metadata": { + "$ref": "https://dapla.ssb.no/1.0.0/metadata-field.schema.json" + }, + "spec": { + "description": "Custom fields/metadata for the team. All keys must be lowercase (a-z), may contain _", + "type": "object", + "propertyNames": { + "pattern": "^[a-z_]*$" + }, + "additionalProperties": true + } + }, + "required": [ + "version", + "kind", + "metadata", + "spec" + ] +} diff --git a/src/metadata-field.schema.json b/src/metadata-field.schema.json new file mode 100644 index 0000000..4bc0c8e --- /dev/null +++ b/src/metadata-field.schema.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://dapla.ssb.no/1.0.0/metadata-field.schema.json", + "description": "The metadata fields common to all kinds/entities", + "examples": [ + { + "team_name": "dapla-platform", + "visibility": "PUBLIC", + "other_metadata_field": "foo" + } + ], + "required": [ + "team_name" + ], + "type": "object", + "properties": { + "team_name": { + "description": "Name of this resource", + "type": "string", + "minLength": 1 + }, + "visibility": { + "description": "Whenever the metadata in this manifest is considered to be exposed in e.g. a portal. Will default to public if not specified", + "type": "string", + "enum": [ + "PRIVATE", + "PUBLIC" + ] + } + } +} diff --git a/src/metadata.yaml b/src/metadata.yaml new file mode 100644 index 0000000..369ae41 --- /dev/null +++ b/src/metadata.yaml @@ -0,0 +1,74 @@ +version: 1.0.0 +kind: TeamMetadata +metadata: + team_name: "{{cookiecutter.team_name}}" + content_name: some-name +# TODO: discuss visibility field +# visibility: PRIVATE|PUBLIC +# TODO: Should we require something in the spec, or just be free text? +spec: + data_content_types: + - OPEN + - PII + - HEALTH + - STOCK_SENSITIVE + - OTHER_SENSITIVE + + +--- +version: 1.0.0 +kind: PlatformManagedTeamMetadata +metadata: + team_name: "{{cookiecutter.team_name}}" + content_name: some-name +# visibility: PRIVATE|PUBLIC +spec: + section_code: "{{cookiecutter.department_code}}" + iac_ownership: + iac_autonomy_level: STANDALONE|PARTIAL|PLATFORM_MANAGED + sla: NONE|STANDARD + + + +--- + +version: 1.0.0 +kind: PlatformManagedTeamMetadata +metadata: + name: some-name +spec: + support_level: "FULL|NONE/SELF" + managed_level: "FULL|SELF" + support_agreement: "SELF" + iac_managed_by: "DAPLA_PLATFORM_TEAM|SELF_MANGED" + iac_responsibility: "" + autonomy: "TEAM|FULL|SELF_MANGED / DAPLA_PLATFORM_TEAM|MINIMAL|NONE" + autonomy-level: "LOW|MEDIUM|HIGH" + self-service-level: "LOW|MEDIUM|HIGH" + + iac: + managed_by: "DAPLA_PLATFORM_TEAM|SELF_MANGED" + autonomy_level: "" + responsibility: "" + + # Seksjonsledere vil ha kobling til statistikkbanken/registeret: Hvilke statistikker publiserer teamet + # Formål for teamet (test eller ikke) + datatypes: + - PII + - HEALTH_DATA + - STOCK_DATA + - OTHER_SENSITIVE + pii_agreements: + - Link to agreement in websak+? + PII_level: "" #basert på begrep introudsert i datatilstand, feks helsedata mer sensitivt enn annet + source_data: + - name: freg + datatypes: + - HEALTH_DATA + pii_agreements: + - + statistical_products: + - name: mitt navn + statistikkbanken: + datatypes: + - STOCK_DATA diff --git a/src/platform-managed-metadata.schema.json b/src/platform-managed-metadata.schema.json new file mode 100644 index 0000000..d475b79 --- /dev/null +++ b/src/platform-managed-metadata.schema.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://dapla.ssb.no/1.0.0/platform-manged-team-metadata.schema.json", + "title": "PlatformManagedTeamMetadata", + "description": "Metadata that the platform team manages on behalf of the team", + "examples": [ + { + "version": "1.0.0", + "kind": "PlatformManagedTeamMetadata", + "metadata": { + "name": "my-name" + }, + "spec": { + "department_code": "123" + } + } + ], + "type": "object", + "properties": { + "version": { + "description": "The version of this specification", + "type": "string", + "pattern": "^\\d\\.\\d\\.\\d(-(alpha|beta|rc)\\d*)?$" + }, + "kind": { + "description": "Which kind of metadata are being described", + "type": "string", + "enum": [ + "PlatformManagedMetadata" + ] + }, + "metadata": { + "$ref": "/1.0.0/metadata-field.schema.json" + }, + "spec": { + "description": "The specification of the concrete metadata for the team. All keys must be lowercase (a-z), may contain _", + "type": "object", + "propertyNames": { + "pattern": "^[a-z_]*$" + }, + "additionalProperties": false, + "required": [ + "section_code" + ], + "properties": { + "section_code": { + "pattern": "[0-9]{3}", + "description": "The code of the section this teams belong to" + } + } + } + }, + "required": [ + "version", + "kind", + "metadata", + "spec" + ] +} diff --git a/src/team-metadata.schema.json b/src/team-metadata.schema.json new file mode 100644 index 0000000..c803684 --- /dev/null +++ b/src/team-metadata.schema.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://dapla.ssb.no/1.0.0/team-metadata.schema.json", + "title": "TeamMetadata", + "description": "Predefined metadata fields that the team manages", + "examples": [ + { + "version": "1.0.0", + "kind": "TeamMetadata", + "metadata": { + "name": "my-name" + }, + "spec": { + "some_key": "123" + } + } + ], + "type": "object", + "properties": { + "version": { + "description": "The version of this specification", + "type": "string", + "pattern": "^\\d\\.\\d\\.\\d(-(alpha|beta|rc)\\d*)?$" + }, + "kind": { + "description": "Which kind of metadata are being described", + "type": "string", + "enum": [ + "TeamMetadata" + ] + }, + "metadata": { + "$ref": "https://dapla.ssb.no/1.0.0/metadata-field.schema.json" + }, + "spec": { + "description": "The specification of the concrete metadata for the team. All keys must be lowercase (a-z), may contain _", + "type": "object", + "propertyNames": { + "pattern": "^[a-z_]*$" + }, + "additionalProperties": false, + "required": ["data_content_types"], + "properties": { + "data_content_types": { + "type": "array", + "enum":[ + "OPEN", + "PII", + "HEALTH", + "STOCK_SENSITIVE", + "OTHER_SENSITIVE" + ], + "description": "WIP, which data content this team handles" + } + } + } + }, + "required": [ + "version", + "kind", + "metadata", + "spec" + ] +}