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

Removed docusign-esign package for oauth flow #4102

Merged
merged 1 commit into from
Aug 29, 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
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
Loading