Skip to content

Commit 5f61061

Browse files
authored
fix: HideFromDashboard annotation (#1014)
* fix: HideFromDashboard annotation * fix: comment
1 parent ccc387b commit 5f61061

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/main/java/io/supertokens/config/CoreConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public class CoreConfig {
5656
// @IgnoreForAnnotationCheck: Set this if the property is neither @ConfigYamlOnly nor @NotConflictingInApp, or should
5757
// simply be ignored by the test (if the property is just an internal member and not an exposed config) that checks
5858
// for annotations on all properties.
59+
// @HideFromDashboard: The property should not be shown in the dashboard
5960

6061
@IgnoreForAnnotationCheck
6162
public static final String[] PROTECTED_CONFIGS = new String[]{
@@ -174,6 +175,7 @@ public class CoreConfig {
174175

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

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

283286
@NotConflictingInApp
284287
@JsonProperty
288+
@HideFromDashboard
285289
@ConfigDescription(
286290
"This is used when the core needs to assume a specific CDI version when CDI version is not specified in " +
287291
"the request. When set to null, the core will assume the latest version of the CDI. (Default: " +
@@ -857,6 +861,7 @@ public static ArrayList<ConfigFieldInfo> getConfigFieldsInfoForDashboard(Main ma
857861
// or is annotated with ConfigYamlOnly, then skip
858862
if (!field.isAnnotationPresent(JsonProperty.class)
859863
|| field.isAnnotationPresent(ConfigYamlOnly.class)
864+
|| field.isAnnotationPresent(HideFromDashboard.class)
860865
|| fieldId.equals("core_config_version")) {
861866
continue;
862867
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2023, VRAI Labs and/or its affiliates. All rights reserved.
3+
*
4+
* This software is licensed under the Apache License, Version 2.0 (the
5+
* "License") as published by the Apache Software Foundation.
6+
*
7+
* You may not use this file except in compliance with the License. You may
8+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package io.supertokens.config.annotations;
18+
19+
import java.lang.annotation.ElementType;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
import java.lang.annotation.Target;
23+
24+
@Retention(RetentionPolicy.RUNTIME)
25+
@Target(ElementType.FIELD)
26+
public @interface HideFromDashboard {
27+
}

0 commit comments

Comments
 (0)