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 2020/10/06 14:34:52 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request #1879: Shiro native support #1844

JiriOndrusek opened a new pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879


   Issue: https://github.com/apache/camel-quarkus/issues/1844
   
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#issuecomment-704747563


   Current build problems seems to be caused by changes in camel-google-pubsub (e.g. https://github.com/apache/camel/commit/320dd0df9dd362523c0ee8769f87eebf8100b465#diff-6632f36f07e08f4a58c2460394178025L234)


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500483559



##########
File path: integration-tests/shiro/src/main/resources/application.properties
##########
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+quarkus.native.additional-build-args = -H:IncludeResources=securityConfig.ini

Review comment:
       For the sake of sharing tips, it reminds me [this](https://camel.apache.org/camel-quarkus/latest/user-guide/native-mode.html#embedding-resource-in-native-executable)




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#issuecomment-704803888


   @aldettinger thanks for all the suggestions, I've implemented all of them. PR is ready to merge.


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#issuecomment-704729775


   I'll rebase it and at least move changes for bindy component  (caused by change of  doc) into separate commit (in case rebasing won't remove it)


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500486217



##########
File path: integration-tests/shiro/src/main/java/org/apache/camel/quarkus/component/shiro/it/ShiroRouteBuilder.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.quarkus.component.shiro.it;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.camel.CamelAuthorizationException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.shiro.security.ShiroSecurityPolicy;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.IncorrectCredentialsException;
+import org.apache.shiro.authc.LockedAccountException;
+import org.apache.shiro.authc.UnknownAccountException;
+import org.apache.shiro.authz.Permission;
+import org.apache.shiro.authz.permission.WildcardPermission;
+
+public class ShiroRouteBuilder extends RouteBuilder {
+    public static final String DIRECT_SECURE_ENDPOINT = "direct:secureEndpoint";
+    public static final String DIRECT_SECURE_WITH_ROLES = "direct:secureWithRoles";
+    public static final String DIRECT_SECURE_WITH_PERMISSIONS = "direct:secureWithPermissions";
+
+    @Override
+    public void configure() throws Exception {
+        InputStream resource = ShiroRouteBuilder.class.getResourceAsStream("/securityConfig.ini");
+        byte[] bytes = getContext().getTypeConverter().convertTo(byte[].class, resource);
+        Files.write(Paths.get("target", "securityConfig.ini"), bytes);
+        String securityConfig = "target/securityConfig.ini";

Review comment:
       My understanding is that every user of camel-shiro would need to do that. I wonder if something like ShiroSecurityPolicy working from resource could provide value here.




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500768168



##########
File path: extensions/bindy/runtime/src/main/resources/META-INF/quarkus-extension.yaml
##########
@@ -22,7 +22,7 @@
 #
 ---
 name: "Camel Bindy"
-description: "Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages)"
+description: "Marshal and unmarshal between POJOs and Comma separated values (CSV) format using Camel Bindy Marshal and unmarshal between POJOs and fixed field length format using Camel Bindy Marshal and unmarshal between POJOs and key-value pair (KVP) format using Camel Bindy"

Review comment:
       I've noticed it. It would be probably better, to move generated changes in bindy extension into separate commit (bindy's description was changed several days ago - https://github.com/apache/camel/blame/master/components/camel-bindy/src/main/docs/bindy-dataformat.adoc#L5)




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500857730



##########
File path: integration-tests/shiro/src/main/java/org/apache/camel/quarkus/component/shiro/it/ShiroRouteBuilder.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.quarkus.component.shiro.it;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.camel.CamelAuthorizationException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.shiro.security.ShiroSecurityPolicy;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.IncorrectCredentialsException;
+import org.apache.shiro.authc.LockedAccountException;
+import org.apache.shiro.authc.UnknownAccountException;
+import org.apache.shiro.authz.Permission;
+import org.apache.shiro.authz.permission.WildcardPermission;
+
+public class ShiroRouteBuilder extends RouteBuilder {
+    public static final String DIRECT_SECURE_ENDPOINT = "direct:secureEndpoint";
+    public static final String DIRECT_SECURE_WITH_ROLES = "direct:secureWithRoles";
+    public static final String DIRECT_SECURE_WITH_PERMISSIONS = "direct:secureWithPermissions";
+
+    @Override
+    public void configure() throws Exception {
+        InputStream resource = ShiroRouteBuilder.class.getResourceAsStream("/securityConfig.ini");
+        byte[] bytes = getContext().getTypeConverter().convertTo(byte[].class, resource);
+        Files.write(Paths.get("target", "securityConfig.ini"), bytes);
+        String securityConfig = "target/securityConfig.ini";

Review comment:
       I've removed unnecessary code, shiro allows to use classpath resources, which works correctly in native




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500475106



##########
File path: extensions/bindy/runtime/src/main/resources/META-INF/quarkus-extension.yaml
##########
@@ -22,7 +22,7 @@
 #
 ---
 name: "Camel Bindy"
-description: "Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages)"
+description: "Marshal and unmarshal between POJOs and Comma separated values (CSV) format using Camel Bindy Marshal and unmarshal between POJOs and fixed field length format using Camel Bindy Marshal and unmarshal between POJOs and key-value pair (KVP) format using Camel Bindy"

Review comment:
       It looks bindy is also modified.




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500822362



##########
File path: integration-tests/shiro/src/main/resources/application.properties
##########
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+quarkus.native.additional-build-args = -H:IncludeResources=securityConfig.ini

Review comment:
       I've refactored PR to use `include-patterns`




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500770008



##########
File path: integration-tests/shiro/src/main/java/org/apache/camel/quarkus/component/shiro/it/ShiroRouteBuilder.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.quarkus.component.shiro.it;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.camel.CamelAuthorizationException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.shiro.security.ShiroSecurityPolicy;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.IncorrectCredentialsException;
+import org.apache.shiro.authc.LockedAccountException;
+import org.apache.shiro.authc.UnknownAccountException;
+import org.apache.shiro.authz.Permission;
+import org.apache.shiro.authz.permission.WildcardPermission;
+
+public class ShiroRouteBuilder extends RouteBuilder {
+    public static final String DIRECT_SECURE_ENDPOINT = "direct:secureEndpoint";
+    public static final String DIRECT_SECURE_WITH_ROLES = "direct:secureWithRoles";
+    public static final String DIRECT_SECURE_WITH_PERMISSIONS = "direct:secureWithPermissions";
+
+    @Override
+    public void configure() throws Exception {
+        InputStream resource = ShiroRouteBuilder.class.getResourceAsStream("/securityConfig.ini");
+        byte[] bytes = getContext().getTypeConverter().convertTo(byte[].class, resource);
+        Files.write(Paths.get("target", "securityConfig.ini"), bytes);
+        String securityConfig = "target/securityConfig.ini";

Review comment:
       It's a nice idea. I'll try to use resource, which would make this few lines obsolete. In case it would need some small changes in camel-shiro, I'll prepare it also (PR needs to be against camel-master, so it won't cause any problems)




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500774014



##########
File path: extensions/bindy/runtime/src/main/resources/META-INF/quarkus-extension.yaml
##########
@@ -22,7 +22,7 @@
 #
 ---
 name: "Camel Bindy"
-description: "Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages)"
+description: "Marshal and unmarshal between POJOs and Comma separated values (CSV) format using Camel Bindy Marshal and unmarshal between POJOs and fixed field length format using Camel Bindy Marshal and unmarshal between POJOs and key-value pair (KVP) format using Camel Bindy"

Review comment:
       I've moved bot snakeYAML and bindy changes into separate commit




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500769004



##########
File path: integration-tests/shiro/src/main/resources/application.properties
##########
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+quarkus.native.additional-build-args = -H:IncludeResources=securityConfig.ini

Review comment:
       I'll try to use suggested way of including resources (I was thinking about it several days ago, but because I didn't need any regex, I kept this simple approach - taken from some quarkus doc)




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] aldettinger commented on pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
aldettinger commented on pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#issuecomment-704818657


   Ok, I see the build issue is coming from another component. Merged.


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#discussion_r500767111



##########
File path: extensions/bindy/runtime/src/main/resources/META-INF/quarkus-extension.yaml
##########
@@ -22,7 +22,7 @@
 #
 ---
 name: "Camel Bindy"
-description: "Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages)"
+description: "Marshal and unmarshal between POJOs and Comma separated values (CSV) format using Camel Bindy Marshal and unmarshal between POJOs and fixed field length format using Camel Bindy Marshal and unmarshal between POJOs and key-value pair (KVP) format using Camel Bindy"

Review comment:
       Similar issue for SnakeYAML. 




----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] aldettinger merged pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
aldettinger merged pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879


   


----------------------------------------------------------------
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.

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



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #1879: Shiro native support #1844

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #1879:
URL: https://github.com/apache/camel-quarkus/pull/1879#issuecomment-704357048


   I've added change in bom, which is not necessary and is the reason of the build failure. I'll fix it.


----------------------------------------------------------------
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.

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