Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): Add function to check if service request is authenticated #9806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FirelightFlagboy
Copy link
Contributor

No description provided.

@FirelightFlagboy FirelightFlagboy requested a review from a team as a code owner February 24, 2025 14:39
Comment on lines 200 to 201
# Bearer token used to authenticate the service API
service_token: str
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: By service we mainly mean the API that will use parsec-auth.

It's different from admin-token since the operation done by parsec-auth are read-only

@@ -43,6 +43,7 @@ def backend_config(
email_config=MockedEmailConfig("[email protected]", tmpdir),
blockstore_config=blockstore_config,
administration_token="s3cr3t",
service_token="P4ssw0rd",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
service_token="P4ssw0rd",
service_token="s3rv1c3",

P4ssw0rd as token is a bit weird...

@@ -197,6 +197,9 @@ class BackendConfig:

# Bearer token used to authenticate the administration API
administration_token: str
# Bearer token used to authenticate the service API
# If not defined, the API is not accessible
service_token: str | None = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this service API ?

If we end up with two unrelated APIs both using a token, we must further document what each of them are for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants