livepeer / go-livepeer

Official Go implementation of the Livepeer protocol
http://livepeer.org
MIT License
537 stars 165 forks source link

Return appropriate errors when auth fails, not just 5xx #3065

Closed thomshutt closed 1 month ago

thomshutt commented 1 month ago

What does this pull request do? Explain your changes. (required) Have the Broadcaster return appropriate HTTP status codes on auth failure paths, to make monitoring and diagnosis of issues easier.

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 57.40929%. Comparing base (6cfaf1e) to head (44f6b9e).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065/graphs/tree.svg?width=650&height=150&src=pr&token=vKzl2rUYvB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ```diff @@ Coverage Diff @@ ## master #3065 +/- ## =================================================== + Coverage 57.40400% 57.40929% +0.00529% =================================================== Files 92 92 Lines 15755 15764 +9 =================================================== + Hits 9044 9050 +6 - Misses 6109 6111 +2 - Partials 602 603 +1 ``` | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/mediaserver.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?src=pr&el=tree&filepath=server%2Fmediaserver.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL21lZGlhc2VydmVyLmdv) | `67.49760% <88.46154%> (-0.00724%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Last update [6cfaf1e...44f6b9e](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/mediaserver.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3065?src=pr&el=tree&filepath=server%2Fmediaserver.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL21lZGlhc2VydmVyLmdv) | `67.49760% <88.46154%> (-0.00724%)` | :arrow_down: |