Skip to content

Commit

Permalink
Update documentation (#1027)
Browse files Browse the repository at this point in the history
* Updated README.md

Signed-off-by: dhoard <[email protected]>
  • Loading branch information
dhoard authored Oct 31, 2024
1 parent 0d140ee commit 106770d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 14 deletions.
26 changes: 17 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,24 +251,32 @@ httpServer:

---

### Java agent use of a custom com.sun.net.httpserver.Authenticator class
It is possible to provide a custom Authenticator implementation for the Java agent.
## Pluggable Authenticator (Optional)

It is possible to use a custom Authenticator (`com.sun.net.httpserver.Authenticator`) implementation for the Java agent.

The custom class needs to be on the jvm classpath.
The class name to load is provided through `authentication/customAuthenticator` configuration as follows:

The class name to load is provided through `authentication/plugin` configuration as follows:

```yaml
httpServer:
authentication:
customAuthenticator:
authenticatorClass: my.custom.AuthenticatorWithNoArgConstructor
plugin:
class: my.custom.AuthenticatorWithNoArgConstructor
```
If the custom authenticatorClass needs to provide an authenticated Subject visible to the application, it can set a named attribute on the HttpExchange with that subject. The agent will arrange that subsequent calls occur in a Subject.doAs().

If the custom authenticatorClass needs to provide an authenticated Subject visible to the application, it can set a named attribute on the HttpExchange with that subject.

The agent will arrange that subsequent calls occur in a Subject.doAs().

The name of the attributed must be provided through `subjectAttributeName` configuration as follows:

```yaml
httpServer:
authentication:
customAuthenticator:
authenticatorClass: my.custom.AuthenticatorWithNoArgConstructorThatSetsASubjectAttribute
plugin:
class: my.custom.AuthenticatorWithNoArgConstructorThatSetsASubjectAttribute
subjectAttributeName: "custom.subject.for.doAs");
```

Expand Down Expand Up @@ -354,7 +362,7 @@ httpServer:

## Integration Test Suite

The JMX exporter uses the [AntuBLUE Test Engine](https://github.com/antublue/test-engine) and [Testcontainers](https://www.testcontainers.org/) to run integration tests with different Java versions.
The JMX exporter uses [Verifyica](https://github.com/verifyica-team/verifyica) and [Testcontainers](https://www.testcontainers.org/) to run integration tests with different Java versions.

You need to have Docker installed to run the integration test suite.

Expand Down
36 changes: 31 additions & 5 deletions integration_test_suite/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Integration Test Suite
---
---

### Smoke test Docker images tested

[Smoke test Docker images](https://github.com/prometheus/jmx_exporter/blob/main/integration_test_suite/integration_tests/src/test/resources/docker-image-names.smoke-test.txt)
[Smoke test Docker images](https://github.com/prometheus/jmx_exporter/blob/main/integration_test_suite/integration_tests/src/test/resources/smoke-test-java-docker-images.txt)

### Docker images tested (all)

[All Docker images](https://github.com/prometheus/jmx_exporter/blob/main/integration_test_suite/integration_tests/src/test/resources/docker-image-names.all.txt)
[All Docker images](https://github.com/prometheus/jmx_exporter/blob/main/integration_test_suite/integration_tests/src/test/resources/java-docker-images.txt)

### Running the integration test suite (smoke test Docker images)

Expand Down Expand Up @@ -44,15 +43,42 @@ Pulling Docker images (not required, but you may see request timeouts/pull failu
Smoke test Docker images

```shell
./integration_test_suite/docker-pull-images.smoke-test.sh
./integration_test_suite/pull-smoke-test-docker-images.sh
```

All Docker images

```shell
./integration_test_suite/docker-pull-images.all.sh
./integration_test_suite/pull-docker-images.sh
```

## Notes

- You may need to set up Docker hub login to pull images

---

### Docker Configuration changes

When running the integration test suite, Docker may need to be configured to support network addresses.

On Linux:

```shell
/etc/docker/daemon.json
```

```yaml
{
"default-address-pools" : [
{
"base" : "172.16.0.0/16",
"size" : 24
},
{
"base" : "192.168.0.0/16",
"size" : 24
}
]
}
```

0 comments on commit 106770d

Please sign in to comment.