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

Fix metrics auth token detection #6006

Merged
merged 3 commits into from Feb 9, 2019

Conversation

@barkap
Copy link
Contributor

commented Feb 8, 2019

Metrics token authorization currently does not work with token and metrics enabled in config. There's always 401 response without any data. This fixes header detection.

Fix metrics auth token detection
Signed-off-by: Pauls Barkans <paulsb@gmail.com>
@techknowlogick

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

Thanks for PR @barkap, would you be able to add a test for this?

@lafriks

lafriks approved these changes Feb 8, 2019

@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Feb 8, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Feb 8, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Feb 8, 2019

Codecov Report

Merging #6006 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6006   +/-   ##
=======================================
  Coverage   38.72%   38.72%           
=======================================
  Files         332      332           
  Lines       48992    48992           
=======================================
  Hits        18973    18973           
  Misses      27271    27271           
  Partials     2748     2748
Impacted Files Coverage Δ
routers/metrics.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11a9ce6...aa87281. Read the comment docs.

@barkap

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2019

Thanks for PR @barkap, would you be able to add a test for this?

I'm not too familiar with gitea as a whole and existing go tests mostly fail for me so I'm probably unable to write new test with mocks for this package at the time.

@techknowlogick techknowlogick merged commit 8c865f3 into go-gitea:master Feb 9, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details
@techknowlogick

This comment has been minimized.

Copy link
Member

commented Feb 9, 2019

@barkap that's ok, thanks for explaining. My computer is so low powered that I rely on drone for running my tests as otherwise it'd be >1.5hours just to test against sqlite 😢 maybe it is time for me to get a new computer 🤔

Would you be able to send a backport of this PR against the release/v1.7 branch? If you need any clarification or assistance please let me know and I can help you out.

@barkap

This comment has been minimized.

Copy link
Contributor Author

commented Feb 9, 2019

Yes, I'll send pr in a bit. Thank you.

barkap added a commit to barkap/gitea that referenced this pull request Feb 9, 2019

Fix metrics auth token detection (go-gitea#6006)
Signed-off-by: Pauls Barkans <paulsb@gmail.com>

zeripath added a commit that referenced this pull request Feb 9, 2019

Fix metrics auth token detection (#6006) (#6017)
Backport of #6006 

Signed-off-by: Pauls Barkans <paulsb@gmail.com>

Mikescher added a commit to Mikescher/gitea that referenced this pull request Mar 20, 2019

Fix metrics auth token detection (go-gitea#6006)
Signed-off-by: Pauls Barkans <paulsb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
7 participants
You can’t perform that action at this time.