|
| 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 | |
0 commit comments