yuqi1129 commented on code in PR #6141:
URL: https://github.com/apache/gravitino/pull/6141#discussion_r1908236999
##########
bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java:
##########
@@ -99,6 +101,57 @@ private AccessToken getToken(Set<String> readLocations,
Set<String> writeLocatio
return downscopedCredentials.refreshAccessToken();
}
+ private List<String> getReadExpressions(String bucketName, String
resourcePath) {
+ List<String> readExpressions = new ArrayList<>();
+ readExpressions.add(
+ String.format(
+ "resource.name.startsWith('projects/_/buckets/%s/objects/%s')",
+ bucketName, resourcePath));
+ getAllResources(resourcePath)
+ .forEach(
+ parentResourcePath ->
+ readExpressions.add(
+ String.format(
+ "resource.name == 'projects/_/buckets/%s/objects/%s'",
+ bucketName, parentResourcePath)));
+ return readExpressions;
+ }
+
+ @VisibleForTesting
+ // "a/b/c" will get ["a", "a/", "a/b", "a/b/", "a/b/c"]
+ static List<String> getAllResources(String resourcePath) {
Review Comment:
Role only_list_object_in_bucket

Role: iam_role1
<img width="869" alt="image"
src="https://github.com/user-attachments/assets/11ba1b0d-ba67-446e-9628-1bfae334021e"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]