Skip to content

Commit

Permalink
Merge pull request #4178 from nickmango/bug/docsign-doc-id
Browse files Browse the repository at this point in the history
Bug/docusign envelope request
  • Loading branch information
nickmango authored Nov 20, 2023
2 parents 8ef3e8a + 2553256 commit cf0c019
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit cf0c019

Please sign in to comment.