99
1010 "google.golang.org/grpc"
1111 "google.golang.org/grpc/codes"
12+ "google.golang.org/grpc/credentials/insecure"
1213 "google.golang.org/grpc/status"
1314
1415 "github.com/semaphoreio/semaphore/repohub/pkg/config"
@@ -60,7 +61,7 @@ func (s *TokenStore) FindRepoToken(r *models.Repository) (string, error) {
6061}
6162
6263func (s * TokenStore ) FindUser (userID string ) (* ia_user.DescribeResponse , error ) {
63- conn , err := grpc .Dial (config .UserAPIEndpoint (), grpc .WithInsecure ( ))
64+ conn , err := grpc .NewClient (config .UserAPIEndpoint (), grpc .WithTransportCredentials ( insecure . NewCredentials () ))
6465 if err != nil {
6566 return nil , err
6667 }
@@ -91,7 +92,7 @@ func (s *TokenStore) findIntegrationToken(projectID string, integrationType stri
9192 return s .fetchRepositoryToken (userID , ia_repository_integrator .IntegrationType (ia_repository_integrator .IntegrationType_value [integrationType ]))
9293 }
9394
94- conn , err := grpc .Dial (config .RepositoryIntegratorAPIEndpoint (), grpc .WithInsecure ( ))
95+ conn , err := grpc .NewClient (config .RepositoryIntegratorAPIEndpoint (), grpc .WithTransportCredentials ( insecure . NewCredentials () ))
9596 if err != nil {
9697 return "" , err
9798 }
@@ -117,7 +118,7 @@ func (s *TokenStore) findIntegrationToken(projectID string, integrationType stri
117118}
118119
119120func (s * TokenStore ) fetchRepositoryToken (userID string , integrationType ia_repository_integrator.IntegrationType ) (string , error ) {
120- conn , err := grpc .Dial (config .UserAPIEndpoint (), grpc .WithInsecure ( ))
121+ conn , err := grpc .NewClient (config .UserAPIEndpoint (), grpc .WithTransportCredentials ( insecure . NewCredentials () ))
121122 if err != nil {
122123 return "" , err
123124 }
@@ -138,7 +139,7 @@ func (s *TokenStore) fetchRepositoryToken(userID string, integrationType ia_repo
138139}
139140
140141func (s * TokenStore ) findProject (projectID string ) (* ia_projecthub.Project , error ) {
141- conn , err := grpc .Dial (config .ProjectAPIEndpoint (), grpc .WithInsecure ( ))
142+ conn , err := grpc .NewClient (config .ProjectAPIEndpoint (), grpc .WithTransportCredentials ( insecure . NewCredentials () ))
142143 if err != nil {
143144 return nil , err
144145 }
0 commit comments