This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new cc5d0f1f80 Add back default AccessControl.hasAccess() (#14382)
cc5d0f1f80 is described below
commit cc5d0f1f80380493225f21814b07bbc7a015838d
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Mon Nov 4 16:51:12 2024 -0800
Add back default AccessControl.hasAccess() (#14382)
---
.../java/org/apache/pinot/controller/api/access/AccessControl.java | 5 ++++-
.../apache/pinot/controller/api/access/AllowAllAccessFactory.java | 7 -------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AccessControl.java
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AccessControl.java
index 4267c2385e..cf2240d1d5 100644
---
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AccessControl.java
+++
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AccessControl.java
@@ -40,7 +40,10 @@ public interface AccessControl extends
FineGrainedAccessControl {
* @param endpointUrl the request url for which this access control is called
* @return whether the client has permission
*/
- boolean hasAccess(@Nullable String tableName, AccessType accessType,
HttpHeaders httpHeaders, String endpointUrl);
+ default boolean hasAccess(@Nullable String tableName, AccessType accessType,
HttpHeaders httpHeaders,
+ String endpointUrl) {
+ return true;
+ }
/**
* Return whether the client has permission to access the endpoints with are
not table level
diff --git
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AllowAllAccessFactory.java
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AllowAllAccessFactory.java
index 7d37c5fdb0..a454f028df 100644
---
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AllowAllAccessFactory.java
+++
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AllowAllAccessFactory.java
@@ -18,15 +18,8 @@
*/
package org.apache.pinot.controller.api.access;
-import javax.ws.rs.core.HttpHeaders;
-
-
public class AllowAllAccessFactory implements AccessControlFactory {
private static final AccessControl ALLOW_ALL_ACCESS = new AccessControl() {
- @Override
- public boolean hasAccess(String tableName, AccessType accessType,
HttpHeaders httpHeaders, String endpointUrl) {
- return true;
- }
};
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]