Skip to content

Commit 724fa91

Browse files
committed
Add security related changes to README.md.
1 parent eb372c5 commit 724fa91

File tree

2 files changed

+52
-64
lines changed

2 files changed

+52
-64
lines changed

README.md

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# Springy Store μServices
22

3-
- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects, that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns and coding best practices.
4-
- The project follows [**CloudNative**](https://www.cncf.io/) recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be built and deployed.
3+
- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns, and coding best practices.
4+
- The project follows [**CloudNative**](https://www.cncf.io/) recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be developed and deployed.
55
- This project uses cutting edge technologies like Docker, Kubernetes, Elasticsearch Stack for
66
logging and monitoring, Java SE 14, MySQL, and MongoDB databases, all components developed with TDD in mind, covering integration & performance testing, and many more.
77

88
------
9-
I am developing this project as stages, and all such stages are documented under project
10-
**Springy Store μServices** [wiki page](https://github.com/mohamed-taman/Springy-Store-Microservices/wiki). Each of such stage will be a release in its own, so you can go back and
11-
forward between releases to see the differences and how adding things solve specific problems we face.
9+
I am developing this project as stages, and all such steps are documented under the project **Springy Store μServices** [wiki page](https://github.com/mohamed-taman/Springy-Store-Microservices/wiki). Each such stage will be a release in its own, so you can go back and forward between versions to see the differences and how adding things solve specific problems we face.
1210

13-
<u>For example;</u> in the first stage (1st release) I just created project structure, basic services' skeleton, integration between them, and finally write integration testing as well as semi-automated testing for the whole services' functionality.
11+
<u>For example, </u> in the first stage (1st release), I just created project structure, essential services' skeleton, integration between them, and finally write integration testing as well as semi-automated testing for the complete services' functionality.
1412

15-
At the 1st stage the **Recommendation** and **Review** microservices generate local in-memory data and **Store Service** calls the other three services (*Product*, *Recommendation*, and *Review*) statically to generate client aggregate response for a specific product. Therefore, in:
13+
At the 1st stage, the **Recommendation** and **Review** microservices generate local in-memory data, and **Store Service** calls the other three services (*Product*, *Recommendation*, and *Review*) statically to generate client aggregate response for a specific product. Therefore, in:
1614

1715
- The second stage I will introduce **database integration**, then in (***done***)
18-
- The third stage I will introduce **Dockerization** of our services and **docker-compose**, and in (***done***)
19-
- The fourth stage I will introduce **service discovery**, and so on.
16+
- The third stage I will add **Dockerization** of our services and **docker-compose**, and in (***done***)
17+
- In the fourth stage, I will introduce **service discovery**, and so on.
2018

2119
## System components Structure
2220
Let's explain first the system structure to understand its components:
@@ -48,17 +46,15 @@ Springy Store μService --> Parent folder.
4846
|- stop-em-all.sh --> Stop all services runs in standalone mode.
4947
|- test-em-all.sh --> This will start all docker compose landscape and test them, then shutdown docker compose containers with test finishes (use switch start stop)
5048
```
51-
Now as we have learned about different system components, then let's start.
49+
Now, as we have learned about different system components, then let's start.
5250

5351
## Getting started
5452

55-
The first stage aka (**Release v1.0**) is about creating and implementing a set of project Microservices.
53+
The first stage, aka (**Release v1.0**), is about creating and implementing a set of project Microservices.
5654

5755
### Creating a Set of Cooperating Microservices (Release v1.0)
5856

59-
The following topics are going to be covered in this 1st stage (other stages topics to be documented
60-
in a
61-
project wiki):
57+
The following topics are going to be covered in this 1st stage (other stages topics will be documented in the project wiki pages):
6258

6359
- Introducing the microservice landscape.
6460
- Generating skeleton microservices.
@@ -85,33 +81,33 @@ The following are the initially required software pieces:
8581

8682
4. **jq**: This command-line JSON processor can be downloaded and installed from https://stedolan.github.io/jq/download/.
8783

88-
5. Spring Boot Initializer: This *Initializer* generates *spring* boot project with just what you need to start quickly! start from here https://start.spring.io/.
84+
5. Spring Boot Initializer: This *Initializer* generates *spring* boot project with just what you need to start quickly! Start from here https://start.spring.io/.
8985

9086
6. **Docker Desktop**: The fastest way to containerize applications on your desktop, and you can download it from here [https://www.docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop)
9187

9288
> For each future stage, I will list the newly required software.
9389
94-
Follow the installation guide for each software website and check your software versions from the command line to verify that they are installed correctly.
90+
Follow the installation guide for each software website link and check your software versions from the command line to verify that they are all installed correctly.
9591

9692
## Using an IDE
9793

98-
I recommend that you work with your Java code using an IDE that supports the development of Spring Boot applications such as Spring Tool Suite or IntelliJ IDEA Ultimate Edition. So you can use the Spring Boot Dashboard to run the services, run each microservice test case and many more.
94+
I recommend that you work with your Java code using an IDE that supports the development of Spring Boot applications such as Spring Tool Suite or IntelliJ IDEA Ultimate Edition. So you can use the Spring Boot Dashboard to run the services, run each microservice test case, and many more.
9995

100-
All that you want to do is just fire up your IDE **->** open or import the parent folder `springy-store-microservices` and everything will be ready for you.
96+
All that you want to do is just fire up your IDE **->** open or import the parent folder `springy-store-microservices,` and everything will be ready for you.
10197

10298
## Playing With Springy Store Project
10399

104100
### Cloning It
105101

106-
First open **git bash** command line, then simply you can clone the project under any of your favorite places as the following:
102+
The first thing to do is to open **git bash** command line, and then simply you can clone the project under any of your favorite places as the following:
107103

108104
```bash
109105
> git clone https://github.com/mohamed-taman/Springy-Store-Microservices.git
110106
```
111107

112108
### Build & Test Them In Isolation
113109

114-
To build and run test cases for each service & shared modules in the project we need to do the following:
110+
To build and run the test cases for each service & shared modules in the project, we need to do the following:
115111

116112
#### First: Build & Install Shared Dependencies
117113

@@ -191,7 +187,7 @@ All build commands and test suite for each microservice should run successfully,
191187

192188
### Running Them All
193189
#### Using RabbitMQ without the use of partitions
194-
Now it's the time to run all of our reactive Microservices, and it's very simple just run the following `docker-compose` commands:
190+
Now it's the time to run all of our reactive Microservices, and it's straightforward just run the following `docker-compose` commands:
195191

196192
```bash
197193
mohamed.taman@DTLNV8 ~/springy-store-microservices
@@ -213,14 +209,20 @@ Creating ssm_review_1 ... done
213209
Creating ssm_product_1 ... done
214210
Creating ssm_recommendation_1 ... done
215211
```
216-
217212
### Access Store APIs
218213
You can manually test `Store Service` APIs throughout its **Swagger** interface at the following
219-
URL [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html).
220-
#### Access RabbitMQ
214+
URL [https://localhost:8443/swagger-ui.html](https://localhost:8443/swagger-ui.html).
215+
### Access Service Discovery Server (Eureka)
216+
If you would like to access the Eureka service discovery point to this URL [http://localhosts:8443/eureka/web](https://localhost:8443/eureka/web) to see all the services registered inside it.
217+
218+
Note that it is accessed through API Gateway and is secured. Therefore the browser will ask you for `username:mt` and `password:p,` write them to the dialog, and you will access it. This type of security is a **basic form security**.
219+
220+
The **API Gateway** and **Store Service** both act as a *resource server*. To know more about calling Store API in a secure way you can check the `test-em-all.sh` script on how I have changed the calling of the services using **OAuth2** security.
221+
222+
### Access RabbitMQ
221223
In browser point to this URL [http://localhost:5672/](http://localhost:5672/) `username: guest` and `password: guest`, and you can see all **topics**, **DLQs**, **partitions**, and payload.
222224

223-
1. For running 2 instances of each service and using _RabbitMQ with two partitions per topic_, use the following `docker-compose` command:
225+
1. For running two instances of each service and using _RabbitMQ with two partitions per topic_, use the following `docker-compose` command:
224226
```bash
225227
mohamed.taman@DTLNV8 ~/springy-store-microservices
226228
λ docker-compose -p ssm -f docker-compose-partitions.yml up -d
@@ -231,44 +233,33 @@ In browser point to this URL [http://localhost:5672/](http://localhost:5672/) `u
231233
λ docker-compose -p ssm -f docker-compose-kafka.yml up -d
232234
```
233235
#### Check All Services Health
234-
From Store front Service we can check all the core services health, when you have all the
236+
From Storefront Service we can check all the core services health when you have all the
235237
microservices up and running using Docker Compose,
236238
```bash
237239
mohamed.taman@DTLNV8 ~/springy-store-microservices
238-
λ curl http://localhost:8080/actuator/health -s | jq .
240+
λ curl -k https://localhost:8443/actuator/health -s | jq .components."\"Core Microservices\""
239241
```
240242
This will result in the following response:
241243
```json
242244
{
243-
"status":"UP",
244-
"components":{
245-
"System Microservices":{
246-
"status":"UP",
247-
"components":{
248-
"Product Service":{
249-
"status":"UP"
250-
},
251-
"Recommendation Service":{
252-
"status":"UP"
253-
},
254-
"Review Service":{
255-
"status":"UP"
256-
}
257-
}
258-
},
259-
"diskSpace":{
260-
"status":"UP",
261-
"details":{
262-
"total":255382777856,
263-
"free":86618931200,
264-
"threshold":10485760,
265-
"exists":true
266-
}
267-
},
268-
"ping":{
269-
"status":"UP"
270-
}
271-
}
245+
"status": "UP",
246+
"components": {
247+
"Authorization Server": {
248+
"status": "UP"
249+
},
250+
"Product Service": {
251+
"status": "UP"
252+
},
253+
"Recommendation Service": {
254+
"status": "UP"
255+
},
256+
"Review Service": {
257+
"status": "UP"
258+
},
259+
"Store Service": {
260+
"status": "UP"
261+
}
262+
}
272263
}
273264
```
274265
### Testing Them All
@@ -283,7 +274,7 @@ mohamed.taman@DTLNV8 ~/springy-store-microservices
283274
The result will look like this:
284275
285276
```bash
286-
Starting 'Springy Store μServices' for [Blackbox] testing....
277+
Starting 'Springy Store μServices' for [Blackbox] testing...
287278
288279
Start Tests: Fri, May 8, 2020 12:26:28 PM
289280
HOST=localhost
@@ -317,17 +308,14 @@ Test OK (HTTP Code: 200)
317308
Test OK (HTTP Code: 403, )
318309
End, all tests OK: Fri, May 8, 2020 12:29:21 PM
319310
```
320-
321311
### Closing The Story
322312
323-
Finally, to close the story, we need to shut down Microservices manually service by service
324-
, hahaha just kidding, run the following command to shut them all:
313+
Finally, to close the story, we need to shut down Microservices manually service by service, hahaha just kidding, run the following command to shut them all:
325314
326315
```bash
327316
mohamed.taman@DTLNV8 ~/springy-store-microservices
328317
λ docker-compose -p ssm down --remove-orphans
329318
```
330-
331319
And you should see output like the following:
332320
333321
```bash
@@ -357,4 +345,4 @@ Removing network ssm_default
357345
Happy coding :)
358346
359347
# License
360-
Copyright (C) 2017-2020 Mohamed Taman, Licensed under the MIT License.
348+
Copyright (C) 2017-2020 Mohamed Taman, Licensed under the MIT License.

store-common/store-utils/src/main/java/com/siriusxi/ms/store/util/http/GlobalControllerExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* The class Global controller exception handler is a generic and central point for all
1818
* microservices that handles all services exceptions.
1919
*
20-
* It act as filter so it is pluggable component just added to microservice context automatically,
21-
* when you add <code>ComponentScan</code> on your application.
20+
* <p>It act as filter so it is pluggable component just added to microservice context
21+
* automatically, when you add <code>ComponentScan</code> on your application.
2222
*
2323
* @see org.springframework.context.annotation.ComponentScan
2424
* @author mohamed.taman

0 commit comments

Comments
 (0)