use of org.finos.symphony.toolkit.spring.api.properties.PodProperties in project spring-bot by finos.
the class ConfiguredPodTokenStrategy method getPodApi.
@Override
protected PodApi getPodApi(Map<String, Object> claims) throws Exception {
String companyId = getCompanyId(claims);
PodProperties pp = getPodProperties(companyId);
if (pp == null) {
return null;
}
ConfigurableApiBuilder ab = abf.getObject();
pp.getPod().configure(ab, new ApiWrapper[] {}, appIdentity, trustManagers);
return ab.getApi(PodApi.class);
}
use of org.finos.symphony.toolkit.spring.api.properties.PodProperties in project spring-bot by finos.
the class DefaultPodInfoConverter method convert.
@Override
public PodProperties convert(PodInfo podInfo) {
if (podInfo == null) {
return null;
}
PodProperties out = new PodProperties();
out.setId(podInfo.getCompanyId());
out.setSessionAuth(setupSessionAuth(podInfo));
out.setPod(setupPod(podInfo));
out.setAgent(setupAgent(podInfo));
out.setLogin(setupLogin(podInfo));
decideAuthMethod(out);
return out;
}
use of org.finos.symphony.toolkit.spring.api.properties.PodProperties in project spring-bot by finos.
the class TokenManagingOboApiInstanceFactory method getPodProperties.
public PodProperties getPodProperties(String companyId) {
if (podPropertiesList != null) {
// pod.
if (companyId == null) {
return podPropertiesList.get(0);
}
// find matching pod/company id
for (PodProperties podProperties : podPropertiesList) {
if (companyId.equals(podProperties.getId())) {
return podProperties;
}
}
}
if ((ps != null) && (converter != null)) {
PodInfo pi = ps.getPodInfo(companyId);
PodProperties out = converter.convert(pi);
if (out != null) {
return out;
}
}
throw new IllegalArgumentException("Couldn't find pod properties for company ID: " + companyId + ". Maybe set this in application.yml");
}
use of org.finos.symphony.toolkit.spring.api.properties.PodProperties in project spring-bot by finos.
the class KoreAIBridgeFactoryImpl method firstPodProperties.
/**
* First pod is the only one used for bridging KoreAI. In future, make this configurable.
*/
protected PodProperties firstPodProperties(SymphonyApiProperties apiProperties) {
PodProperties pp;
if (apiProperties.getApis().size() != 1) {
throw new IllegalArgumentException("KoreAI Bridge must have the details of a single pod configured");
}
pp = apiProperties.getApis().get(0);
return pp;
}
Aggregations