Skip to content

Commit

Permalink
Update getConfigFieldInfo method implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
prateek3255 committed Feb 22, 2024
1 parent fe78106 commit 3b75f54
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions src/main/java/io/supertokens/pluginInterface/ConfigFieldInfo.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
4 changes: 2 additions & 2 deletions src/main/java/io/supertokens/pluginInterface/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -90,7 +90,7 @@ boolean isUserIdBeingUsedInNonAuthRecipe(AppIdentifier appIdentifier, String cla

Set<String> getValidFieldsInConfig();

JsonArray getConfigFieldsJson();
ArrayList<ConfigFieldInfo> getConfigFieldsInfo();

void setLogLevels(Set<LOG_LEVEL> logLevels);

Expand Down

0 comments on commit 3b75f54

Please sign in to comment.