Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <filario@redhat.com>
  • Loading branch information
filariow committed Jul 25, 2024
1 parent ef8e333 commit 8cf0f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func (p *Proxy) processHomeWorkspaceRequest(ctx echo.Context, userID, username,
// processWorkspaceRequest process an HTTP Request targeting a specific workspace.
func (p *Proxy) processWorkspaceRequest(ctx echo.Context, userID, username, workspaceName, proxyPluginName string) (*access.ClusterAccess, error) {
// check that the user is provisioned and the space exists
if err := p.validateUserIsProvisionedAndSpaceExists(ctx, userID, username, workspaceName); err != nil {
if err := p.checkUserIsProvisionedAndSpaceExists(ctx, userID, username, workspaceName); err != nil {
return nil, err
}

Expand All @@ -345,9 +345,9 @@ func (p *Proxy) processWorkspaceRequest(ctx echo.Context, userID, username, work
return p.getClusterAccess(ctx, userID, username, workspaceName, proxyPluginName, workspace)
}

// validateUserIsProvisionedAndSpaceExists checks that the user is provisioned and the Space exists.
// checkUserIsProvisionedAndSpaceExists checks that the user is provisioned and the Space exists.
// If the PublicViewer support is enabled, User check is skipped.
func (p *Proxy) validateUserIsProvisionedAndSpaceExists(ctx echo.Context, userID, username, workspaceName string) error {
func (p *Proxy) checkUserIsProvisionedAndSpaceExists(ctx echo.Context, userID, username, workspaceName string) error {
if err := p.checkUserIsProvisioned(ctx, userID, username); err != nil {
return crterrors.NewInternalError(errs.New("unable to get target cluster"), err.Error())
}
Expand Down

0 comments on commit 8cf0f7b

Please sign in to comment.