30 lines
572 B
Go
30 lines
572 B
Go
|
package auth
|
||
|
|
||
|
import "net/http"
|
||
|
|
||
|
//----------------------------------------------------------------------------------------------------------------------
|
||
|
type NoAuth struct {
|
||
|
User AuthData
|
||
|
}
|
||
|
|
||
|
func (a *NoAuth) DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool) {
|
||
|
return &a.User, true
|
||
|
}
|
||
|
|
||
|
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",
|
||
|
},
|
||
|
}
|
||
|
}
|