noauth.go 572 B

1234567891011121314151617181920212223242526272829
  1. package auth
  2. import "net/http"
  3. //----------------------------------------------------------------------------------------------------------------------
  4. type NoAuth struct {
  5. User AuthData
  6. }
  7. func (a *NoAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool) {
  8. return &a.User, true
  9. }
  10. func (a *NoAuth) AddUser(user string, group string, password string) error {
  11. return nil
  12. }
  13. func (a *NoAuth) DeleteUser(user string) error {
  14. return nil
  15. }
  16. func NewNoAuth() AuthManager {
  17. return &NoAuth{
  18. User: AuthData{
  19. User: "admin",
  20. Group: "admin",
  21. },
  22. }
  23. }