Skip to content

Commit

Permalink
Make getProviderAccessToken private (#1506)
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
rdimitrov authored Nov 6, 2023
1 parent 6712ee4 commit 9598c40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/controlplane/handlers_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ func (s *Server) ExchangeCodeForTokenWEB(ctx context.Context,
}, nil
}

// GetProviderAccessToken returns the access token for providers
func (s *Server) GetProviderAccessToken(ctx context.Context, provider string,
// getProviderAccessToken returns the access token for providers
func (s *Server) getProviderAccessToken(ctx context.Context, provider string,
projectID uuid.UUID, checkAuthz bool) (oauth2.Token, string, error) {
// check if user is authorized
if checkAuthz {
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func (s *Server) ListRemoteRepositoriesFromProvider(
}

// FIXME: this is a hack to get the owner filter from the request
_, owner_filter, err := s.GetProviderAccessToken(ctx, provider.Name, projectID, true)
_, owner_filter, err := s.getProviderAccessToken(ctx, provider.Name, projectID, true)

if err != nil {
return nil, status.Errorf(codes.PermissionDenied, "cannot get access token for provider")
Expand Down

0 comments on commit 9598c40

Please sign in to comment.