Skip to content

Commit

Permalink
Chore: created new role & updated readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ricklue committed Aug 16, 2024
1 parent 9f9a346 commit 8f4cb81
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,18 @@ What version number will be published by the Jenkins server? In the frontend `po
You can also test your frontend code as Maven artifact before merging your code with the master branch. To do this, you need Maven 3.9.6 or later running on Java 17 or Java 21. Run `mvn clean install` in your checkout of the frontend. This will build the frontend artifact with exactly the version number in `pom.xml` (e.g. `0.1.0-SNAPSHOT`, no timestamp in this case) and install it on your development device. You can temporarily update the backend `pom.xml` to reference that frontend version. If you then start ladybug as described before, your work is reachable at port 80 (not 4200). You can test your work as explained in the sections on backend development.

> [!WARNING]
> When you run the Maven build on your development device, it will update `package.json`. Please do not check in that change. Otherwise, the build will not work for other developers anymore.
> When you run the Maven build on your development device, it will update `package.json`. Please do not check in that change. Otherwise, the build will not work for other developers anymore.
Collecting OpenTelemetry data
=============================

In Ladybug, there is also an API available to gather telemetry data from OpenTelemetry. When code is instrumented with the OpenTelemetry library, it is possible to use the endpoint from this API to gather it in Ladybug. For a manual OpenTelemetry-instrumentation, you can configure the Zipkin exporter and make use of the endpoint to Ladybug. See code example below:

```
SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()
.addSpanProcessor(BatchSpanProcessor.builder(ZipkinSpanExporter.builder().setEndpoint("http://localhost/ladybug/api/collector/").build()).build())
.setResource(resource)
.build();
```

For more info about OpenTelemetry, see https://opentelemetry.io/
7 changes: 6 additions & 1 deletion src/main/java/nl/nn/testtool/web/ApiAuthorizationFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public ApiAuthorizationFilter() {
setObserverRoles(null);
setDataAdminRoles(null);
setTesterRoles(null);
setWebServiceRoles(null);
constructorDone = true;
}

Expand All @@ -91,7 +92,6 @@ public void setObserverRoles(List<String> observerRoles) {
addConfigurationPart("PUT/" + ApiServlet.LADYBUG_API_PATH + "/testtool/node-link-strategy$", observerRoles);
addConfigurationPart("GET/" + ApiServlet.LADYBUG_API_PATH + "/metadata/.*$", observerRoles);
addConfigurationPart("GET/" + ApiServlet.LADYBUG_API_PATH + "/report/.*$", observerRoles);
addConfigurationPart("POST/" + ApiServlet.LADYBUG_API_PATH + "/collector/.*$", observerRoles);
}

public void setDataAdminRoles(List<String> dataAdminRoles) {
Expand All @@ -116,6 +116,11 @@ public void setTesterRoles(List<String> testerRoles) {
addConfigurationPart("POST/" + ApiServlet.LADYBUG_API_PATH + "/runner/run/.*", testerRoles);
}

public void setWebServiceRoles(List<String> webServiceRoles) {
if (constructorDone) log.info("Set web service roles");
addConfigurationPart("POST/" + ApiServlet.LADYBUG_API_PATH + "/collector/.*$", webServiceRoles);
}

public void setLadybugApiRoles(Map<String, List<String>> ladybugApiRoles) {
log.info("Set Ladybug api roles");
for (String path : ladybugApiRoles.keySet()) {
Expand Down

0 comments on commit 8f4cb81

Please sign in to comment.