Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions sandbox/src/main/java/org/assimbly/sandbox/SandboxEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*/
public class SandboxEndpoint extends LanguageEndpoint {

private boolean strictSecureMode = true;

public SandboxEndpoint() {
super();
}
Expand All @@ -22,14 +20,6 @@ public SandboxEndpoint(String endpointUri, Component component, Language languag
super(endpointUri, component, language, expression, resourceUri);
}

public boolean isStrictSecureMode() {
return strictSecureMode;
}

public void setStrictSecureMode(boolean strictSecureMode) {
this.strictSecureMode = strictSecureMode;
}

/**
* Overrides the createProducer method to supply the SandboxProducer.=
*/
Expand Down
16 changes: 0 additions & 16 deletions sandbox/src/main/java/org/assimbly/sandbox/SandboxProducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.apache.camel.Exchange;
import org.apache.camel.component.language.LanguageEndpoint;
import org.apache.camel.component.language.LanguageProducer;
import org.assimbly.sandbox.executors.GroovySandboxExecutor;

import java.util.UUID;

Expand All @@ -18,21 +17,6 @@ public SandboxProducer(LanguageEndpoint endpoint) {

@Override
public void process(Exchange exchange) throws Exception {
SandboxEndpoint endpoint = (SandboxEndpoint) getEndpoint();
String language = endpoint.getLanguage().toString();

if (endpoint.isStrictSecureMode() && language.toLowerCase().contains("groovy")) {
String script = getEndpoint().getScript();
if (script == null) {
script = exchange.getIn().getBody(String.class);
}
GroovySandboxExecutor.execute(script, exchange);
} else {
executeWithSecurity(exchange);
}
}

private void executeWithSecurity(Exchange exchange) throws Exception {
UUID uuid = UUID.randomUUID();
SandboxSecurityManager.getInstance().secure(uuid);
try {
Expand Down

This file was deleted.