Skip to content

Commit

Permalink
fix: HideFromDashboard annotation (#1014)
Browse files Browse the repository at this point in the history
* fix: HideFromDashboard annotation

* fix: comment
  • Loading branch information
sattvikc authored Jul 15, 2024
1 parent ccc387b commit 5f61061
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/io/supertokens/config/CoreConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class CoreConfig {
// @IgnoreForAnnotationCheck: Set this if the property is neither @ConfigYamlOnly nor @NotConflictingInApp, or should
// simply be ignored by the test (if the property is just an internal member and not an exposed config) that checks
// for annotations on all properties.
// @HideFromDashboard: The property should not be shown in the dashboard

@IgnoreForAnnotationCheck
public static final String[] PROTECTED_CONFIGS = new String[]{
Expand Down Expand Up @@ -174,6 +175,7 @@ public class CoreConfig {

@NotConflictingInApp
@JsonProperty
@HideFromDashboard
@ConfigDescription(
"The API keys to query an instance using this config file. The format is \"key1,key2,key3\". Keys can " +
"only contain '=', '-' and alpha-numeric (including capital) chars. Each key must have a minimum " +
Expand Down Expand Up @@ -273,6 +275,7 @@ public class CoreConfig {

@ConfigYamlOnly
@JsonProperty
@HideFromDashboard
@ConfigDescription(
"This is used when deploying the core in SuperTokens SaaS infrastructure. If set, limits what database " +
"information is shown to / modifiable by the dev when they query the core to get the information " +
Expand All @@ -282,6 +285,7 @@ public class CoreConfig {

@NotConflictingInApp
@JsonProperty
@HideFromDashboard
@ConfigDescription(
"This is used when the core needs to assume a specific CDI version when CDI version is not specified in " +
"the request. When set to null, the core will assume the latest version of the CDI. (Default: " +
Expand Down Expand Up @@ -857,6 +861,7 @@ public static ArrayList<ConfigFieldInfo> getConfigFieldsInfoForDashboard(Main ma
// or is annotated with ConfigYamlOnly, then skip
if (!field.isAnnotationPresent(JsonProperty.class)
|| field.isAnnotationPresent(ConfigYamlOnly.class)
|| field.isAnnotationPresent(HideFromDashboard.class)
|| fieldId.equals("core_config_version")) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2023, 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.config.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface HideFromDashboard {
}

0 comments on commit 5f61061

Please sign in to comment.