finos / spring-bot

Spring Boot + Java Integration for Symphony/Teams Chat Platform Bots and Apps
https://springbot.finos.org
Apache License 2.0
60 stars 35 forks source link

Add user agent details to BDK signature #374

Closed robmoffat closed 7 months ago

robmoffat commented 1 year ago

Every API call in Symphony has a user agent so they know which version of BDK is used. We should add a "+Spring Bot vXXX" to this.

robmoffat commented 7 months ago

ApiClientBuilderJersey2 uses ApiUtils.getUserAgent() (which is static) to set the user-agent string to "Symphony-BDK-Java/" + getBdkVersion() + " Java/" + System.getProperty("java.version")

In symphony-bdk-spring-boot-starter this is configured here:

public class BdkCoreConfig {

  @Bean
  @ConditionalOnMissingBean
  public ApiClientFactory apiClientFactory(SymphonyBdkCoreProperties properties) {
    return new ApiClientFactory(properties, new ApiClientBuilderProviderJersey2()); // TODO create RestTemplate/or WebClient implementation
  }

This is used by SymphonyBdkAutoConfiguration, which is used by our code, SymphonyWorkflowConfig

We could auto-wire the APIClientFactory and the overwrite user agent in there.

robmoffat commented 7 months ago

DB aren't interested in implementing this since they aren't using Symphony with Spring Bot anymore