| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| 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. |
| --> |
| <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.3.0" |
| xmlns:cxf="http://cxf.apache.org/blueprint/core" |
| xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs" |
| xsi:schemaLocation=" |
| http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd |
| http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd |
| http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.3.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.3.0.xsd |
| "> |
| |
| <cm:property-placeholder persistent-id="org.apache.brooklyn.ui.modularity"> |
| <cm:default-properties> |
| <cm:property name="ui.metadata.api.path" value="/ui-metadata-registry"/> |
| </cm:default-properties> |
| </cm:property-placeholder> |
| |
| <reference id="localManagementContext" |
| interface="org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal"/> |
| |
| <reference id="shutdownHandler" interface="org.apache.brooklyn.core.mgmt.ShutdownHandler"/> |
| |
| <cm:property-placeholder persistent-id="org.apache.brooklyn.rest.filter.cors" placeholder-prefix="$cors{"> |
| <!-- since we have properties above for this bundle we need a unique prefix/suffix here --> |
| <cm:default-properties> |
| <cm:property name="cors.enabled" value="true"/> |
| <cm:property name="cors.allow.origins" value=""/> |
| <cm:property name="cors.allow.headers" value=""/> |
| <cm:property name="cors.expose.headers" value=""/> |
| <cm:property name="cors.allow.credentials" value="true"/> |
| <cm:property name="cors.max.age" value="-1"/> |
| <cm:property name="cors.preflight.error.status" value="200"/> |
| <cm:property name="cors.block.if.unauthorized" value="false"/> |
| </cm:default-properties> |
| </cm:property-placeholder> |
| |
| <bean class="org.apache.brooklyn.rest.filter.CorsImplSupplierFilter" id="cors-filter"> |
| <property name="enableCors" value="$cors{cors.enabled}"/> |
| <property name="allowOrigins" value="$cors{cors.allow.origins}"/> |
| <property name="allowHeaders" value="$cors{cors.allow.headers}"/> |
| <property name="exposeHeaders" value="$cors{cors.expose.headers}"/> |
| <property name="allowCredentials" value="$cors{cors.allow.credentials}"/> |
| <property name="maxAge" value="$cors{cors.max.age}"/> |
| <property name="preflightErrorStatus" value="$cors{cors.preflight.error.status}"/> |
| <property name="blockCorsIfUnauthorized" value="$cors{cors.block.if.unauthorized}"/> |
| </bean> |
| |
| <bean id="registry" class="org.apache.brooklyn.ui.modularity.metadata.registry.impl.UiMetadataRegistryImpl"/> |
| |
| <service id="uiMetadataRegistryService" ref="registry" interface="org.apache.brooklyn.ui.modularity.metadata.registry.UiMetadataRegistry"/> |
| |
| <jaxrs:server id="metadataRestApi" address="${ui.metadata.api.path}"> |
| <jaxrs:serviceBeans> |
| <bean class="org.apache.brooklyn.ui.modularity.metadata.registry.RestUiMetadataRegistry"> |
| <property name="metadataRegistry" ref="registry"/> |
| </bean> |
| </jaxrs:serviceBeans> |
| |
| <jaxrs:providers> |
| <bean class="org.apache.brooklyn.rest.util.DefaultExceptionMapper"/> |
| <bean class="org.apache.brooklyn.rest.util.json.BrooklynJacksonJsonProvider"/> |
| <bean class="org.apache.brooklyn.rest.util.FormMapProvider"/> |
| <bean class="org.apache.brooklyn.rest.util.ManagementContextProvider"> |
| <argument ref="localManagementContext"/> |
| </bean> |
| <bean class="org.apache.brooklyn.rest.filter.BrooklynSecurityProviderFilterJersey"/> |
| <bean class="org.apache.brooklyn.rest.filter.CsrfTokenFilter"/> |
| <bean class="org.apache.brooklyn.rest.filter.RequestTaggingRsFilter"/> |
| <bean class="org.apache.brooklyn.rest.filter.NoCacheFilter"/> |
| <bean class="org.apache.brooklyn.rest.filter.HaHotCheckResourceFilter"/> |
| <bean class="org.apache.brooklyn.rest.filter.EntitlementContextFilter"/> |
| <bean class="org.apache.brooklyn.rest.filter.LoggingResourceFilter"/> |
| <bean class="io.swagger.jaxrs.listing.SwaggerSerializers"/> |
| <bean class="org.apache.brooklyn.rest.util.ShutdownHandlerProvider"> |
| <argument ref="shutdownHandler"/> |
| </bean> |
| <ref component-id="cors-filter"/> |
| </jaxrs:providers> |
| |
| <jaxrs:properties> |
| <entry key="default.wae.mapper.least.specific" value="true"/> |
| </jaxrs:properties> |
| </jaxrs:server> |
| </blueprint> |