diff --git a/.env.example b/.env.example index 178209c..ea5a97e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,9 @@ -# All variables must be defined in your local system +############################################ +# Task Scheduler - Task Scheduler module +# Required Environment Variables +# +# Note: use double quotes only if the value contains spaces or starts with '#'. +############################################ -# Used locally and in Docker environments -TS_JWT_SECRET="your-secret-key" \ No newline at end of file +# Secret key used to sign and verify JWT tokens +TS_JWT_SECRET=your-secret-key \ No newline at end of file diff --git a/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java b/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java index 127dd6b..637e58b 100644 --- a/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java +++ b/src/main/java/com/javanauta/ts/taskscheduler/infrastructure/client/UserClient.java @@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(name = "user", url = "${ts.user.service.url}") +@FeignClient(name = "user", url = "${ts.user.service.uri}") public interface UserClient { - @GetMapping("/user") + @GetMapping UserDTO getUserByEmail(@RequestParam("email") String email, @RequestHeader("Authorization") String token); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 80b5d07..7e5b2e5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,9 +5,10 @@ server.port=8081 spring.data.mongodb.database=ts_task_scheduler -# Env variables set by bff's docker-compose and used in Docker environment only. Default (localhost) used otherwise +# If environment variables are not defined, localhost defaults will be used (currently, these env vars are only set by +# the System repo's docker compose to run the application in Docker) spring.data.mongodb.uri=${SPRING_DATA_MONGODB_URI:mongodb://localhost:27017/ts_task_scheduler} -ts.user.service.url=${TS_USER_SERVICE_URL:localhost:8080} +ts.user.service.uri=${TS_USER_SERVICE_URI:http://localhost:8080/user} -# Must be set locally - used locally and in docker environment (injected in bff's docker-compose) +# Secret key used to sign and verify JWT tokens (injected via environment variables) ts.jwt.secret=${TS_JWT_SECRET}