@@ -139,6 +139,17 @@ func passShaOrBcrypt(h *htpasswdMap, user, password string) (invalidEntries []st
139 return invalidEntries
139 return invalidEntries
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{})
146+ for key, value := range h.users {
147+ newUserList[key] = value
142// Validate checks a users password against the htpasswd entries
153// Validate checks a users password against the htpasswd entries
143func (h *htpasswdMap) Validate(user string, password string) bool {
154func (h *htpasswdMap) Validate(user string, password string) bool {
144 realPassword, exists := h.users[user]
155 realPassword, exists := h.users[user]