Search in sources :

Example 1 with PodProperties

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);
}
Also used : ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder) PodProperties(org.finos.symphony.toolkit.spring.api.properties.PodProperties)

Example 2 with PodProperties

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;
}
Also used : PodProperties(org.finos.symphony.toolkit.spring.api.properties.PodProperties)

Example 3 with PodProperties

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");
}
Also used : PodInfo(org.finos.symphony.toolkit.spring.app.pods.info.PodInfo) PodProperties(org.finos.symphony.toolkit.spring.api.properties.PodProperties)

Example 4 with PodProperties

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;
}
Also used : PodProperties(org.finos.symphony.toolkit.spring.api.properties.PodProperties)

Aggregations

PodProperties (org.finos.symphony.toolkit.spring.api.properties.PodProperties)4 ConfigurableApiBuilder (com.symphony.api.bindings.ConfigurableApiBuilder)1 PodInfo (org.finos.symphony.toolkit.spring.app.pods.info.PodInfo)1