Skip to content

Commit 399f2b9

Browse files
fix: consolidate callbackAddress and hostname (#1447)
fix: consolidate callbackAddress and hostname (#1447)
1 parent 6fd6898 commit 399f2b9

26 files changed

Lines changed: 184 additions & 140 deletions

File tree

charts/faaast-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type: application
1111
# This is the chart version. This version number should be incremented each time you make changes
1212
# to the chart and its templates, including the app version.
1313
# Versions are expected to follow Semantic Versioning (https://semver.org/)
14-
version: 1.0.0
14+
version: 1.0.1
1515

1616
# This is the version number of the application being deployed. This version number should be
1717
# incremented each time you make changes to the application. Versions are not expected to

charts/faaast-service/values.full.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ core:
6666
assetConnectionReadMaxThreadPoolSize: 1000
6767
assetConnectionReadTimeout: 5000
6868
assetConnectionWriteMaxThreadPoolSize: 1000
69-
callbackAddress: "https://invalid.local:443/mypath"
7069
requestHandlerThreadPoolSize: 2
7170
submodelRegistries:
7271
- "http://example.com/MySubmodelRegistry"
@@ -137,7 +136,7 @@ endpoints:
137136
corsEnabled: true
138137
corsExposedHeaders: "X-Custom-Header"
139138
corsMaxAge: 1000
140-
hostname: "localhost"
139+
hostname: "https://example.invalid"
141140
httpVersion: "HTTP_2"
142141
pathPrefix: "/api/v3.0"
143142
includeErrorDetails: true

charts/faaast-service/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ core: {}
4646
# core:
4747
# operationTimeout: 60000 # ms, 0 = no timeout
4848
# assetConnectionReadTimeout: 30000 # ms
49-
# callbackAddress: "https://faaast.example.com"
5049
# validationOnLoad:
5150
# validateConstraints: true
5251
# idShortUniqueness: true

core/src/main/java/de/fraunhofer/iosb/ilt/faaast/service/Service.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ public AssetConnectionManager getAssetConnectionManager() {
200200
}
201201

202202

203+
@Override
204+
public List<Endpoint> getEndpoints() {
205+
return endpoints;
206+
}
207+
208+
203209
public ServiceConfig getConfig() {
204210
return config;
205211
}

core/src/main/java/de/fraunhofer/iosb/ilt/faaast/service/ServiceContext.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import de.fraunhofer.iosb.ilt.faaast.service.model.exception.ResourceNotFoundException;
2525
import de.fraunhofer.iosb.ilt.faaast.service.persistence.Persistence;
2626
import de.fraunhofer.iosb.ilt.faaast.service.typing.TypeInfo;
27+
import java.util.List;
2728
import org.eclipse.digitaltwin.aas4j.v3.model.Reference;
2829

2930

@@ -98,4 +99,12 @@ public default <T extends Response> T execute(Request<T> request) {
9899
* @return the AssetConnectionManager of the service
99100
*/
100101
public AssetConnectionManager getAssetConnectionManager();
102+
103+
104+
/**
105+
* Returns the endpoints of the service.
106+
*
107+
* @return the endpoints of the service
108+
*/
109+
public List<Endpoint> getEndpoints();
101110
}

core/src/main/java/de/fraunhofer/iosb/ilt/faaast/service/config/CoreConfig.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public class CoreConfig {
5454
private RegistrySynchronizationConfig registrySynchronization;
5555
private double minInflateRatio;
5656
private long operationTimeout;
57-
private String callbackAddress;
5857

5958
public CoreConfig() {
6059
this.assetConnectionRetryInterval = DEFAULT_ASSET_CONNECTION_RETRY_INTERVAL;
@@ -239,16 +238,6 @@ public void setOperationTimeout(long operationTimeout) {
239238
}
240239

241240

242-
public String getCallbackAddress() {
243-
return callbackAddress;
244-
}
245-
246-
247-
public void setCallbackAddress(String callbackAddress) {
248-
this.callbackAddress = callbackAddress;
249-
}
250-
251-
252241
@Override
253242
public int hashCode() {
254243
return Objects.hash(assetConnectionRetryInterval,
@@ -263,8 +252,7 @@ public int hashCode() {
263252
submodelRegistries,
264253
registrySynchronization,
265254
minInflateRatio,
266-
operationTimeout,
267-
callbackAddress);
255+
operationTimeout);
268256
}
269257

270258

@@ -292,8 +280,7 @@ public boolean equals(Object obj) {
292280
&& Objects.equals(this.submodelRegistries, other.submodelRegistries)
293281
&& Objects.equals(this.registrySynchronization, other.registrySynchronization)
294282
&& Objects.equals(this.minInflateRatio, other.minInflateRatio)
295-
&& Objects.equals(this.operationTimeout, other.operationTimeout)
296-
&& Objects.equals(callbackAddress, other.callbackAddress);
283+
&& Objects.equals(this.operationTimeout, other.operationTimeout);
297284
}
298285

299286
public static class Builder extends ExtendableBuilder<CoreConfig, Builder> {
@@ -412,12 +399,6 @@ public Builder operationTimeout(long value) {
412399
}
413400

414401

415-
public Builder callbackAddress(String value) {
416-
getBuildingInstance().setCallbackAddress(value);
417-
return getSelf();
418-
}
419-
420-
421402
@Override
422403
protected Builder getSelf() {
423404
return this;

core/src/main/java/de/fraunhofer/iosb/ilt/faaast/service/util/EncodingHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ public static String base64Encode(String value) {
8080
* @return encoded value
8181
*/
8282
public static byte[] base64Encode(byte[] value) {
83-
return Base64.getEncoder().encode(value);
83+
return Objects.nonNull(value)
84+
? Base64.getEncoder().encode(value)
85+
: new byte[0];
8486
}
8587

8688

docs/source/basics/configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ The `core` configuration block contains properties not related to the implementa
4444
| assetConnectionReadTimeout<br>*(optional)* | Long | Timeout in ms for reading all asset connections for a single AAS command | 5000 |
4545
| assetConnectionRetryInterval<br>*(optional)* | Long | Interval in ms in which to retry establishing asset connections | 1000 |
4646
| assetConnectionWriteMaxThreadPoolSize<br>*(optional)* | Integer | Size of thread pool used to write to asset connections | 1000 |
47-
| callbackAddress<br>*(optional)* | String | The external URI the FA³ST Service is reachable from. Used in registry synchronization and cloud events message bus. | |
4847
| minInflateRatio<br>*(optional)* | Double | Ratio between de- and inflated bytes to detect zipbomb when loading AASX files | 0.001 |
4948
| operationTimeout<br>*(optional)* | Long | Timeout in ms for executing AAS operations. Set to 0 for no timeout. | 3600000 |
5049
| requestHandlerThreadPoolSize<br>*(optional)* | Integer | Number of concurrent thread that can execute API requests | 2 |

0 commit comments

Comments
 (0)