Skip to content

Instantly share code, notes, and snippets.

View cmoulliard's full-sized avatar
🏠
Working from home

Charles Moulliard cmoulliard

🏠
Working from home
View GitHub Profile
@cmoulliard
cmoulliard / gist:0dc9a0981ad9099bb4e6
Created May 27, 2015 07:40
Apache Camel with DSL
package org.jboss.fuse.camel;
import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
{
"id" : "aa61d4ca-906a-45f7-a665-35f1e7c111d4",
"realm" : "demo",
"notBefore" : 0,
"accessTokenLifespan" : 300,
"ssoSessionIdleTimeout" : 1800,
"ssoSessionMaxLifespan" : 36000,
"accessCodeLifespan" : 60,
"accessCodeLifespanUserAction" : 300,
"accessCodeLifespanLogin" : 1800,
#!/usr/bin/env bash
REALM=demo
USER=demo
PASSWORD=demo
HOST=127.0.0.1
PORT_HTTP=8080
PORT_HTTPS=8443
#TOKEN=$(curl -X POST http://127.0.0.1:8080/auth/realms/$REALM/protocol/openid-connect/token -H "Content-Type: application/x-www-form-urlencoded" -d 'username=$USER' -d 'password=$PASSWORD' -d 'grant_type=password' -d 'client_id=$USER' | jq -r '.access_token')
@cmoulliard
cmoulliard / common-security.xml
Created January 16, 2013 11:05
common-security
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring-security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd
http://camel.apache.org/schema/spring-security
package com.redhat.fuse.example.camel;
import com.redhat.fuse.example.CustomerService;
import com.redhat.fuse.example.CustomerType;
import com.redhat.fuse.example.GetCustomerByName;
import com.redhat.fuse.example.GetCustomerByNameResponse;
import org.apache.camel.CamelContext;
import org.apache.camel.test.junit4.CamelSpringTestSupport;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
@cmoulliard
cmoulliard / CamelContext2.xml
Created January 16, 2013 11:05
camel-spring-security
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring
package org.jboss.fuse.training.camel;
import org.apache.camel.*;
import org.apache.camel.builder.DefaultErrorHandlerBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.*;
import org.apache.camel.spi.RouteContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.jboss.fuse.training.camel;
import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.LoggingLevel;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
package org.jboss.fuse.training.camel;
import org.apache.camel.*;
import org.apache.camel.builder.DefaultErrorHandlerBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.*;
import org.apache.camel.spi.RouteContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;