You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "t-rana (via GitHub)" <gi...@apache.org> on 2024/03/27 11:46:48 UTC

[PR] Issues/OAK-10675 [jackrabbit-oak]

t-rana opened a new pull request, #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385

   Added service principal support in oak-blob-cloud-azure


-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1611216077


##########
oak-blob-cloud-azure/pom.xml:
##########
@@ -50,8 +69,23 @@
                         <Embed-Dependency>
                             azure-storage,
                             azure-keyvault-core,
+                            azure-core,
+                            azure-identity,
+                            azure-json,
                             guava,
-                            jsr305
+                            jsr305,

Review Comment:
   I just wanted to make sure we know what we do :-)



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "t-rana (via GitHub)" <gi...@apache.org>.
t-rana commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1601300901


##########
oak-blob-cloud-azure/pom.xml:
##########
@@ -50,8 +69,23 @@
                         <Embed-Dependency>
                             azure-storage,
                             azure-keyvault-core,
+                            azure-core,
+                            azure-identity,
+                            azure-json,
                             guava,
-                            jsr305
+                            jsr305,

Review Comment:
   @reschke, we are using azure-identity library for migration to service principals from access key based authentication in azure. All these dependencies came transitively from azure-identity. I initially tried marking some of them as optional which helped in resolving the bundle to active state but when I configured the component to use service principals, it failed with NoClassDefFoundError exceptions meaning that they were indeed required at runtime and cannot be marked as optional.
   
   Attaching the file of errors that I got and the corresponding dependency embedded.
   [dependencies_list.pdf](https://github.com/apache/jackrabbit-oak/files/15319377/dependencies_list.pdf)
   



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1600308692


##########
oak-blob-cloud-azure/pom.xml:
##########
@@ -50,8 +69,23 @@
                         <Embed-Dependency>
                             azure-storage,
                             azure-keyvault-core,
+                            azure-core,
+                            azure-identity,
+                            azure-json,
                             guava,
-                            jsr305
+                            jsr305,

Review Comment:
   At least JSR305 is never necessary at run time AFAIK. It is only annotations relevant at compile time.



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "t-rana (via GitHub)" <gi...@apache.org>.
t-rana commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1577307076


##########
oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureDataStoreAccessManager.java:
##########
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage;
+
+import com.azure.core.credential.TokenRequestContext;
+import com.azure.identity.ClientSecretCredential;
+import com.azure.identity.ClientSecretCredentialBuilder;
+import com.microsoft.azure.storage.CloudStorageAccount;
+import com.microsoft.azure.storage.StorageCredentialsToken;
+import com.microsoft.azure.storage.StorageException;
+import com.microsoft.azure.storage.UserDelegationKey;
+import com.microsoft.azure.storage.blob.BlobRequestOptions;
+import com.microsoft.azure.storage.blob.CloudBlobClient;
+import com.microsoft.azure.storage.blob.CloudBlobContainer;
+import com.microsoft.azure.storage.blob.CloudBlockBlob;
+import com.microsoft.azure.storage.blob.SharedAccessBlobHeaders;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPermissions;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPolicy;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.jackrabbit.core.data.DataStoreException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.net.URISyntaxException;
+import java.security.InvalidKeyException;
+import java.time.Instant;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.Optional;
+import java.util.Properties;
+
+public class AzureDataStoreAccessManager {

Review Comment:
   Renamed to AzureBlobContainerProvider



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "rootpea (via GitHub)" <gi...@apache.org>.
rootpea commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1611213303


##########
oak-blob-cloud-azure/pom.xml:
##########
@@ -50,8 +69,23 @@
                         <Embed-Dependency>
                             azure-storage,
                             azure-keyvault-core,
+                            azure-core,
+                            azure-identity,
+                            azure-json,
                             guava,
-                            jsr305
+                            jsr305,

Review Comment:
   @reschke @kwin do we have anything else to add regarding the embeds list? otherwise I'd suggest to go forward with the PR
   
   cc @t-rana 



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "smiroslav (via GitHub)" <gi...@apache.org>.
smiroslav commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1570850366


##########
oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureDataStoreAccessManager.java:
##########
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage;
+
+import com.azure.core.credential.TokenRequestContext;
+import com.azure.identity.ClientSecretCredential;
+import com.azure.identity.ClientSecretCredentialBuilder;
+import com.microsoft.azure.storage.CloudStorageAccount;
+import com.microsoft.azure.storage.StorageCredentialsToken;
+import com.microsoft.azure.storage.StorageException;
+import com.microsoft.azure.storage.UserDelegationKey;
+import com.microsoft.azure.storage.blob.BlobRequestOptions;
+import com.microsoft.azure.storage.blob.CloudBlobClient;
+import com.microsoft.azure.storage.blob.CloudBlobContainer;
+import com.microsoft.azure.storage.blob.CloudBlockBlob;
+import com.microsoft.azure.storage.blob.SharedAccessBlobHeaders;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPermissions;
+import com.microsoft.azure.storage.blob.SharedAccessBlobPolicy;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.jackrabbit.core.data.DataStoreException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.net.URISyntaxException;
+import java.security.InvalidKeyException;
+import java.time.Instant;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.Optional;
+import java.util.Properties;
+
+public class AzureDataStoreAccessManager {

Review Comment:
   Public methods of this class do not resolve access rights. This class rather provides ```CloudBlobContainer``` . I would rename it accordingly. 



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "smiroslav (via GitHub)" <gi...@apache.org>.
smiroslav merged PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385


-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Issues/OAK-10675 [jackrabbit-oak]

Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1385:
URL: https://github.com/apache/jackrabbit-oak/pull/1385#discussion_r1600277450


##########
oak-blob-cloud-azure/pom.xml:
##########
@@ -50,8 +69,23 @@
                         <Embed-Dependency>
                             azure-storage,
                             azure-keyvault-core,
+                            azure-core,
+                            azure-identity,
+                            azure-json,
                             guava,
-                            jsr305
+                            jsr305,

Review Comment:
   I'm very concerned about the amount of embeds here. Is this really needed? It will make the nundle bigger, and will make updates harder...



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org