Commit 55ab224a authored by neelesh thakur's avatar neelesh thakur
Browse files

isolate entitlements v2 for Azure only

parent 2f9924fa
Pipeline #30671 failed with stages
in 27 minutes and 7 seconds
......@@ -16,9 +16,9 @@
package org.opengroup.osdu.notification.auth;
import org.opengroup.osdu.core.common.entitlements.v2.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.v2.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.v2.IEntitlementsFactory;
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.opengroup.osdu.notification.provider.interfaces.IAppProperties;
import org.springframework.beans.factory.annotation.Autowired;
......
/*
* Copyright 2017-2021, Schlumberger
*
* 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
*
* 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.opengroup.osdu.notification.provider.azure.security;
import org.opengroup.osdu.core.common.entitlements.v2.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.v2.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.v2.IEntitlementsFactory;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.opengroup.osdu.notification.provider.interfaces.IAppProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@Component
@Primary
public class EntitlementsClientFactory2 extends AbstractFactoryBean<IEntitlementsFactory> {
@Autowired
private IAppProperties config;
@Autowired
private HttpResponseBodyMapper responseBodyMapper;
@Override
protected IEntitlementsFactory createInstance() {
return new EntitlementsFactory(EntitlementsAPIConfig.builder().rootUrl(config.getAuthorizeAPI()).build(),
responseBodyMapper);
}
@Override
public Class<?> getObjectType() {
return IEntitlementsFactory.class;
}
}
Markdown is supported
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