Skip to content

Commit d483f7d

Browse files
committed
DOCS REFORMATTED, ADDED User Profile
1 parent 7fae25a commit d483f7d

File tree

11 files changed

+200
-280
lines changed

11 files changed

+200
-280
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Features include but not limited to:
1616

1717
- [Authentication](documents/AUTHENTICATION.MD)
1818
- [User Roles](documents/USER_ROLES.MD)
19+
- [API](documents/API.md)
1920
- [Internationalization (i18n)](documents/INTERNATIONALIZATION.MD)
2021

2122
<div align="center">
@@ -77,10 +78,8 @@ Features include but not limited to:
7778
- [Architecture](documents/ARCHITECTURE.md)
7879
- [Installation](documents/INSTALLATION.MD)
7980
- [Deployment](documents/DEPLOYMENT.md)
80-
- [Explore Rest APIs](documents/APP_SECURITY_AND_API.md)
81-
- [Security](documents/APP_SECURITY_AND_API.md)
81+
- [Security](documents/API.md)
8282
- [Testing API](documents/TESTING.MD)
83-
- [Files and Directories Structure](documents/ARCHITECTURE.md)
8483
- [Changelog](documents/CHANGELOG.md)
8584
- [Code Coverage](documents/CODE_COVERAGE.MD)
8685
- [Documentation](documents/DOCUMENTATION.MD)

documents/API.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## API
2+
3+
### API Rate Limiting
4+
5+
| Tier | API Request Cap | API Key Prefix |
6+
|------------|-----------------|------------------|
7+
|FREE | 25 | `null` |
8+
|BASIC | 50 | `PX001-` |
9+
|PROFESSIONAL| 75 | `BX001-` |
10+
11+
Rate Limiting header `X-api-key`
12+
13+
[Bucket4j](https://github.com/vladimir-bukhtoyarov/bucket4j) - Rate limiting library based on token/leaky-bucket algorithm - Refer `io.github.anantharajuc.sbat.core_backend.api.rate_limiting` package
14+
15+
### Preventing Brute Force Authentication Attempts
16+
17+
A basic solution for preventing brute force authentication attempts using Spring Security is implemented. The app keeps a record of the number of failed attempts originating from a single IP address. If that particular IP goes over a set number of requests – it will be blocked for a set amount of time.
18+
19+
Refer `io.github.anantharajuc.sbat.core_backend.security.user.authentication.LoginAttemptService`
20+
21+
### Session Timeout
22+
23+
If the application remains inactive for a specified period of time, the session will expire. The session after this period of time is considered invalid and the user has to login to the application again.
24+
25+
This value **server.servlet.session.timeout** can be configured in **application.properties** file
26+
27+
28+
## Explore Rest APIs
29+
30+
The app defines following CRUD APIs. **If localhost doesn't work, use 192.168.99.102**
31+
32+
To enable SSL, toggle **server.ssl.enabled** to **true** and use the **https://** protocol in the URL instead of **http://**
33+
34+
Since the SSL certificate is self signed, turn off the **SSL certificate verification** option while interacting with the URLs via **Postman**
35+
36+
<img src="images\tools\postman-ssl-certificate-verification.PNG"/>
37+
38+
### URLs
39+
40+
| URL | Method | Remarks |
41+
|----------------------------------------|--------|------------------------|
42+
|`http://localhost:8080/index` | GET | Home Page |
43+
|`http://localhost:8080/sbat/index` | GET | Home Page |
44+
|`http://localhost:8080/sbat/about` | GET | About Page |
45+
|`http://localhost:8080/sbat/tech-stack` | GET | Technology Stack Table |
46+
|`http://localhost:8080/sbat/close` | GET | Close App via Actuator |
47+
|`http://localhost:8080/sbat/login` | GET | Login Page |
48+
|`http://localhost:8080/sbat/error` | GET | Custom Error Page |
49+
50+
### Other URLs
51+
52+
| URL | Method |
53+
|----------------------------------------------------------------|--------|
54+
|`http://localhost:8080/api/generic-hello` | GET |
55+
|`http://localhost:8080/api/personalized-hello/` | GET |
56+
|`http://localhost:8080/api/personalized-hello?name=spring-boot` | GET |
57+
|`http://localhost:8080/api/loggers` | GET |
58+
59+
### Actuator
60+
61+
To monitor and manage your application
62+
63+
| URL |Method|
64+
|-------------------------------------------|------|
65+
|`http://localhost:8080/actuator/` | GET |
66+
|`http://localhost:8080/actuator/health` | GET |
67+
|`http://localhost:8080/actuator/info` | GET |
68+
|`http://localhost:8080/actuator/prometheus`| GET |
69+
|`http://localhost:8080/actuator/httptrace` | GET |

documents/APP_SECURITY_AND_API.md

Lines changed: 0 additions & 252 deletions
This file was deleted.

src/main/java/io/github/anantharajuc/sbat/core_backend/security/user/model/Permission.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import lombok.Getter;
1414
import lombok.NoArgsConstructor;
1515
import lombok.Setter;
16+
import lombok.ToString;
1617
import lombok.experimental.FieldDefaults;
1718

1819
/**
@@ -29,6 +30,7 @@
2930
@AllArgsConstructor
3031
@NoArgsConstructor
3132
@FieldDefaults(level=AccessLevel.PRIVATE)
33+
@ToString
3234
public class Permission extends AuditEntity
3335
{
3436
private static final long serialVersionUID = 1L;

src/main/java/io/github/anantharajuc/sbat/core_backend/security/user/model/Role.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import lombok.Getter;
2121
import lombok.NoArgsConstructor;
2222
import lombok.Setter;
23+
import lombok.ToString;
2324
import lombok.experimental.FieldDefaults;
2425

2526
/**
@@ -36,6 +37,7 @@
3637
@AllArgsConstructor
3738
@NoArgsConstructor
3839
@FieldDefaults(level=AccessLevel.PRIVATE)
40+
@ToString
3941
public class Role extends AuditEntity
4042
{
4143
private static final long serialVersionUID = 1L;

src/main/java/io/github/anantharajuc/sbat/core_backend/security/user/model/User.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import lombok.Getter;
2525
import lombok.NoArgsConstructor;
2626
import lombok.Setter;
27+
import lombok.ToString;
2728
import lombok.experimental.FieldDefaults;
2829

2930
/**
@@ -40,6 +41,7 @@
4041
@AllArgsConstructor
4142
@NoArgsConstructor
4243
@FieldDefaults(level=AccessLevel.PRIVATE)
44+
@ToString
4345
public class User extends AuditEntity
4446
{
4547
private static final long serialVersionUID = 1L;

0 commit comments

Comments
 (0)