You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/05/14 02:52:59 UTC

[GitHub] [camel] yuhusolutions opened a new pull request, #7615: CAMEL-18099: Adding Azure Identity authentication support

yuhusolutions opened a new pull request, #7615:
URL: https://github.com/apache/camel/pull/7615

   Hi there, this PR add supports for Azure Identity authentication for the AzureBlob component.
   It changes the default behavior from "shared key" (discouraged) to AzureIdentity authentication. 
   
   
   Added deps to the pom.xml for azure-identity, and refactored the boiler plate code to support other types of token auth if need be for the future (e.g. SAS token). From now on, the authentication type needs to be specified to switch from default.
   
   Tested existing and new ways to authenticate, with the existing test and using a consumer & producer route. 
   Could not find regression.
   
   Note that I updated the doc accordingly, part of it seems to be generated.
   
   Let me know your comments. 
   
   Thanks.
   
   - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL-18099) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [x] Each commit in the pull request should have a meaningful subject line and body.
   - [x] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue CAMEL-18099.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] github-actions[bot] commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1127727786

   :x: Finished component verification: **1 component(s) test failed** out of 1 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] davsclaus merged pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
davsclaus merged PR #7615:
URL: https://github.com/apache/camel/pull/7615


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] davsclaus commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r873517997


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   Yeah enums tend to be either in UPPER_CASE or CamelCase style



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] oscerd commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
oscerd commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1128819270

   @yuhusolutions can you please check the tests?


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] github-actions[bot] commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1126620198

   :warning: This PR changes Camel components and will be tested automatically.


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] github-actions[bot] commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1129571768

   :heavy_check_mark: Finished component verification: 0 component(s) test failed out of **1 component(s) tested**


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] yuhusolutions commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
yuhusolutions commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r874217654


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   I will fix the new one I created; However note that other enums in the components created outside of this PR don't follow the convention.
   It may be worth opening a separate ticket to tidy-up the component to make it consistent.
   



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] github-actions[bot] commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1128422451

   :x: Finished component verification: **1 component(s) test failed** out of 1 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] oscerd commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
oscerd commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r874358250


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   Please open an issue for this.



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] yuhusolutions commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
yuhusolutions commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r874225719


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   Fixed



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] oscerd commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
oscerd commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r873340368


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobComponent.java:
##########
@@ -27,6 +27,8 @@
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 
+import static org.apache.camel.component.azure.storage.blob.CredentialType.*;

Review Comment:
   Please avoid the * import.



##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,
+    /**
+     * storage shared account key
+     */
+    shared_account_key,

Review Comment:
   Same



##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   I think we should follow the constants convention and naming in uppercase



##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,
+    /**
+     * storage shared account key
+     */
+    shared_account_key,
+    /**
+     * Includes:
+     * <uL>
+     *     <li>Service principal with secret</li>
+     *     <li>Service principal with certificate</li>
+     *     <li>username and password</li>
+     * </uL>
+     * @see com.azure.identity.DefaultAzureCredentialBuilder
+     */
+    azure_identity

Review Comment:
   Same



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] github-actions[bot] commented on pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7615:
URL: https://github.com/apache/camel/pull/7615#issuecomment-1126653810

   :x: Finished component verification: **1 component(s) test failed** out of 1 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] yuhusolutions commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
yuhusolutions commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r874225505


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobComponent.java:
##########
@@ -27,6 +27,8 @@
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 
+import static org.apache.camel.component.azure.storage.blob.CredentialType.*;

Review Comment:
   Fixed



-- 
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: commits-unsubscribe@camel.apache.org

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


[GitHub] [camel] yuhusolutions commented on a diff in pull request #7615: CAMEL-18099: Adding Azure Identity authentication support

Posted by GitBox <gi...@apache.org>.
yuhusolutions commented on code in PR #7615:
URL: https://github.com/apache/camel/pull/7615#discussion_r874217654


##########
components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/CredentialType.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.component.azure.storage.blob;
+
+public enum CredentialType {
+    /**
+     * Shared key credential
+     * @see com.azure.storage.common.StorageSharedKeyCredential
+     */
+    shared_key_credential,

Review Comment:
   I will fix the new one I created; However note that other enums in the Azure component (created outside of this PR) don't follow the convention.
   It may be worth opening a separate ticket to tidy-up the component to make it consistent.
   



-- 
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: commits-unsubscribe@camel.apache.org

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