mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Add GetRemoteUserCredentials
Need by pion/webrtc for ICE Restarts Relates to pion/webrtc#1251
This commit is contained in:
@@ -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{})
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user