Skip to content

Commit 87e4aca

Browse files
committed
doc inline fixes
1 parent eefa4e8 commit 87e4aca

12 files changed

+155
-147
lines changed

docs/index.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
[![PyPI version](https://img.shields.io/pypi/v/ellar.svg)](https://pypi.python.org/pypi/ellar)
1212
[![PyPI version](https://img.shields.io/pypi/pyversions/ellar.svg)](https://pypi.python.org/pypi/ellar)
1313

14-
## Overview
14+
## **Overview**
1515

1616
Ellar is a modern, fast, and lightweight ASGI framework for building scalable web applications and APIs with Python. Built on top of Starlette and inspired by the best practices of frameworks like NestJS, Ellar combines the power of async Python with elegant architecture patterns.
1717

18-
## ✨ Key Features
18+
## **✨ Key Features**
1919

2020
- 🚀 **High Performance**: Built on ASGI standards for maximum performance and scalability
2121
- 💉 **Dependency Injection**: Built-in DI system for clean and maintainable code architecture
@@ -27,9 +27,9 @@ Ellar is a modern, fast, and lightweight ASGI framework for building scalable we
2727
- 🔌 **WebSocket Support**: Real-time bidirectional communication capabilities
2828
- 🧪 **Testing Utilities**: Comprehensive testing tools for unit and integration tests
2929

30-
## 🚀 Getting Started
30+
## **🚀 Getting Started**
3131

32-
### Installation
32+
### **Installation**
3333

3434
```bash
3535
# Create and activate virtual environment (recommended)
@@ -40,7 +40,7 @@ source venv/bin/activate # On Windows use: venv\Scripts\activate
4040
pip install ellar
4141
```
4242

43-
### Basic Example
43+
### **Basic Example**
4444

4545
```python
4646
from ellar.common import get, Controller, ControllerBase
@@ -59,7 +59,7 @@ if __name__ == "__main__":
5959
uvicorn.run("main:app", port=5000, reload=True)
6060
```
6161

62-
## 📚 Complete Example
62+
## **📚 Complete Example**
6363

6464
```python
6565
from ellar.common import Body, Controller, ControllerBase, delete, get, post, put, Serializer
@@ -101,7 +101,7 @@ app = AppFactory.create_app(
101101
)
102102
```
103103

104-
## 🔧 Requirements
104+
## **🔧 Requirements**
105105

106106
### Core Dependencies
107107
- Python >= 3.8
@@ -115,15 +115,15 @@ app = AppFactory.create_app(
115115
- python-multipart - For form data parsing
116116
- itsdangerous - For security features
117117

118-
## 📖 Documentation Structure
118+
## **📖 Documentation Structure**
119119

120120
- [Quick Start Guide](quick-project.md)
121-
- [Basic Concepts](basics/index.md)
121+
- [Basic Concepts](overview/step-one.md)
122122
- [Security & Authentication](security/authentication/index.md)
123123
- [OpenAPI Integration](openapi/index.md)
124124
- [API Reference](references/index.md)
125125

126-
## 🤝 Contributing
126+
## **🤝 Contributing**
127127

128128
We welcome contributions! Here's how you can help:
129129

@@ -135,10 +135,10 @@ We welcome contributions! Here's how you can help:
135135

136136
See [CONTRIBUTING.md](https://github.com/python-ellar/ellar/blob/main/docs/contribution.md) for detailed guidelines.
137137

138-
## 📝 License
138+
## **📝 License**
139139

140140
Ellar is [MIT Licensed](https://github.com/python-ellar/ellar/blob/main/LICENSE).
141141

142-
## 👤 Author
142+
## **👤 Author**
143143

144144
Ezeudoh Tochukwu [@eadwinCode](https://github.com/eadwinCode)

docs/security/authentication/api-key-authentication.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# API Key Authentication in Ellar
1+
# **API Key Authentication in Ellar**
22

33
This guide demonstrates how to implement API Key authentication in Ellar using both header-based and query parameter-based approaches.
44

5-
## Overview
5+
## **Overview**
66

77
API Key authentication is a simple yet effective way to secure your APIs. Ellar provides built-in support for three types of API Key authentication:
88

99
1. Header-based API Key
1010
2. Query Parameter-based API Key
1111
3. Cookie-based API Key
1212

13-
## Implementation Methods
13+
## **Implementation Methods**
1414

15-
### 1. Using Authentication Handler
15+
### 1. **Using Authentication Handler**
1616

1717
```python
1818
# auth/api_key_scheme.py
@@ -69,7 +69,7 @@ application = AppFactory.create_from_app_module(
6969
use_authentication_schemes([HeaderAPIKeyAuth, QueryAPIKeyAuth])
7070
```
7171

72-
### 2. Using Guard Strategy
72+
### 2. **Using Guard Strategy**
7373

7474
```python
7575
# auth/guards.py
@@ -111,7 +111,7 @@ class QueryAPIKeyGuard(GuardAPIKeyQuery):
111111
self.raise_exception()
112112
```
113113

114-
## Controller Implementation
114+
## **Controller Implementation**
115115

116116
```python
117117
from ellar.common import Controller, get
@@ -126,7 +126,7 @@ class APIController:
126126
return {"message": "Protected data"}
127127
```
128128

129-
## Testing the Implementation
129+
## **Testing the Implementation**
130130

131131
```bash
132132
# Using Header-based API Key
@@ -137,26 +137,26 @@ curl http://localhost:8000/api/data \
137137
curl "http://localhost:8000/api/data?api_key=your-secret-api-key"
138138
```
139139

140-
## Security Best Practices
140+
## **Security Best Practices**
141141

142142
1. **API Key Storage**:
143-
- Never hardcode API keys in source code
144-
- Use environment variables or secure key management systems
145-
- Rotate API keys periodically
143+
- Never hardcode API keys in source code
144+
- Use environment variables or secure key management systems
145+
- Rotate API keys periodically
146146

147147
2. **Transport Security**:
148-
- Always use HTTPS in production
149-
- Consider implementing rate limiting
150-
- Log and monitor API key usage
148+
- Always use HTTPS in production
149+
- Consider implementing rate limiting
150+
- Log and monitor API key usage
151151

152152
3. **Key Management**:
153-
- Implement API key rotation
154-
- Maintain an audit trail of API key usage
155-
- Implement key revocation mechanisms
153+
- Implement API key rotation
154+
- Maintain an audit trail of API key usage
155+
- Implement key revocation mechanisms
156156

157-
## Advanced Implementation
157+
## **Advanced Implementation**
158158

159-
### API Key with Scopes
159+
### **API Key with Scopes**
160160

161161
```python
162162
from typing import List
@@ -186,7 +186,7 @@ class ScopedAPIKeyAuth(HeaderAPIKeyAuthenticationHandler):
186186
return None
187187
```
188188

189-
## Manual OpenAPI Integration
189+
## **Manual OpenAPI Integration**
190190

191191
Ellar automatically generates OpenAPI documentation when you use and class in `ellar.auth.handlers` and `ellar.auth.guards`. But if you want to manually add it, you can do so by using the `OpenAPIDocumentBuilder` class.
192192

@@ -210,7 +210,7 @@ document_builder.add_security_scheme(
210210
)
211211
```
212212

213-
## Custom Error Handling
213+
## **Custom Error Handling**
214214

215215
```python
216216
from ellar.common import IExecutionContext
@@ -228,8 +228,8 @@ def invalid_api_key_exception_handler(ctx: IExecutionContext, exc: Exception) ->
228228
}
229229
)
230230
```
231-
See [Custom Error Handling](../overview/exception_handling.md) for more information.
231+
See [Custom Error Handling](../../overview/exception_handling.md) for more information.
232232

233-
## Complete Examples
233+
## **Complete Examples**
234234

235235
For a complete working example of API Key authentication, visit the [Ellar examples repository](https://github.com/python-ellar/ellar/tree/main/examples).

docs/security/authentication/auth-handler-strategy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ happens just before route function is executed.
77
Ellar provides `BaseAuthenticationHandler` contract which defines what is required to set up any authentication strategy.
88
We are going to make some modifications on the existing project to see how we can achieve the same result and to show how authentication handlers in ellar.
99

10-
### Creating a JWT Authentication Handler
10+
### **Creating a JWT Authentication Handler**
1111
Just like AuthGuard, we need to create its equivalent. But first we need to create a `auth_scheme.py` at the root level
1212
of your application for us to define a `JWTAuthentication` handler.
1313

docs/security/authentication/index.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# Authentication in Ellar
1+
# **Authentication in Ellar**
22

33
Authentication is an essential part of most applications. It verifies the identity of users interacting with your application. Ellar provides flexible and powerful authentication mechanisms to suit different application needs.
44

5-
## Overview
5+
## **Overview**
66

77
Ellar offers two main approaches to authentication:
88

99
1. **Guard Strategy** - Authentication performed at the route handler level
1010
2. **Authentication Handler Strategy** - Authentication performed at the middleware layer
1111

12-
### When to Use Each Strategy
12+
### **When to Use Each Strategy**
1313

14-
- **Guard Strategy**:
15-
- When you need fine-grained control over authentication at the route level
16-
- When authentication logic varies between different routes
17-
- When you want to combine multiple authentication methods
14+
1. #### **Guard Strategy**:
15+
- When you need fine-grained control over authentication at the route level
16+
- When authentication logic varies between different routes
17+
- When you want to combine multiple authentication methods
1818

19-
- **Authentication Handler Strategy**:
20-
- When you want consistent authentication across your application
21-
- When authentication should happen early in the request pipeline
22-
- When you need to integrate with existing authentication middleware
19+
2. #### **Authentication Handler Strategy**:
20+
- When you want consistent authentication across your application
21+
- When authentication should happen early in the request pipeline
22+
- When you need to integrate with existing authentication middleware
2323

24-
## Available Authentication Methods
24+
## **Available Authentication Methods**
2525

2626
Ellar supports various authentication methods out of the box:
2727

@@ -31,7 +31,7 @@ Ellar supports various authentication methods out of the box:
3131
- API Key Authentication (Header, Query, Cookie)
3232
- Custom Authentication Schemes
3333

34-
## Getting Started
34+
## **Getting Started**
3535

3636
Choose the authentication strategy that best fits your needs:
3737

@@ -40,29 +40,29 @@ Choose the authentication strategy that best fits your needs:
4040
- [JWT Authentication Example](./jwt-authentication.md) - Complete example of JWT authentication
4141
- [API Key Authentication](./api-key-authentication.md) - Implement API key-based authentication
4242

43-
## Best Practices
43+
## **Best Practices**
4444

4545
1. **Security First**:
46-
- Never store passwords in plain text
47-
- Use secure token generation and validation
48-
- Implement proper error handling
46+
- Never store passwords in plain text
47+
- Use secure token generation and validation
48+
- Implement proper error handling
4949

5050
2. **Performance**:
51-
- Choose the appropriate authentication layer
52-
- Implement caching where appropriate
53-
- Consider token expiration strategies
51+
- Choose the appropriate authentication layer
52+
- Implement caching where appropriate
53+
- Consider token expiration strategies
5454

5555
3. **User Experience**:
56-
- Implement proper token refresh mechanisms
57-
- Provide clear error messages
58-
- Consider rate limiting
56+
- Implement proper token refresh mechanisms
57+
- Provide clear error messages
58+
- Consider rate limiting
5959

6060
4. **Code Organization**:
61-
- Separate authentication logic from business logic
62-
- Use dependency injection for services
63-
- Follow Ellar's module structure
61+
- Separate authentication logic from business logic
62+
- Use dependency injection for services
63+
- Follow Ellar's module structure
6464

65-
## Next Steps
65+
## **Next Steps**
6666

6767
Start with the authentication strategy that best matches your requirements:
6868

0 commit comments

Comments
 (0)