Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/docusign envelope request #4178

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (
"errors"
"fmt"
"io"
"math/rand"
"net/http"
"net/url"
"strconv"
"strings"
"time"

"github.com/communitybridge/easycla/cla-backend-go/github"
"github.com/communitybridge/easycla/cla-backend-go/github_organizations"
Expand Down Expand Up @@ -338,7 +340,7 @@ func (s *service) RequestCorporateSignature(ctx context.Context, lfUsername stri
}

func (s *service) getCorporateSignatureCallbackUrl(companyId, projectId string) string {
return fmt.Sprintf("%s/v2/signed/corporate/%s/%s", s.ClaV4ApiURL, companyId, projectId)
return fmt.Sprintf("%s/v4/signed/corporate/%s/%s", s.ClaV4ApiURL, companyId, projectId)
}

func (s *service) SignedIndividualCallbackGithub(ctx context.Context, payload []byte, installationID, changeRequestID, repositoryID string) error {
Expand Down Expand Up @@ -796,7 +798,7 @@ func (s *service) getIndividualSignatureCallbackURL(ctx context.Context, userID
return "", err
}

return fmt.Sprintf("%s/v2/signed/individual/%d/%s/%s", s.ClaV4ApiURL, installationId, repositoryID, pullRequestID), nil
return fmt.Sprintf("%s/v4/signed/individual/%d/%s/%s", s.ClaV4ApiURL, installationId, repositoryID, pullRequestID), nil
}

//nolint:gocyclo
Expand Down Expand Up @@ -881,7 +883,12 @@ func (s *service) populateSignURL(ctx context.Context,
}
}

documentID := uuid.Must(uuid.NewV4()).String()
// seed the random number generator
rand.Seed(time.Now().UnixNano())

randomInteger := rand.Intn(1000000)
documentID := strconv.Itoa(randomInteger)

tab := getTabsFromDocument(&document, documentID, defaultValues)

// # Create the envelope request object
Expand Down
Loading