diff --git a/cla-backend-go/cmd/server.go b/cla-backend-go/cmd/server.go index c9c73c6e1..56e4d108a 100644 --- a/cla-backend-go/cmd/server.go +++ b/cla-backend-go/cmd/server.go @@ -318,7 +318,7 @@ func server(localMode bool) http.Handler { v2GithubActivityService := v2GithubActivity.NewService(gitV1Repository, githubOrganizationsRepo, eventsService, autoEnableService, emailService) v2ClaGroupService := cla_groups.NewService(v1ProjectService, templateService, v1ProjectClaGroupRepo, v1ClaManagerService, v1SignaturesService, metricsRepo, gerritService, v1RepositoriesService, eventsService) - v2SignService := sign.NewService(configFile.ClaV1ApiURL, v1CompanyRepo, v1CLAGroupRepo, v1ProjectClaGroupRepo, v1CompanyService, v2ClaGroupService, configFile.DocuSignPrivateKey) + v2SignService := sign.NewService(configFile.ClaV1ApiURL, v1CompanyRepo, v1CLAGroupRepo, v1ProjectClaGroupRepo, v1CompanyService, v2ClaGroupService, configFile.DocuSignPrivateKey, usersService, v1SignaturesService, storeRepository, v1RepositoriesService, githubOrganizationsService, gitlabOrganizationsService) sessionStore, err := dynastore.New(dynastore.Path("/"), dynastore.HTTPOnly(), dynastore.TableName(configFile.SessionStoreTableName), dynastore.DynamoDB(dynamodb.New(awsSession))) if err != nil { diff --git a/cla-backend-go/v2/gitlab_organizations/repository.go b/cla-backend-go/v2/gitlab_organizations/repository.go index 7022ca464..f059537b8 100644 --- a/cla-backend-go/v2/gitlab_organizations/repository.go +++ b/cla-backend-go/v2/gitlab_organizations/repository.go @@ -49,7 +49,6 @@ type RepositoryInterface interface { GetGitLabOrganizationsEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error) GetGitLabOrganizationsEnabledWithAutoEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error) GetGitLabOrganizationsByProjectSFID(ctx context.Context, projectSFID string) (*v2Models.GitlabOrganizations, error) - GetGitLabOrganizationByProjectID(ctx context.Context, projectSFID string) (*v2Models.GitlabOrganization, error) GetGitLabOrganizationsByFoundationSFID(ctx context.Context, foundationSFID string) (*v2Models.GitlabOrganizations, error) GetGitLabOrganization(ctx context.Context, gitlabOrganizationID string) (*common.GitLabOrganization, error) GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*common.GitLabOrganization, error) @@ -204,17 +203,6 @@ func (repo *Repository) AddGitLabOrganization(ctx context.Context, input *common return common.ToModel(gitlabOrg), nil } -func (repo *Repository) GetGitLabOrganizationByProjectID(ctx context.Context, projectID string) (*v2Models.GitlabOrganization, error) { - // f := logrus.Fields{ - // "functionName": "v2.gitlab_organizations.repository.GetGitLabOrganizationsByProjectID", - // utils.XREQUESTID: ctx.Value(utils.XREQUESTID), - // "projectID": projectID, - // } - - // condition := expression.Key(GitLabOrganizationsProjectSFIDColumn).Equal(expression.Value(projectID)) - return nil, nil -} - // GetGitLabOrganizations returns the complete list of GitLab groups/organizations func (repo *Repository) GetGitLabOrganizations(ctx context.Context) (*v2Models.GitlabOrganizations, error) { // No filter, return all diff --git a/cla-backend-go/v2/gitlab_organizations/service.go b/cla-backend-go/v2/gitlab_organizations/service.go index 1c8856c11..160274217 100644 --- a/cla-backend-go/v2/gitlab_organizations/service.go +++ b/cla-backend-go/v2/gitlab_organizations/service.go @@ -48,7 +48,6 @@ type ServiceInterface interface { AddGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization) (*v2Models.GitlabProjectOrganizations, error) GetGitLabOrganization(ctx context.Context, gitLabOrganizationID string) (*v2Models.GitlabOrganization, error) GetGitLabOrganizationByID(ctx context.Context, gitLabOrganizationID string) (*common.GitLabOrganization, error) - GetGitLabOrganizationByProjectID(ctx context.Context, gitLabRepositoryID string) (*common.GitLabOrganization, error) GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*v2Models.GitlabOrganization, error) GetGitLabOrganizationByFullPath(ctx context.Context, gitLabOrganizationFullPath string) (*v2Models.GitlabOrganization, error) GetGitLabOrganizationByURL(ctx context.Context, url string) (*v2Models.GitlabOrganization, error) @@ -1059,19 +1058,3 @@ func (s *Service) updateRepositoryStatus(glClient *goGitLab.Client, gitLabProjec return gitLabProjectRepos } - -func (s *Service) GetGitLabOrganizationByProjectID(ctx context.Context, gitLabRepositoryID string) (*common.GitLabOrganization, error) { - // f := logrus.Fields{ - // "functionName": "v2.gitlab_organizations.service.GetGitLabOrganizationByProjectID", - // utils.XREQUESTID: ctx.Value(utils.XREQUESTID), - // "gitLabRepositoryID": gitLabRepositoryID, - // } - - // log.WithFields(f).Debugf("fetching gitlab organization for gitlab repository id : %s", gitLabRepositoryID) - // dbModel, err := s.repo.GetGitLabOrganizationByProjectID(ctx, gitLabRepositoryID) - // if err != nil { - // return nil, err - // } - - return nil, nil -} diff --git a/cla-backend-go/v2/sign/service.go b/cla-backend-go/v2/sign/service.go index a7a958017..c1046cb1c 100644 --- a/cla-backend-go/v2/sign/service.go +++ b/cla-backend-go/v2/sign/service.go @@ -82,12 +82,12 @@ type service struct { storeRepository store.Repository repositoryService repositories.Service githubOrgService github_organizations.Service - gitlabOrgService gitlab_organizations.Service + gitlabOrgService gitlab_organizations.ServiceInterface } // NewService returns an instance of v2 project service func NewService(apiURL string, compRepo company.IRepository, projectRepo ProjectRepo, pcgRepo projects_cla_groups.Repository, compService company.IService, claGroupService cla_groups.Service, docsignPrivateKey string, userService users.Service, signatureService signatures.SignatureService, storeRepository store.Repository, - repositoryService repositories.Service, githubOrgService github_organizations.Service, gitlabOrgService gitlab_organizations.Service) Service { + repositoryService repositories.Service, githubOrgService github_organizations.Service, gitlabOrgService gitlab_organizations.ServiceInterface) Service { return &service{ ClaV1ApiURL: apiURL, companyRepo: compRepo, @@ -494,6 +494,9 @@ func (s *service) RequestIndividualSignature(ctx context.Context, input *models. SignatureType: utils.SignatureTypeCLA, SignatureCreated: currentTime, SignatureModified: currentTime, + SignatureReturnURL: input.ReturnURL.String(), + SignatureCallbackURL: callBackURL, + SignatureReturnURLType: input.ReturnURLType, } // 9. Set signature ACL