Fix NPE when accessing services before OPA is ready.
This commit is contained in:
parent
1a19a9b698
commit
a8842e962b
|
|
@ -1,12 +1,14 @@
|
||||||
package com.appsmith.server.acl;
|
package com.appsmith.server.acl;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
public class OpaResponse {
|
public class OpaResponse {
|
||||||
Boolean result;
|
Boolean result;
|
||||||
|
|
||||||
|
public boolean isSuccessful() {
|
||||||
|
return Boolean.TRUE.equals(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class AclFilter implements WebFilter {
|
||||||
return acl;
|
return acl;
|
||||||
})
|
})
|
||||||
.flatMap(acl -> {
|
.flatMap(acl -> {
|
||||||
if (acl != null && acl.getResult()) {
|
if (acl != null && acl.isSuccessful()) {
|
||||||
// Acl returned true. Continue with the filter chain
|
// Acl returned true. Continue with the filter chain
|
||||||
return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user