package auth import "errors" type Service struct { secret string admin string adminSecret string apiKey string } type ProviderIndex struct { ProvidersMap map[string]string Providers []string } func NewService(secret, admin, adminSecret, apiKey string) (*Service, error) { if secret == "" || admin == "" || adminSecret == "" || apiKey == "" { return nil, errors.New("error building Auth service. Verify your env variables") } return &Service{ secret, admin, adminSecret, apiKey, }, nil } func (as *Service) Authenticate(email, password string) bool { return email == as.admin && password == as.adminSecret } func (as *Service) ValidateApiKey(key string) bool { return key == as.apiKey }