This service is written in Java with Spring Boot. It provides simple API to retrieve user data.
GET /users- list all usersGET /users/{username}- get a user by name
The service scans environment for variables:
JWT_SECRET- secret value for JWT token processing. Must be the same amongst all components.SERVER_PORT- the port the service takes.OTEL_TRACES_SAMPLER_ARG- trace sampling probability; defaults to1.0.ZIPKIN_URL- Zipkin v2 spans endpoint.USERS_API_FEATURE_VERBOSE_SECURITY_ERRORS- exposes JWT validation details whentrue; defaults tofalse.
Public operational endpoints are /health/startup, /health/readiness,
/health/liveness, /health, and /prometheus. Health responses never expose
component details. API responses return the accepted or generated
X-Request-Id correlation identifier.
./mvnw clean install
JWT_SECRET=PRFT SERVER_PORT=8083 java -jar target/users-api-0.0.1-SNAPSHOT.jar
In case you need to test this API, you can use it as follows:
curl -X GET -H "Authorization: Bearer $token" http://127.0.0.1:8083/users/:username
where $token is the response you get from Auth API.
Here you can find the software required to run this microservice, as well as the version we have tested.
| Dependency | Version |
|---|---|
| Java | OpenJDK 21 |