@@ -103,7 +103,7 @@ type Server interface {
103103 // SetBasicAuthHandler enables HTTP Basic Authentication and requires clients to pass credentials.
104104 // The handler function is called whenever a new client attempts to connect, to check for credentials correctness.
105105 // The handler must return true if the credentials were correct, false otherwise.
106- SetBasicAuthHandler (handler func (username string , password string ) bool )
106+ SetBasicAuthHandler (handler func (chargePointID string , username string , password string ) bool )
107107 // SetCheckOriginHandler sets a handler for incoming websocket connections, allowing to perform
108108 // custom cross-origin checks.
109109 //
@@ -137,7 +137,7 @@ type server struct {
137137 checkClientHandler CheckClientHandler
138138 newClientHandler func (ws Channel )
139139 disconnectedHandler func (ws Channel )
140- basicAuthHandler func (username string , password string ) bool
140+ basicAuthHandler func (chargePointID string , username string , password string ) bool
141141 tlsCertificatePath string
142142 tlsCertificateKey string
143143 timeoutConfig ServerTimeoutConfig
@@ -232,7 +232,7 @@ func (s *server) SetChargePointIdResolver(resolver func(r *http.Request) (string
232232 s .chargePointIdResolver = resolver
233233}
234234
235- func (s * server ) SetBasicAuthHandler (handler func (username string , password string ) bool ) {
235+ func (s * server ) SetBasicAuthHandler (handler func (chargePointID string , username string , password string ) bool ) {
236236 s .basicAuthHandler = handler
237237}
238238
387387 if s .basicAuthHandler != nil {
388388 username , password , ok := r .BasicAuth ()
389389 if ok {
390- ok = s .basicAuthHandler (username , password )
390+ ok = s .basicAuthHandler (id , username , password )
391391 }
392392 if ! ok {
393393 s .error (fmt .Errorf ("basic auth failed: credentials invalid" ))
0 commit comments