Skip to content

Commit

Permalink
Removed barely utilized interceptor.id
Browse files Browse the repository at this point in the history
  • Loading branch information
t-burch committed Jul 21, 2023
1 parent d4aeb25 commit ae93e12
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class AbstractInterceptor implements Interceptor {

private EnumSet<Flow> flow = Flow.Set.REQUEST_RESPONSE;

protected String id;

protected Router router;

public AbstractInterceptor() {
Expand All @@ -62,15 +60,6 @@ public void setDisplayName(String name) {
this.name = name;
}

public String getId() {
return id;
}

@MCAttribute
public void setId(String id) {
this.id = id;
}

public void setFlow(EnumSet<Flow> flow) {
this.flow = flow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public static class Set {
String getDisplayName();
void setDisplayName(String name);

String getId();
void setId(String id);

Router getRouter();

void setFlow(EnumSet<Flow> flow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ else if (s == null || !s.isAuthorized()) {
}

private void applyBackendAuthorization(Exchange exc, Session s) {
if (getId() != null)
exc.setProperty(getId() + "-session", s);
exc.setProperty("session", s);
Header h = exc.getRequest().getHeader();
for (Map.Entry<String, String> e : s.getUserAttributes().entrySet())
if (e.getKey().startsWith("header")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public void testRule() throws Exception {

List<Interceptor> inters = rule.getInterceptors();
assertFalse(inters.isEmpty());
assertTrue(inters.size() == 2);
inters.get(0).getId().equals("roundRobinBalancer");
inters.get(1).getId().equals("accessControlInterceptor");
assertTrue(inters.size() == 2);

assertEquals(true, rule.isBlockResponse());
assertFalse(rule.isBlockRequest());
Expand All @@ -69,11 +67,9 @@ public void testRule() throws Exception {
private static List<Interceptor> getInterceptors() {
List<Interceptor> interceptors = new ArrayList<>();
Interceptor balancer = new LoadBalancingInterceptor();
balancer.setId("roundRobinBalancer");
interceptors.add(balancer);

Interceptor acl = new AccessControlInterceptor();
acl.setId("accessControlInterceptor");
interceptors.add(acl);
return interceptors;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/test/resources/ref.proxies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

<spring:bean id="accessControlInterceptor"
class="com.predic8.membrane.core.interceptor.acl.AccessControlInterceptor">
<spring:property name="id" value="accessControlInterceptor" />
<spring:property name="displayName" value="Access Control List Interceptor" />
<spring:property name="file" value="acl/acl.xml" />
</spring:bean>
Expand Down

0 comments on commit ae93e12

Please sign in to comment.