|
2 | 2 |
|
3 | 3 | import com.flagsmith.FlagsmithClient;
|
4 | 4 | import com.flagsmith.config.FlagsmithCacheConfig;
|
| 5 | +import com.flagsmith.config.FlagsmithConfig; |
5 | 6 | import com.flagsmith.config.Retry;
|
6 | 7 | import dev.openfeature.contrib.providers.flagsmith.exceptions.InvalidCacheOptionsException;
|
7 | 8 | import dev.openfeature.contrib.providers.flagsmith.exceptions.InvalidOptionsException;
|
@@ -35,7 +36,7 @@ static FlagsmithClient initializeProvider(FlagsmithProviderOptions options) {
|
35 | 36 | flagsmithBuilder.withCache(flagsmithCacheConfig);
|
36 | 37 | }
|
37 | 38 |
|
38 |
| - com.flagsmith.config.FlagsmithConfig flagsmithConfig = initializeConfig(options); |
| 39 | + final FlagsmithConfig flagsmithConfig = initializeConfig(options); |
39 | 40 | flagsmithBuilder.withConfiguration(flagsmithConfig);
|
40 | 41 |
|
41 | 42 | return flagsmithBuilder.build();
|
@@ -88,10 +89,8 @@ private static FlagsmithCacheConfig initializeCacheConfig(FlagsmithProviderOptio
|
88 | 89 | * @param options The options used to create the provider
|
89 | 90 | * @return a FlagsmithConfig object with the FlagsmithClient settings
|
90 | 91 | */
|
91 |
| - private static com.flagsmith.config.FlagsmithConfig initializeConfig( |
92 |
| - FlagsmithProviderOptions options) { |
93 |
| - com.flagsmith.config.FlagsmithConfig.Builder flagsmithConfig = com.flagsmith.config.FlagsmithConfig |
94 |
| - .newBuilder(); |
| 92 | + private static FlagsmithConfig initializeConfig(FlagsmithProviderOptions options) { |
| 93 | + FlagsmithConfig.Builder flagsmithConfig = FlagsmithConfig.newBuilder(); |
95 | 94 |
|
96 | 95 | // Set client level configuration settings
|
97 | 96 | if (options.getBaseUri() != null) {
|
@@ -136,6 +135,10 @@ private static com.flagsmith.config.FlagsmithConfig initializeConfig(
|
136 | 135 | flagsmithConfig.withEnableAnalytics(options.isEnableAnalytics());
|
137 | 136 | }
|
138 | 137 |
|
| 138 | + if (options.getSupportedProtocols() != null && !options.getSupportedProtocols().isEmpty()) { |
| 139 | + flagsmithConfig.withSupportedProtocols(options.getSupportedProtocols()); |
| 140 | + } |
| 141 | + |
139 | 142 | return flagsmithConfig.build();
|
140 | 143 | }
|
141 | 144 |
|
|
0 commit comments