Commit 46aa6fb9 authored by Dmitriy Novikov's avatar Dmitriy Novikov
Browse files

Updated indexer config

parent dcb16295
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.opengroup.osdu.indexer.di;
package org.opengroup.osdu.indexer.config;
import org.opengroup.osdu.core.common.partition.IPartitionProvider;
import org.opengroup.osdu.core.common.provider.interfaces.IElasticRepository;
......@@ -27,9 +27,10 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class ElasticSearchConfig {
@Bean
public IElasticRepository elasticRepository(ElasticSearchConfigurationProperties properties,
IPartitionProvider partitionProvider, IPartitionPropertyResolver propertyResolver) {
return new ElasticSearchDestinationResolver(properties.getElasticsearchPropertiesPrefix(), partitionProvider, propertyResolver);
}
@Bean
public IElasticRepository elasticRepository(ElasticSearchConfigurationProperties properties,
IPartitionProvider partitionProvider, IPartitionPropertyResolver propertyResolver) {
return new ElasticSearchDestinationResolver(properties.getElasticsearchPropertiesPrefix(),
partitionProvider, propertyResolver);
}
}
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.opengroup.osdu.indexer.di;
package org.opengroup.osdu.indexer.config;
import lombok.Getter;
import lombok.Setter;
......
/*
* Copyright 2022 Google LLC
* Copyright 2022 EPAM Systems, Inc
*
* Licensed 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
*
* https://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.opengroup.osdu.indexer.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Setter
@Getter
@ConfigurationProperties(prefix = "osdu.entitlements")
public class EntitlementsProperties {
private String url;
private String appKey;
}
/*
* Copyright 2022 Google LLC
* Copyright 2022 EPAM Systems, Inc
*
* Licensed 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
*
* https://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.opengroup.osdu.indexer.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Setter
@Getter
@ConfigurationProperties
public class IndexerConfigProperties {
private String recordsTopicName;
}
......@@ -14,38 +14,32 @@
package org.opengroup.osdu.indexer.di;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.opengroup.osdu.indexer.config.EntitlementsProperties;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
@Slf4j
@RequiredArgsConstructor
@Component
@RequestScope
@Lazy
public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlementsFactory> {
@Value("${AUTHORIZE_API}")
private String authorizeApi;
@Value("${AUTHORIZE_API_KEY:}")
private String authorizeApiKey;
@Autowired
private HttpResponseBodyMapper mapper;
private final EntitlementsProperties entitlementsProperties;
private final HttpResponseBodyMapper mapper;
@Override
protected IEntitlementsFactory createInstance() throws Exception {
protected IEntitlementsFactory createInstance() {
return new EntitlementsFactory(EntitlementsAPIConfig
.builder()
.rootUrl(authorizeApi)
.apiKey(authorizeApiKey)
.rootUrl(entitlementsProperties.getUrl())
.apiKey(entitlementsProperties.getAppKey())
.build(),
mapper);
}
......
......@@ -3,4 +3,5 @@ service.token.provider=OPENID
partition-auth-enabled=false
openid.provider-url=
openid.provider-client-id=
openid.provider-client-secret=
\ No newline at end of file
openid.provider-client-secret=
indexer.task.enable=false
\ No newline at end of file
oqmDriver=pubsub
service.token.provider=GCP
partition-auth-enabled=true
\ No newline at end of file
partition-auth-enabled=true
indexer.task.enable=true
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment