-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: disable introspection by default (#222)
- Loading branch information
1 parent
675c429
commit c1967b6
Showing
8 changed files
with
74 additions
and
35 deletions.
There are no files selected for viewing
Submodule hypertrace-core-graphql
updated
37 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ql-service/src/main/java/org/hypertrace/graphql/service/DefaultGraphQlEndpointConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.hypertrace.graphql.service; | ||
|
||
import com.typesafe.config.Config; | ||
import java.time.Duration; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
import org.hypertrace.core.graphql.spi.config.GraphQlEndpointConfig; | ||
|
||
@Value | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Builder(access = AccessLevel.PRIVATE) | ||
class DefaultGraphQlEndpointConfig implements GraphQlEndpointConfig { | ||
private static final String URL_PATH_PROP_KEY = "graphql.urlPath"; | ||
private static final String TIMEOUT_PROP_KEY = "graphql.timeout"; | ||
private static final String MAX_IO_THREADS_PROP_KEY = "threads.io.max"; | ||
private static final String MAX_REQUEST_THREADS_PROP_KEY = "threads.request.max"; | ||
private static final String CORS_ENABLED_PROP_KEY = "graphql.corsEnabled"; | ||
private static final String INTROSPECTION_ENABLED_PROP_KEY = "introspection.enabled"; | ||
|
||
String urlPath; | ||
Duration timeout; | ||
int maxRequestThreads; | ||
int maxIoThreads; | ||
boolean corsEnabled; | ||
boolean introspectionAllowed; | ||
|
||
static GraphQlEndpointConfig fromConfig(Config config) { | ||
return new DefaultGraphQlEndpointConfigBuilder() | ||
.urlPath(config.getString(URL_PATH_PROP_KEY)) | ||
.timeout(config.getDuration(TIMEOUT_PROP_KEY)) | ||
.maxRequestThreads(config.getInt(MAX_REQUEST_THREADS_PROP_KEY)) | ||
.maxIoThreads(config.getInt(MAX_IO_THREADS_PROP_KEY)) | ||
.corsEnabled(config.getBoolean(CORS_ENABLED_PROP_KEY)) | ||
.introspectionAllowed(config.getBoolean(INTROSPECTION_ENABLED_PROP_KEY)) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters