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

Token auth #508

Merged
merged 4 commits into from
Dec 20, 2023
Merged

Token auth #508

merged 4 commits into from
Dec 20, 2023

Conversation

smekuria1
Copy link
Contributor

@smekuria1 smekuria1 commented Dec 14, 2023

Adds #505

This is my attempt to add basic simple Auth Token Authentication.
It works in a similar way to Basic Auth but can be expanded to be able to use JWTs( I can add that but it requires adding more libraries which i didn't want to do)

To-do:

  • Implement the configuration option for token-based authentication (AuthToken field).
  • Create an environment variable (DAGU_AUTH_TOKEN) for token management.
  • Implement middleware for token-based authentication.
  • Test that the Web UI remains unaffected by these changes.
    When either Basic Auth or Auth Token is turned on the WebUI doesn't work which i believe is a feature since the webui is not configured to send tokens or credentials
  • Adjust basic auth middleware to recognize and skip requests with valid tokens.
  • Add docs for auth Token authentication

Wrong Auth Token
image

Correct Auth Token
image

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b07ebc5) 74.25% compared to head (78601c7) 74.25%.
Report is 1 commits behind head on main.

❗ Current head 78601c7 differs from pull request most recent head af40f47. Consider uploading reports for the commit af40f47 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #508   +/-   ##
=======================================
  Coverage   74.25%   74.25%           
=======================================
  Files          40       40           
  Lines        3604     3604           
=======================================
  Hits         2676     2676           
  Misses        789      789           
  Partials      139      139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@smekuria1 smekuria1 marked this pull request as draft December 16, 2023 18:39
@smekuria1 smekuria1 marked this pull request as ready for review December 16, 2023 18:43
Copy link
Collaborator

@yottahmd yottahmd left a comment

Choose a reason for hiding this comment

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

Thanks a lot for submitting the PR! I have added a few comment, I appreciate if you could make some small adjustments when you have time.

@smekuria1
Copy link
Contributor Author

Hi, I have implemented the changes your requested. Thank you so much for your instructions and if there is anything i need to add or change let me know.

ps i ran into some weird git issues so i apologize for some of the unnecessary commits

@smekuria1 smekuria1 requested a review from yottahmd December 18, 2023 16:35
@yottahmd
Copy link
Collaborator

Looks good to me. Thank you so much for the great work!

@yottahmd yottahmd merged commit 966a34d into dagu-org:main Dec 20, 2023
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.

2 participants