Add GetRemoteUserCredentials

Need by pion/webrtc for ICE Restarts

Relates to pion/webrtc#1251
This commit is contained in:
Sean DuBois
2020-06-29 08:34:18 -07:00
committed by Sean DuBois
parent 5c1bbaa050
commit bc8f00d8e0
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -706,6 +706,11 @@ func (a *Agent) GetLocalUserCredentials() (frag string, pwd string) {
return a.localUfrag, a.localPwd
}
// GetRemoteUserCredentials returns the remote user credentials
func (a *Agent) GetRemoteUserCredentials() (frag string, pwd string) {
return a.remoteUfrag, a.remotePwd
}
// Close cleans up the Agent
func (a *Agent) Close() error {
done := make(chan struct{})
+8
View File
@@ -1455,3 +1455,11 @@ func TestAgentRestart(t *testing.T) {
assert.NoError(t, connB.agent.Close())
})
}
func TestGetRemoteCredentials(t *testing.T) {
a := Agent{remoteUfrag: "remoteUfrag", remotePwd: "remotePwd"}
actualUfrag, actualPwd := a.GetRemoteUserCredentials()
assert.Equal(t, actualUfrag, a.remoteUfrag)
assert.Equal(t, actualPwd, a.remotePwd)
}