-
Notifications
You must be signed in to change notification settings - Fork 167
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
server: transcode auth webhook #1731
Conversation
@@ -302,6 +309,34 @@ func verifyOrchestratorReq(orch Orchestrator, addr ethcommon.Address, sig []byte | |||
return orch.CheckCapacity("") | |||
} | |||
|
|||
// authenticateBroadcaster returns an error if authentication fails | |||
func authenticateBroadcaster(id string) error { | |||
if AuthWebhookURL == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AuthWebhookURL
is set only for Broadcaster node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 9ce9e44
|
||
Webhooks can authenticate streams supported by the RTMP and HTTP push ingest protocols. See the [ingest documentation](ingest.md) for details on how to use these protocols. | ||
The webhook server should respond with HTTP status code `200` in order to authenticate / authorize the stream. A response with a HTTP status code other than `200` will cause the Livepeer node to disconnect the stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says that code should be strictly 200 for success, but actual code checks for whole 2XX range. Should we make them match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 4090a12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2212d19
to
80fc877
Compare
80fc877
to
514e94e
Compare
3202e6d
to
2364519
Compare
What does this pull request do? Explain your changes. (required)
Allows Orchestrators to specify an
-authWebhookUrl
to authenticate broadcasters upon discovery (GetOrchestatorInfo
).Specific updates (required)
created an
authenticateBroadcaster()
function inserver/rpc.go
this will no-op if no-authWebhookUrl
is specifiedAdd a call to
authenticateBroadcaster()
when callinggetOrchestrator()
inserver/rpc.go
Added unit tests for this new behaviour for
getOrchestrator()
using thehttptest
package which spins up a one-off http server which we specify asserver.AuthWebhookUrl
Updated documentation on auth webhooks in
doc
How did you test each of these updates (required)
Added unit/integration tests
Does this pull request close any open issues?
Fixes #1569
Checklist:
./test.sh
pass