Skip to content

Commit

Permalink
Disable cors on master. Cleanup cors configuration on ws-agent (#14921)
Browse files Browse the repository at this point in the history
* Disable cors on master. Cleanup cors configuration on ws-agent
Signed-off-by: Sergii Kabashniuk <[email protected]>
  • Loading branch information
skabashnyuk authored Oct 18, 2019
1 parent 6c6e0dd commit 0134cb4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
import org.eclipse.che.api.workspace.server.spi.provision.env.MachineTokenEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.MavenOptsEnvVariableProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.ProjectsRootEnvVariableProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceAgentCorsAllowCredentialsEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceAgentCorsAllowedOriginsEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceAgentCorsEnabledEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceAgentJavaOptsEnvVariableProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceIdEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.WorkspaceNameEnvVarProvider;
Expand Down Expand Up @@ -180,14 +177,6 @@ protected void configure() {
.addBinding()
.to(WorkspaceAgentJavaOptsEnvVariableProvider.class);

legacyEnvVarProviderMultibinders
.addBinding()
.to(WorkspaceAgentCorsAllowedOriginsEnvVarProvider.class);
legacyEnvVarProviderMultibinders
.addBinding()
.to(WorkspaceAgentCorsAllowCredentialsEnvVarProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(WorkspaceAgentCorsEnabledEnvVarProvider.class);

bind(org.eclipse.che.api.workspace.server.event.WorkspaceJsonRpcMessenger.class)
.asEagerSingleton();
bind(org.eclipse.che.everrest.EverrestDownloadFileResponseFilter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ protected void configureServlets() {
private boolean isCheCorsEnabled() {
String cheCorsEnabledEnvVar = System.getenv("CHE_CORS_ENABLED");
if (cheCorsEnabledEnvVar == null) {
// by default CORS should be enabled
return true;
// by default CORS should be disabled
return false;
} else {
return Boolean.valueOf(cheCorsEnabledEnvVar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,20 +685,13 @@ che.core.jsonrpc.minor_processor_queue_capacity=10000
che.metrics.port=8087

# CORS settings
# CORS filter on WS Master is turned on by default.
# Use environment variable "CHE_CORS_ENABLED=false" to turn it off
# CORS filter on WS Master is turned off by default.
# Use environment variable "CHE_CORS_ENABLED=true" to turn it on
# "cors.allowed.origins" indicates which request origins are allowed
che.cors.allowed_origins=*
# "cors.support.credentials" indicates if it allows processing of requests with credentials
# (in cookies, headers, TLS client certificates)
che.cors.allow_credentials=false
# This property is used to provide value for WS Agent CORS allowed origins env variable from WS Master.
# If set to null, then the value will be automatically provided by WS Agent.
che.wsagent.cors.allowed_origins=NULL
# This property is used to provide value for WS Agent CORS credentials origins env variable from WS Master,
che.wsagent.cors.allow_credentials=true
# This property is used to provide value for WS Agent CORS enabling.
che.wsagent.cors.enabled=true

## Factory defaults.
# Editor and plugin which will be used for factories which are created from remote git repository
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 0134cb4

Please sign in to comment.