Skip to content

Commit 26cac60

Browse files
committed
docs: replace API_KEY_PEPPER envvar by SECRET_PEPPER (conflict with load_dotenv svc method who extract by pattern 'API_KEY_*')
1 parent 3a15c3f commit 26cac60

16 files changed

+17
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ from fastapi_api_key import ApiKeyService
126126
from fastapi_api_key.hasher.argon2 import Argon2ApiKeyHasher
127127
from fastapi_api_key.repositories.in_memory import InMemoryApiKeyRepository
128128

129-
pepper = os.environ["API_KEY_PEPPER"]
129+
pepper = os.environ["SECRET_PEPPER"]
130130
hasher = Argon2ApiKeyHasher(pepper=pepper)
131131

132132
repo = InMemoryApiKeyRepository()
@@ -186,7 +186,7 @@ from fastapi_api_key.api import create_api_keys_router, create_depends_api_key
186186
# Set env var to override default pepper
187187
# Using a strong, unique pepper is crucial for security
188188
# Default pepper is insecure and should not be used in production
189-
pepper = os.getenv("API_KEY_PEPPER")
189+
pepper = os.getenv("SECRET_PEPPER")
190190
hasher = Argon2ApiKeyHasher(pepper=pepper)
191191

192192
path = Path(__file__).parent / "db.sqlite3"

docs/usage/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ service = CachedApiKeyService(repo=repo, hasher=hasher, cache=redis_cache, cache
4949
This is the canonical example from `examples/example_cached.py`:
5050

5151
!!! warning "Always set a pepper"
52-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
52+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
5353

5454
```python
5555
--8<-- "examples/example_cached.py"

docs/usage/database.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip install fastapi-api-key[sqlalchemy]
1515
This is the canonical example from `examples/example_sql.py`:
1616

1717
!!! warning "Always set a pepper"
18-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
18+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
1919

2020
```python
2121
--8<-- "examples/example_sql.py"

docs/usage/dotenv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ API_KEY_DEV=ak-dcde9fa8eec44aa2-n8JK2HPXoosH6UXPL5h2YeO3OdW55WESb97CKc7mbVUzFpWF
1313
This is the canonical example from `examples/example_inmemory_env.py`:
1414

1515
!!! warning "Always set a pepper"
16-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
16+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
1717

1818
```python
1919
--8<-- "examples/example_inmemory_env.py"

docs/usage/fastapi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ together using FastAPI dependency injection.
1414
This is the canonical example from `examples/example_fastapi.py`:
1515

1616
!!! warning "Always set a pepper"
17-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
17+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
1818

1919
```python
2020
--8<-- "examples/example_fastapi.py"

docs/usage/scopes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you define 2 scopes "read" and "write" to an route, an API key must have both
1010
This is the canonical example from `examples/example_scopes.py`:
1111

1212
!!! warning "Always set a pepper"
13-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
13+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
1414

1515
```python
1616
--8<-- "examples/example_scopes.py"

docs/usage/typer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ together using Typer dependency injection.
1414
This is the canonical example from `examples/example_cli.py`.
1515

1616
!!! warning "Always set a pepper"
17-
The default pepper is a placeholder. Set `API_KEY_PEPPER` (or pass it explicitly to the hashers) in every environment.
17+
The default pepper is a placeholder. Set `SECRET_PEPPER` (or pass it explicitly to the hashers) in every environment.
1818

1919
```python
2020
--8<-- "examples/example_cli.py"

examples/example_cached.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Set env var to override default pepper
1313
# Using a strong, unique pepper is crucial for security
1414
# Default pepper is insecure and should not be used in production
15-
pepper = os.getenv("API_KEY_PEPPER", "change_me")
15+
pepper = os.getenv("SECRET_PEPPER")
1616
hasher = Argon2ApiKeyHasher(pepper=pepper)
1717

1818
# default hasher is Argon2 with a default pepper (to be changed in prod)

examples/example_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ApiKeyModel(Base, ApiKeyModelMixin): ...
2121
# Set env var to override default pepper
2222
# Using a strong, unique pepper is crucial for security
2323
# Default pepper is insecure and should not be used in production
24-
pepper = os.getenv("API_KEY_PEPPER")
24+
pepper = os.getenv("SECRET_PEPPER")
2525
hasher = Argon2ApiKeyHasher(pepper=pepper)
2626

2727
path = Path(__file__).parent / "db.sqlite3"

examples/example_fastapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Set env var to override default pepper
1414
# Using a strong, unique pepper is crucial for security
1515
# Default pepper is insecure and should not be used in production
16-
pepper = os.getenv("API_KEY_PEPPER")
16+
pepper = os.getenv("SECRET_PEPPER")
1717
hasher = Argon2ApiKeyHasher(pepper=pepper)
1818

1919
path = Path(__file__).parent / "db.sqlite3"

0 commit comments

Comments
 (0)