|
|
@@ -2,7 +2,6 @@ package test
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
- "fmt"
|
|
|
|
|
|
"github.com/porter-dev/porter/internal/models"
|
|
|
"github.com/porter-dev/porter/internal/repository"
|
|
|
@@ -17,11 +16,7 @@ type AllowlistRepository struct {
|
|
|
// NewAllowlistRepository returns a AllowListRepository which uses
|
|
|
// gorm.DB for querying the database.
|
|
|
func NewAllowlistRepository(canQuery bool) repository.AllowlistRepository {
|
|
|
- return &AllowlistRepository{canQuery, []*models.Allowlist{
|
|
|
- {
|
|
|
- UserEmail: "some@email.com",
|
|
|
- },
|
|
|
- }}
|
|
|
+ return &AllowlistRepository{canQuery, []*models.Allowlist{}}
|
|
|
}
|
|
|
|
|
|
func (repo *AllowlistRepository) UserEmailExists(email string) (bool, error) {
|
|
|
@@ -29,8 +24,6 @@ func (repo *AllowlistRepository) UserEmailExists(email string) (bool, error) {
|
|
|
return false, errors.New("cannot read database")
|
|
|
}
|
|
|
|
|
|
- fmt.Println(len(repo.allowlist))
|
|
|
-
|
|
|
if len(repo.allowlist) == 0 {
|
|
|
return false, nil
|
|
|
}
|
|
|
@@ -38,7 +31,6 @@ func (repo *AllowlistRepository) UserEmailExists(email string) (bool, error) {
|
|
|
founded := false
|
|
|
|
|
|
for _, allowed := range repo.allowlist {
|
|
|
- fmt.Println(allowed.UserEmail)
|
|
|
if allowed.UserEmail == email {
|
|
|
founded = true
|
|
|
break
|