2018-03-24 16:12:02 +00:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
2023-05-23 14:09:57 +00:00
|
|
|
// ----------------------------------------------------------------------------------------------------------------------
|
2018-03-24 16:12:02 +00:00
|
|
|
type NoAuth struct {
|
|
|
|
User AuthData
|
|
|
|
}
|
|
|
|
|
2023-05-28 16:34:12 +00:00
|
|
|
func (a *NoAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, int) {
|
|
|
|
return &a.User, http.StatusOK
|
2018-03-24 16:12:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *NoAuth) AddUser(user string, group string, password string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *NoAuth) DeleteUser(user string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNoAuth() AuthManager {
|
|
|
|
return &NoAuth{
|
|
|
|
User: AuthData{
|
|
|
|
User: "admin",
|
|
|
|
Group: "admin",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|