You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by yc...@apache.org on 2025/02/06 22:44:12 UTC

(cassandra-sidecar) 01/01: cleanup comments

This is an automated email from the ASF dual-hosted git repository.

ycai pushed a commit to branch r/apache/pr179
in repository https://gitbox.apache.org/repos/asf/cassandra-sidecar.git

commit bb48dbebb3f63e216c25f68a30c693b6bf1afe7a
Author: Yifan Cai <yc...@apache.org>
AuthorDate: Thu Feb 6 14:44:00 2025 -0800

    cleanup comments
---
 .../apache/cassandra/sidecar/acl/authorization/DataResourceScope.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/cassandra/sidecar/acl/authorization/DataResourceScope.java b/server/src/main/java/org/apache/cassandra/sidecar/acl/authorization/DataResourceScope.java
index 2b57cf64..cf240cb0 100644
--- a/server/src/main/java/org/apache/cassandra/sidecar/acl/authorization/DataResourceScope.java
+++ b/server/src/main/java/org/apache/cassandra/sidecar/acl/authorization/DataResourceScope.java
@@ -33,7 +33,7 @@ import static org.apache.cassandra.sidecar.common.utils.StringUtils.isNullOrEmpt
  */
 public class DataResourceScope implements ResourceScope
 {
-    public static final Pattern DATA_RESOURCE_PATTERN = Pattern.compile("^data(?:/([^/]+))?(?:/([^/]+))?$");
+    public static final Pattern DATA_RESOURCE_PATTERN = Pattern.compile("^data(?:/(?<keyspace>[^/]+))?(?:/(?<table>[^/]+))?$");
 
     public static final String DATA = "data";
 
@@ -126,7 +126,7 @@ public class DataResourceScope implements ResourceScope
         else if (keyspaceScoped)
         {
             // if table is present, we create resource with just keyspace
-            return matcher.group(2) != null ? DATA + "/" + matcher.group(1) : resource;
+            return matcher.group("table") != null ? DATA + '/' + matcher.group("keyspace") : resource;
         }
         return DATA;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org