From 3b75f545f8ec11c667d00c5f74c1c2445361bf3f Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 22 Feb 2024 15:55:06 +0530 Subject: [PATCH] Update getConfigFieldInfo method implementation --- .../pluginInterface/ConfigFieldInfo.java | 37 +++++++++++++++++++ .../supertokens/pluginInterface/Storage.java | 4 +- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/main/java/io/supertokens/pluginInterface/ConfigFieldInfo.java diff --git a/src/main/java/io/supertokens/pluginInterface/ConfigFieldInfo.java b/src/main/java/io/supertokens/pluginInterface/ConfigFieldInfo.java new file mode 100644 index 00000000..3d46cbdd --- /dev/null +++ b/src/main/java/io/supertokens/pluginInterface/ConfigFieldInfo.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024, VRAI Labs and/or its affiliates. All rights reserved. + * + * This software is licensed under the Apache License, Version 2.0 (the + * "License") as published by the Apache Software Foundation. + * + * You may not use this file except in compliance with the License. You may + * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + */ +package io.supertokens.pluginInterface; + +public class ConfigFieldInfo { + public String name; + public String description; + public boolean isDifferentAcrossTenants; + public String type; + public String[] options; + + public ConfigFieldInfo(String name, String description, boolean isDifferentAcrossTenants, String type) { + this(name, description, isDifferentAcrossTenants, type, null); + } + + public ConfigFieldInfo(String name, String description, boolean isDifferentAcrossTenants, String type, String[] options) { + this.name = name; + this.description = description; + this.isDifferentAcrossTenants = isDifferentAcrossTenants; + this.type = type; + this.options = options; + } +} diff --git a/src/main/java/io/supertokens/pluginInterface/Storage.java b/src/main/java/io/supertokens/pluginInterface/Storage.java index 154a2475..2ea5d28b 100644 --- a/src/main/java/io/supertokens/pluginInterface/Storage.java +++ b/src/main/java/io/supertokens/pluginInterface/Storage.java @@ -17,7 +17,6 @@ package io.supertokens.pluginInterface; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import io.supertokens.pluginInterface.exceptions.DbInitException; import io.supertokens.pluginInterface.exceptions.InvalidConfigException; @@ -26,6 +25,7 @@ import io.supertokens.pluginInterface.multitenancy.TenantIdentifier; import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException; +import java.util.ArrayList; import java.util.Set; public interface Storage { @@ -90,7 +90,7 @@ boolean isUserIdBeingUsedInNonAuthRecipe(AppIdentifier appIdentifier, String cla Set getValidFieldsInConfig(); - JsonArray getConfigFieldsJson(); + ArrayList getConfigFieldsInfo(); void setLogLevels(Set logLevels);