Search in sources :

Example 1 with IdentityProperties

use of org.finos.symphony.toolkit.spring.api.properties.IdentityProperties in project spring-bot by finos.

the class BasicAppIdentityProvider method getFileResourceLocation.

protected IdentityProperties getFileResourceLocation(String appId) {
    IdentityProperties p = new IdentityProperties();
    p.setType(Type.JSON);
    p.setLocation("file:./" + appId + JSON);
    return p;
}
Also used : IdentityProperties(org.finos.symphony.toolkit.spring.api.properties.IdentityProperties)

Example 2 with IdentityProperties

use of org.finos.symphony.toolkit.spring.api.properties.IdentityProperties in project spring-bot by finos.

the class BasicAppIdentityProvider method getIdentity.

public SymphonyIdentity getIdentity() throws Exception {
    SymphonyIdentity out = null;
    IdentityProperties identity = p.getIdentity();
    String appId = getAppId(p);
    if (identity != null) {
        out = performIdentityLoad(identity, appId);
    }
    if (out == null) {
        out = performIdentityLoad(getClasspathResourceLocation(appId), appId);
    }
    if (out == null) {
        out = performIdentityLoad(getFileResourceLocation(appId), appId);
    }
    if (out == null) {
        throw new IdentityConfigurationException("Couldn't load app identity", null);
    }
    return out;
}
Also used : SymphonyIdentity(com.symphony.api.id.SymphonyIdentity) IdentityConfigurationException(com.symphony.api.id.IdentityConfigurationException) IdentityProperties(org.finos.symphony.toolkit.spring.api.properties.IdentityProperties)

Example 3 with IdentityProperties

use of org.finos.symphony.toolkit.spring.api.properties.IdentityProperties in project spring-bot by finos.

the class BasicAppIdentityProvider method getClasspathResourceLocation.

protected IdentityProperties getClasspathResourceLocation(String appId) {
    IdentityProperties p = new IdentityProperties();
    p.setType(Type.JSON);
    p.setLocation("classpath:/ssl/" + appId + JSON);
    return p;
}
Also used : IdentityProperties(org.finos.symphony.toolkit.spring.api.properties.IdentityProperties)

Aggregations

IdentityProperties (org.finos.symphony.toolkit.spring.api.properties.IdentityProperties)3 IdentityConfigurationException (com.symphony.api.id.IdentityConfigurationException)1 SymphonyIdentity (com.symphony.api.id.SymphonyIdentity)1