Skip to content

About

MicroTodoSuite users API: user accounts, in Java with Spring Boot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Users API

This service is written in Java with Spring Boot. It provides simple API to retrieve user data.

  • GET /users - list all users
  • GET /users/{username} - get a user by name

Configuration

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 to 1.0.
  • OTEL_EXPORTER_OTLP_ENDPOINT - OTLP/gRPC trace collector, for example http://jaeger-collector.observability.svc:4317; when unset, traces are not exported.
  • USERS_API_FEATURE_VERBOSE_SECURITY_ERRORS - exposes JWT validation details when true; defaults to false.

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.

Building

./mvnw clean install

Running

JWT_SECRET=PRFT SERVER_PORT=8083 java -jar target/users-api-0.0.1-SNAPSHOT.jar

Usage

The API can be exercised as follows:

 curl -X GET -H "Authorization: Bearer $token" http://127.0.0.1:8083/users/:username

where $token is the token returned by Auth API.

Dependencies

The software required to run this microservice, and the version that was tested:

Dependency Version
Java OpenJDK 21

About

MicroTodoSuite users API: user accounts, in Java with Spring Boot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages