Skip to content

Commit

Permalink
[#4002]Feature/ Docusign integration with Go
Browse files Browse the repository at this point in the history
- Updated icla API

Signed-off-by: Harold Wanyama <hwanyama@contractor.linuxfoundation.org>
  • Loading branch information
nickmango committed Oct 16, 2023
1 parent b6c105e commit c1bedfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion cla-backend-go/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 0 additions & 12 deletions cla-backend-go/v2/gitlab_organizations/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions cla-backend-go/v2/gitlab_organizations/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
7 changes: 5 additions & 2 deletions cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c1bedfc

Please sign in to comment.