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:
us...@infra.apache.org


Reply via email to