174.12. Cryostatty 처리기 및 보안 구성
끝점에서adingty 처리기 목록을 구성할 수 있습니다. 이 핸들러 목록은 고급 Cryostat 보안 기능을 활성화하는 데 유용할 수 있습니다. 이러한 처리기는 Spring XML에서 다음과 같이 구성됩니다.
<-- Jetty Security handling -->
<bean id="userRealm" class="org.mortbay.jetty.plus.jaas.JAASUserRealm">
<property name="name" value="tracker-users"/>
<property name="loginModuleName" value="ldaploginmodule"/>
</bean>
<bean id="constraint" class="org.mortbay.jetty.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="tracker-users"/>
<property name="authenticate" value="true"/>
</bean>
<bean id="constraintMapping" class="org.mortbay.jetty.security.ConstraintMapping">
<property name="constraint" ref="constraint"/>
<property name="pathSpec" value="/*"/>
</bean>
<bean id="securityHandler" class="org.mortbay.jetty.security.SecurityHandler">
<property name="userRealm" ref="userRealm"/>
<property name="constraintMappings" ref="constraintMapping"/>
</bean>
Camel 2.3 이후부터 다음과 같이 Cryostatty 처리기 목록을 구성할 수 있습니다.
<-- Jetty Security handling -->
<bean id="constraint" class="org.eclipse.jetty.http.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="tracker-users"/>
<property name="authenticate" value="true"/>
</bean>
<bean id="constraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="constraint"/>
<property name="pathSpec" value="/*"/>
</bean>
<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<property name="authenticator">
<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
</property>
<property name="constraintMappings">
<list>
<ref bean="constraintMapping"/>
</list>
</property>
</bean>
그런 다음 끝점을 다음과 같이 정의할 수 있습니다.
from("jetty:http://0.0.0.0:9080/myservice?handlers=securityHandler")
더 많은 처리기가 필요한 경우 처리기 옵션을 쉼표로 구분된 빈 ID 목록으로 설정합니다.