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

Secure Credential Endpoints with JWT Authentication #43

Open
nee1k opened this issue Feb 13, 2025 · 1 comment
Open

Secure Credential Endpoints with JWT Authentication #43

nee1k opened this issue Feb 13, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nee1k
Copy link
Collaborator

nee1k commented Feb 13, 2025

Our current credential endpoints (/get_hf_credentials, /get_github_credentials, /get_ndp_credentials) expose sensitive tokens directly. To secure these endpoints, we need to implement JWT-based authentication so that only authorized users can access the credentials.

Requirements:

  • Implement a JWT validation decorator (e.g., @token_required) that checks for a valid token in the Authorization header.
  • Protect the credential endpoints with this decorator.
  • Use os.getenv() to retrieve the credentials from the server's environment.
  • Ensure requests with missing or invalid tokens return a 401 error.

Acceptance:
Only valid JWTs allow access to the endpoints; otherwise, return 401 Unauthorized.

@nee1k nee1k added the enhancement New feature or request label Feb 13, 2025
@nee1k nee1k added this to the v.20 milestone Feb 13, 2025
@nee1k nee1k self-assigned this Feb 13, 2025
@nee1k
Copy link
Collaborator Author

nee1k commented Feb 20, 2025

Registering a user would also help in securely sharing the repository credentials.

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

No branches or pull requests

1 participant