Search in sources :

Example 1 with ApiBuilder

use of com.symphony.api.bindings.ApiBuilder in project spring-bot by finos.

the class PodInfoStoreTokenStrategy method certBasedRequest.

@Override
protected ExtensionAppTokens certBasedRequest(String appToken, PodInfo pod) throws Exception {
    ApiBuilder ab = setupApiBuilder(pod, pod.getPayload().getSessionAuthUrl());
    CertificateAuthenticationApi aa = ab.getApi(CertificateAuthenticationApi.class);
    ExtensionAppAuthenticateRequest ar = new ExtensionAppAuthenticateRequest();
    ar.setAppToken(appToken);
    ExtensionAppTokens out = aa.v1AuthenticateExtensionAppPost(ar);
    return out;
}
Also used : ExtensionAppTokens(com.symphony.api.model.ExtensionAppTokens) ExtensionAppAuthenticateRequest(com.symphony.api.model.ExtensionAppAuthenticateRequest) CertificateAuthenticationApi(com.symphony.api.authenticator.CertificateAuthenticationApi) ApiBuilder(com.symphony.api.bindings.ApiBuilder) ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder)

Example 2 with ApiBuilder

use of com.symphony.api.bindings.ApiBuilder in project spring-bot by finos.

the class DefaultApiInstanceFactory method createApiInstance.

@Override
public ApiInstance createApiInstance(SymphonyIdentity id, PodProperties pp, TrustManager[] trustManagers) throws Exception {
    ApiInstance parent = super.createApiInstance(id, pp, trustManagers);
    ApiBuilder agentApiBuilder = ((BasicAPIInstance) parent).agentApiBuilder;
    AgentHealthHelper agentHealth = new AgentHealthHelper(agentApiBuilder);
    HealthCheckingApiInstance out = new HealthCheckingApiInstance(parent, agentHealth);
    if (registry != null) {
        String healthIndicatorName = "symphony-api-" + id.getCommonName() + "-" + pp.getId();
        if (registry.getContributor(healthIndicatorName) == null) {
            registry.registerContributor(healthIndicatorName, out);
        }
    }
    return out;
}
Also used : AgentHealthHelper(org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper) ApiBuilder(com.symphony.api.bindings.ApiBuilder)

Example 3 with ApiBuilder

use of com.symphony.api.bindings.ApiBuilder in project spring-bot by finos.

the class AbstractGenericInstanceTokenManagingFactory method createApiInstance.

@Override
public ApiInstance createApiInstance(ID id, PodProperties pp, TrustManager[] trustManagers) throws Exception {
    ApiBuilder sessionAuthApiBuilder = createApiBuilder(pp, pp.getSessionAuth(), id, trustManagers, "sessionAuth");
    ApiBuilder keyAuthApiBuilder = createApiBuilder(pp, pp.getKeyAuth(), id, trustManagers, "keyAuth");
    ApiBuilder relayApiBuilder = createApiBuilder(pp, pp.getRelay(), id, trustManagers, "relay");
    ApiBuilder loginApiBuilder = createApiBuilder(pp, pp.getLogin(), id, trustManagers, "login");
    TokenManager tm = createTokenManager(id, pp, sessionAuthApiBuilder, keyAuthApiBuilder, relayApiBuilder, loginApiBuilder);
    ApiBuilder podApiBuilder = createApiBuilder(pp, pp.getPod(), id, trustManagers, "pod", tm);
    ApiBuilder agentApiBuilder = createApiBuilder(pp, pp.getAgent(), id, trustManagers, "agent", tm);
    ApiInstance out = new BasicAPIInstance(sessionAuthApiBuilder, keyAuthApiBuilder, relayApiBuilder, loginApiBuilder, podApiBuilder, agentApiBuilder, getIdentity(id));
    return out;
}
Also used : TokenManager(com.symphony.api.bindings.TokenManager) ApiBuilder(com.symphony.api.bindings.ApiBuilder)

Example 4 with ApiBuilder

use of com.symphony.api.bindings.ApiBuilder 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);
}
Also used : PodInfo(org.finos.symphony.toolkit.spring.app.pods.info.PodInfo) ApiBuilder(com.symphony.api.bindings.ApiBuilder) ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder)

Aggregations

ApiBuilder (com.symphony.api.bindings.ApiBuilder)4 ConfigurableApiBuilder (com.symphony.api.bindings.ConfigurableApiBuilder)2 CertificateAuthenticationApi (com.symphony.api.authenticator.CertificateAuthenticationApi)1 TokenManager (com.symphony.api.bindings.TokenManager)1 ExtensionAppAuthenticateRequest (com.symphony.api.model.ExtensionAppAuthenticateRequest)1 ExtensionAppTokens (com.symphony.api.model.ExtensionAppTokens)1 AgentHealthHelper (org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper)1 PodInfo (org.finos.symphony.toolkit.spring.app.pods.info.PodInfo)1