Skip to content

Commit

Permalink
Merge pull request #4102 from nickmango/bug/docusign-oauth
Browse files Browse the repository at this point in the history
Removed docusign-esign package for oauth flow
  • Loading branch information
nickmango authored Aug 29, 2023
2 parents 6ccdf36 + 5390bb9 commit 15b7cad
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions cla-backend/cla/models/docusign_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import pydocusign # type: ignore
import requests
from attr import dataclass
from docusign_esign import ApiClient
from pydocusign.exceptions import DocuSignException # type: ignore

import cla
from cla.controllers.lf_group import LFGroup
from cla.models import DoesNotExist, signing_service_interface
from cla.docusign_auth import request_access_token
from cla.models.dynamo_models import (Company, Document, Event, Gerrit,
Project, Signature, User)
from cla.models.event_types import EventType
Expand Down Expand Up @@ -107,24 +107,9 @@ def __init__(self):

def initialize(self, config):
try:
self.api_client = ApiClient()
self.api_client.set_base_path(auth_server)
response = self.api_client.request_jwt_user_token(
client_id=integrator_key,
user_id=user_id,
oauth_host_name=auth_server,
private_key_bytes=private_key.encode(),
expires_in=3600,
scopes=['signature', 'impersonation']
)

token = response.access_token

cla.log.debug(f"token: {token}")

cla.log.debug('Initializing DocuSign client...')
token = request_access_token()
self.client = pydocusign.DocuSignClient(root_url=root_url,oauth2_token=token)


except (Exception) as ex:
cla.log.error("Error authenticating Docusign: {}".format(ex))
return {'errors': {'Error authenticating Docusign'}}
Expand Down

0 comments on commit 15b7cad

Please sign in to comment.