From 909da3b17f8e7083d46ad61875578e6c3911a534 Mon Sep 17 00:00:00 2001 From: Olivier Levitt Date: Tue, 3 Oct 2023 11:11:06 +0200 Subject: [PATCH] Catalog : add visibility and allowsharing configuration --- .../api/configuration/CatalogWrapper.java | 44 +++++++++++++++++++ onyxia-api/src/main/resources/catalogs.json | 21 +++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/onyxia-api/src/main/java/fr/insee/onyxia/api/configuration/CatalogWrapper.java b/onyxia-api/src/main/java/fr/insee/onyxia/api/configuration/CatalogWrapper.java index 5026854c..f4203c51 100644 --- a/onyxia-api/src/main/java/fr/insee/onyxia/api/configuration/CatalogWrapper.java +++ b/onyxia-api/src/main/java/fr/insee/onyxia/api/configuration/CatalogWrapper.java @@ -52,6 +52,12 @@ public class CatalogWrapper { @Schema(description = "Verify certificates of HTTPS-enabled servers using this CA bundle") private String caFile; + @Schema(description = "Allow sharing this service within a project") + private boolean allowSharing = true; + + @Schema(description = "Should this catalog be visible in user context ? Project context ?") + private CatalogVisibility visible = new CatalogVisibility(); + /** * @return the type */ @@ -172,4 +178,42 @@ public String getCaFile() { public void setCaFile(String caFile) { this.caFile = caFile; } + + public boolean isAllowSharing() { + return allowSharing; + } + + public void setAllowSharing(boolean allowSharing) { + this.allowSharing = allowSharing; + } + + public CatalogVisibility getVisible() { + return visible; + } + + public void setVisible(CatalogVisibility visible) { + this.visible = visible; + } + + public static class CatalogVisibility { + + private boolean user = true; + private boolean project = true; + + public boolean isUser() { + return user; + } + + public void setUser(boolean user) { + this.user = user; + } + + public boolean isProject() { + return project; + } + + public void setProject(boolean project) { + this.project = project; + } + } } diff --git a/onyxia-api/src/main/resources/catalogs.json b/onyxia-api/src/main/resources/catalogs.json index 32d90be7..f9eb130a 100644 --- a/onyxia-api/src/main/resources/catalogs.json +++ b/onyxia-api/src/main/resources/catalogs.json @@ -10,7 +10,12 @@ "highlightedCharts": ["jupyter-python", "rstudio", "vscode-python"], "type": "helm", "skipTlsVerify": false, - "caFile": null + "caFile": null, + "allowSharing": false, + "visible": { + "user": true, + "project": true + } }, { "id": "databases", @@ -22,7 +27,12 @@ "highlightedCharts": ["postgresql", "elastic"], "type": "helm", "skipTlsVerify": false, - "caFile": null + "caFile": null, + "allowSharing": true, + "visible": { + "user": true, + "project": true + } }, { "id": "automation", @@ -34,7 +44,12 @@ "highlightedCharts": ["argo-cd", "argo-workflows", "mlflow"], "type": "helm", "skipTlsVerify": false, - "caFile": null + "caFile": null, + "allowSharing": true, + "visible": { + "user": true, + "project": true + } } ] }