Skip to content

Commit

Permalink
Feature/1.1 final (#3)
Browse files Browse the repository at this point in the history
* feature/1.1-final: fix bug for domain name

* feature/1.1-final: update libs
  • Loading branch information
dsun0720 committed May 4, 2022
1 parent 297c25e commit 371a441
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 36 deletions.
Expand Up @@ -10,9 +10,9 @@ public class FFCClientConfigProperties {

private int startWait = 15;

private String streamUri = "wss://api.feature-flags.co";
private String streamUri;

private String eventUri = "https://api.feature-flags.co";
private String eventUri;

private String proxyHost;

Expand Down
Expand Up @@ -8,6 +8,7 @@
import co.featureflags.server.exterior.FFCClient;
import co.featureflags.server.exterior.HttpConfigurationBuilder;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -23,25 +24,34 @@ public class FFCClientConfiguration {
@Bean
public FFCClient ffcClient(FFCClientConfigProperties properties) {
checkArgument(Base64.isBase64(properties.getEnvSecret()), "envSecret is invalid");
HttpConfigurationBuilder builder = Factory.httpConfigFactory();
HttpConfigurationBuilder httpConfigFactory = Factory.httpConfigFactory();
if (properties.getProxyHost() != null && properties.getProxyPort() > 0) {
builder.httpProxy(properties.getProxyHost(), properties.getProxyPort());
httpConfigFactory.httpProxy(properties.getProxyHost(), properties.getProxyPort());
if (properties.getProxyUser() != null && properties.getProxyPassword() != null) {
builder.passwordAuthenticator(properties.getProxyUser(), properties.getProxyPassword());
httpConfigFactory.passwordAuthenticator(properties.getProxyUser(), properties.getProxyPassword());
}
}
StreamingBuilder streamingBuilder = Factory.streamingBuilder()
.newStreamingURI(properties.getStreamUri());

InsightProcessorBuilder insightProcessorBuilder = Factory.insightProcessorFactory()
.eventUri(properties.getEventUri());
FFCConfig config = new FFCConfig.Builder()
String streamUri = properties.getStreamUri();
StreamingBuilder streamingBuilder =
StringUtils.isBlank(streamUri) ? null : Factory.streamingBuilder().newStreamingURI(streamUri);

String eventUri = properties.getEventUri();
InsightProcessorBuilder insightProcessorBuilder =
StringUtils.isBlank(eventUri) ? null : Factory.insightProcessorFactory().eventUri(eventUri);

FFCConfig.Builder builder = new FFCConfig.Builder()
.offline(properties.isOffline())
.startWaitTime(Duration.ofSeconds(properties.getStartWait()))
.httpConfigFactory(builder)
.updateProcessorFactory(streamingBuilder)
.insightProcessorFactory(insightProcessorBuilder)
.build();
return new FFCClientImp(properties.getEnvSecret(), config);
.httpConfigFactory(httpConfigFactory);

if (streamingBuilder != null) {
builder.updateProcessorFactory(streamingBuilder);
}

if (insightProcessorBuilder != null) {
builder.insightProcessorFactory(insightProcessorBuilder);
}
return new FFCClientImp(properties.getEnvSecret(), builder.build());
}
}
Expand Up @@ -9,6 +9,6 @@
<version>1.0</version>
<version>1.1</version>
</versions>
<lastUpdated>20220504030153</lastUpdated>
<lastUpdated>20220504203900</lastUpdated>
</versioning>
</metadata>
@@ -1 +1 @@
f70c4276b224f28d4ab8cb9abbfae581
3e6df89b227a30b1fdf0956a8a68e82a
@@ -1 +1 @@
4295e3255ec78c7e446c96f791a41b05796b598b
1d60cfcddbad34dc9480ba02faaaccc268fe6ae2
Binary file not shown.
@@ -1 +1 @@
171598ee5cd366e44127011109e78fd8
2adf24b1cba9a6654d679fef156d23f3
@@ -1 +1 @@
aff1fa5ecbffd7a5c38a935dc60802c92380d4ab
2667e9747d1da7fff049495d309b3aac91840447
Binary file not shown.
@@ -1 +1 @@
8a83947a1aa7ba781f4f99c12b770cd5
63ffbf969d5ab3874025c48e50ceb930
@@ -1 +1 @@
cd1d571eb900490027bc78df3d46ba6805946758
90c2f3d4d9f157b7b241adc9bb96f613575179c8
Binary file not shown.
@@ -1 +1 @@
cf67236151ef53fab2eb44b112645e30
c230919ca03de657a9cc4a42b4eeacb0
@@ -1 +1 @@
2d7d3a20cde27367a7e54eae2b614bf6f371574e
40c4fe0bd732cd76806f94430729addc4550e25a
Expand Up @@ -9,6 +9,6 @@
<version>1.0</version>
<version>1.1</version>
</versions>
<lastUpdated>20220504030156</lastUpdated>
<lastUpdated>20220504203903</lastUpdated>
</versioning>
</metadata>
@@ -1 +1 @@
03fdc6ac4ddd2d9969f032dad9afc237
c3a891a9bf167f3124e50b01d4f6899e
@@ -1 +1 @@
a32dae5bfbcb52780ed8be07387da1dbb527d229
c2a53f4a07be2830596755d021290fa5a78abd18
Binary file not shown.
@@ -1 +1 @@
062c0ab790f6e9735fc39d821789f191
ee66a30357bd125b7fedea3ad6a17bc8
@@ -1 +1 @@
c72027d23d3afd3133ff2a8edb84b678a05b703f
522bf7df1ccba7d6fbaa8365976e24f734783367
Binary file not shown.
@@ -1 +1 @@
a2662957e4e2c5fb318b14e9d911c791
f6b677fdde64256a2951bf865d593d35
@@ -1 +1 @@
66a59633f6c7f3e92fbf780631414d2b0b2ac76c
b8b23eef82c4dacdd933e0bfc46246fc11ffca29
Binary file not shown.
@@ -1 +1 @@
331802dc8181160b70f81fb4a2119d16
762fabd44a73f090de73dad267c18e7c
@@ -1 +1 @@
e6509a2a53fcd87524bb8eacaf134e0ed1a2d1de
7bcc4204322d72572e455777a4bf6f18c8af171b
Expand Up @@ -9,6 +9,6 @@
<version>1.0</version>
<version>1.1</version>
</versions>
<lastUpdated>20220504030155</lastUpdated>
<lastUpdated>20220504203902</lastUpdated>
</versioning>
</metadata>
@@ -1 +1 @@
fe9928113f54bfad1d907ba969701695
86cab12878a7f7b971c36979631afad3
@@ -1 +1 @@
abc97df308470038dead090b6115622017fb905a
4148dbe324d1a3961ed0cc8539a7fd7a7e41c922

0 comments on commit 371a441

Please sign in to comment.