You can continue to your last lab assignment to add security with JWT to your project.
- There are two roles
adminanduser.admincan access all endpoints.usercan access only/productsendpoint.
- Use
UserDetailsServiceto load the user from the database. - Create
UaaControllerto implementsigninandsignupendpoints. - Make necessary changes to set
user_idinproductwith the current request holder's user id whensaveProductsis invoked.- You can access the current request holder via
SecurityContextHolder.
- You can access the current request holder via
- Generated token should be valid for 15 minutes.
- Use
AOPto filter out any offensive words.- You can use any kind of offensive words dictionary or you can even create one for testing.
- Assuming
springis an offensive word and if the input is :springing, it should be filtered out as******ing.- Create
WaaOffensiveWordsaspect.
- Create
- If the same user sends more than 5 different requests that contain offensive words in last 30 minutes, do not accept the requests of this user for next 15 minutes and return the error message
Max Bad Words Requests Limit has been Reached. You need wait for X minutes.ChangeXwith remaining time of the ban.- This implementation should be
stateless. You cannot hold any data in the server's memory. You can design table/tables to implement this feature. - To practice further (optional), you can use
redisinstead of usingPostgreSQL. - Create
WaaRequestFilteraspect.
- This implementation should be
- Continue to your UI project and implement
signinandsignupfunctionality. - Make necessary changes in your UI project to communicate with backend server.
- Send the token in each request except for
signinandsignupfunctions. - You can store the token in the
localStorage.
- Send the token in each request except for
- Use n-tier software architecture model.
- Use DTOs.
- PostgreSQL is recommended as a Relational Database system.
- Populate your database with dummy data using
data.sql.
- Fork this repository and push your changes.
- Once you finished your project, send a Pull Request. (Send only one Pull Request once you finish the assignment.)
- You are not allowed to share codes with your classmates. If detected, you will get NC.
- For pairs:
- Individual's work will be checked from the commits.
- Share tasks evenly and fairly.
- To have a clearer understanding of pair programming:
-
Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator reviews each line of code as it is typed in. The two programmers switch roles frequently.
- Wikipedia
-
-
Remember to respect the code honor submission policy. All written code must be original. Presenting something as one’s own work when it came from another source is plagiarism and is forbidden.
-
Plagiarism is a very serious thing in all American academic institutions and is guarded against vigilantly by every professor.