MCPcopy Index your code
hub / github.com/syncthing/syncthing / auth

Function auth

lib/api/api_auth.go:230–236  ·  view source on GitHub ↗
(username string, password string, guiCfg config.GUIConfiguration, ldapCfg config.LDAPConfiguration)

Source from the content-addressed store, hash-verified

228}
229
230func auth(username string, password string, guiCfg config.GUIConfiguration, ldapCfg config.LDAPConfiguration) bool {
231 if guiCfg.AuthMode == config.AuthModeLDAP {
232 return authLDAP(username, password, ldapCfg)
233 } else {
234 return authStatic(username, password, guiCfg)
235 }
236}
237
238func authStatic(username string, password string, guiCfg config.GUIConfiguration) bool {
239 return guiCfg.CompareHashedPassword(password) == nil && username == guiCfg.User

Callers 2

passwordAuthHandlerMethod · 0.85
attemptBasicAuthFunction · 0.85

Calls 2

authLDAPFunction · 0.85
authStaticFunction · 0.85

Tested by

no test coverage detected