Skip to content

Commit 8eb9865

Browse files
committed
💡(backend) warm about the token nature of Yprovider microservice
Note to the future myself, using a raw token format is not common. It should be refactor
1 parent c10808b commit 8eb9865

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/backend/core/services/collaboration_services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def reset_connections(self, room, user_id=None):
2626
# same pod thanks to a parameter
2727
endpoint_url = f"{settings.COLLABORATION_API_URL}{endpoint}/?room={room}"
2828

29+
# Note: Collaboration microservice accepts only raw token, which is not recommended
2930
headers = {"Authorization": settings.COLLABORATION_SERVER_SECRET}
3031
if user_id:
3132
headers["X-User-Id"] = user_id

src/backend/core/services/converter_services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class YdocConverter:
3131
@property
3232
def auth_header(self):
3333
"""Build microservice authentication header."""
34+
# Note: Yprovider microservice accepts only raw token, which is not recommended
3435
return settings.Y_PROVIDER_API_KEY
3536

3637
def convert_markdown(self, text):

src/frontend/servers/y-provider/src/middlewares.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const httpSecurity = (
2525
}
2626

2727
// Secret API Key check
28+
// Note: Changing this header to Bearer token format will break backend compatibility with this microservice.
2829
const apiKey = req.headers['authorization'];
2930
if (apiKey !== COLLABORATION_SERVER_SECRET) {
3031
res.status(403).json({ error: 'Forbidden: Invalid API Key' });

0 commit comments

Comments
 (0)