use of org.finos.symphony.toolkit.spring.app.pods.info.PodInfo 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.app.pods.info.PodInfo in project spring-bot by finos.
the class PodInfoStoreTokenStrategy method getPodApi.
@Override
protected PodApi getPodApi(Map<String, Object> claims) throws Exception {
String companyId = getCompanyId(claims);
PodInfo pi = getPodProperties(companyId);
if (pi == null) {
return null;
}
ApiBuilder ab = setupApiBuilder(pi, pi.getPayload().getPodUrl());
return ab.getApi(PodApi.class);
}
Aggregations