diff --git a/auth/client.go b/auth/client.go index 7f40efe4..c7a6f1a5 100644 --- a/auth/client.go +++ b/auth/client.go @@ -10,8 +10,7 @@ import ( "github.com/aler9/gortsplib/headers" ) -// Client is an object that helps a client to send its credentials to a -// server. +// Client is an object that allows a client to authenticate against a server. type Client struct { user string pass string @@ -20,7 +19,7 @@ type Client struct { nonce string } -// NewClient allocates an Client. +// NewClient allocates a Client. // header is the WWW-Authenticate header provided by the server. func NewClient(v base.HeaderValue, user string, pass string) (*Client, error) { // prefer digest diff --git a/auth/server.go b/auth/server.go index bd6f22ac..779b6440 100644 --- a/auth/server.go +++ b/auth/server.go @@ -12,8 +12,7 @@ import ( "github.com/aler9/gortsplib/headers" ) -// Server is an object that helps a server to validate the credentials of -// a client. +// Server is an object that helps a server to authenticate a client. type Server struct { user string pass string @@ -22,7 +21,7 @@ type Server struct { nonce string } -// NewServer allocates an Server. +// NewServer allocates a Server. // If methods is nil, the Basic and Digest methods are used. func NewServer(user string, pass string, methods []headers.AuthMethod) *Server { if methods == nil { @@ -42,7 +41,8 @@ func NewServer(user string, pass string, methods []headers.AuthMethod) *Server { } } -// GenerateHeader generates the WWW-Authenticate header needed by a client to log in. +// GenerateHeader generates the WWW-Authenticate header needed by a client to +// authenticate. func (as *Server) GenerateHeader() base.HeaderValue { var ret base.HeaderValue for _, m := range as.methods {