@@ -139,6 +139,17 @@ func passShaOrBcrypt(h *htpasswdMap, user, password string) (invalidEntries []st
139139 return invalidEntries
140140}
141141
142+// GetUsers return a "thread safe" copy of the internal user list
143+func (h *htpasswdMap) GetUsers() map[string]interface{} {
144+ newUserList := make(map[string]interface{})
145+ h.rwm.Lock()
146+ for key, value := range h.users {
147+ newUserList[key] = value
148+ }
149+ h.rwm.Unlock()
150+ return newUserList
151+}
152+
142153// Validate checks a users password against the htpasswd entries
143154func (h *htpasswdMap) Validate(user string, password string) bool {
144155 realPassword, exists := h.users[user]