Skip to content

Commit

Permalink
rename InformerService method to ListBannedUsersByEmail
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <[email protected]>
  • Loading branch information
filariow committed Aug 29, 2024
1 parent 50348ed commit 726b42e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/application/service/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type InformerService interface {
ListSpaceBindings(reqs ...labels.Requirement) ([]toolchainv1alpha1.SpaceBinding, error)
GetProxyPluginConfig(name string) (*toolchainv1alpha1.ProxyPlugin, error)
GetNSTemplateTier(name string) (*toolchainv1alpha1.NSTemplateTier, error)
BannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error)
ListBannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error)
}

type SignupService interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/informers/service/informer_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (s *ServiceImpl) GetNSTemplateTier(name string) (*toolchainv1alpha1.NSTempl
return tier, err
}

func (s *ServiceImpl) BannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error) {
func (s *ServiceImpl) ListBannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error) {
hashedEmail := hash.EncodeString(email)
r, err := labels.NewRequirement(toolchainv1alpha1.BannedUserEmailHashLabelKey, selection.Equals, []string{hashedEmail})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (p *Proxy) ensureUserIsNotBanned() echo.MiddlewareFunc {
}

// retrieve banned users
uu, err := p.app.InformerService().BannedUsersByEmail(email)
uu, err := p.app.InformerService().ListBannedUsersByEmail(email)
if err != nil {
return errorResponse(crterrors.NewInternalError(errs.New("unable to retrieve user"), "could not define ban status"))
}
Expand Down
2 changes: 1 addition & 1 deletion test/fake/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (f Informer) GetNSTemplateTier(tier string) (*toolchainv1alpha1.NSTemplateT
panic("not supposed to call GetNSTemplateTierFunc")
}

func (f Informer) BannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error) {
func (f Informer) ListBannedUsersByEmail(email string) ([]toolchainv1alpha1.BannedUser, error) {
if f.BannedUsersByEmailFunc != nil {
return f.BannedUsersByEmailFunc(email)
}
Expand Down

0 comments on commit 726b42e

Please sign in to comment.