From 505bee78080b6ef6db7fd2e35b2667e011bc85e3 Mon Sep 17 00:00:00 2001 From: RomanBachaloSigmaSoftware <77355790+RomanBachaloSigmaSoftware@users.noreply.github.com> Date: Thu, 28 Mar 2024 00:17:51 +0200 Subject: [PATCH] Enforce signer visibility (#155) * add enforce_signer_visibility & fix search for esign --- Gemfile.lock | 9 +++++++ app/assets/javascripts/search.js | 2 +- .../admin_api/eg005_audit_users_service.rb | 4 ++-- .../eg040_set_document_visibility_service.rb | 1 + .../webforms/eg001_create_instance_service.rb | 24 +++++++++---------- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 832c8c5..71e12a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -138,6 +138,7 @@ GEM ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) ffi (1.15.5) + ffi (1.15.5-x64-mingw-ucrt) globalid (1.1.0) activesupport (>= 5.0) hashie (5.0.0) @@ -177,8 +178,12 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.9) + nokogiri (1.15.4-x64-mingw-ucrt) + racc (~> 1.4) nokogiri (1.15.4-x86_64-darwin) racc (~> 1.4) + nokogiri (1.15.4-x86_64-linux) + racc (~> 1.4) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) @@ -295,7 +300,9 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + sqlite3 (1.6.4-x64-mingw-ucrt) sqlite3 (1.6.4-x86_64-darwin) + sqlite3 (1.6.4-x86_64-linux) test-unit (3.6.1) power_assert thor (1.2.2) @@ -328,7 +335,9 @@ GEM zeitwerk (2.6.11) PLATFORMS + x64-mingw-ucrt x86_64-darwin-21 + x86_64-linux DEPENDENCIES bootsnap (~> 1.7.3) diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js index cdbd0e4..9668b39 100644 --- a/app/assets/javascripts/search.js +++ b/app/assets/javascripts/search.js @@ -140,7 +140,7 @@ const DS_SEARCH = (function () { case API_TYPES.MONITOR: return "meg"; case API_TYPES.ESIGNATURE: - return "eg"; + return "eeg"; case API_TYPES.CONNECT: return "cneg"; case API_TYPES.WEBFORMS: diff --git a/app/services/admin_api/eg005_audit_users_service.rb b/app/services/admin_api/eg005_audit_users_service.rb index f9c8b07..c2a612e 100644 --- a/app/services/admin_api/eg005_audit_users_service.rb +++ b/app/services/admin_api/eg005_audit_users_service.rb @@ -28,8 +28,8 @@ def worker #ds-snippet-start:Admin5Step5 results = [] modified_users.each do |user| - #ds-snippet-end:Admin5Step5 - #ds-snippet-start:Admin5Step4 + #ds-snippet-end:Admin5Step5 + #ds-snippet-start:Admin5Step4 userProfilesOptions = DocuSign_Admin::GetUserProfilesOptions.new userProfilesOptions.email = user['email'] #ds-snippet-end:Admin5Step4 diff --git a/app/services/e_sign/eg040_set_document_visibility_service.rb b/app/services/e_sign/eg040_set_document_visibility_service.rb index 905cb87..db601ca 100644 --- a/app/services/e_sign/eg040_set_document_visibility_service.rb +++ b/app/services/e_sign/eg040_set_document_visibility_service.rb @@ -43,6 +43,7 @@ def make_envelope(envelope_args) envelope_definition = DocuSign_eSign::EnvelopeDefinition.new envelope_definition.email_subject = 'Please sign this document set' + envelope_definition.enforce_signer_visibility = 'true' # Add the documents doc1_b64 = Base64.encode64(create_document1(envelope_args)) diff --git a/app/services/webforms/eg001_create_instance_service.rb b/app/services/webforms/eg001_create_instance_service.rb index c904568..3114d3a 100644 --- a/app/services/webforms/eg001_create_instance_service.rb +++ b/app/services/webforms/eg001_create_instance_service.rb @@ -58,10 +58,10 @@ def create_web_form_instance(form_id) 'JobTitle' => 'Programmer Writer' } web_form_req_object = DocuSign_WebForms::CreateInstanceRequestBody.new({ - 'clientUserId' => args[:client_user_id], - 'formValues' => web_form_values, - 'expirationOffset' => '3600' - }) + 'clientUserId' => args[:client_user_id], + 'formValues' => web_form_values, + 'expirationOffset' => '3600' + }) #ds-snippet-end:WebForms1Step4 #ds-snippet-start:WebForms1Step5 @@ -79,18 +79,18 @@ def make_web_forms_template # Create the document model document = DocuSign_eSign::Document.new({ - # Create the DocuSign document object - 'documentBase64' => base64_file_content, - 'name' => 'World_Wide_Web_Form', # Can be different from actual file name - 'fileExtension' => 'pdf', # Many different document types are accepted - 'documentId' => '1' # A label used to reference the doc - }) + # Create the DocuSign document object + 'documentBase64' => base64_file_content, + 'name' => 'World_Wide_Web_Form', # Can be different from actual file name + 'fileExtension' => 'pdf', # Many different document types are accepted + 'documentId' => '1' # A label used to reference the doc + }) # Create the signer recipient model # Since these are role definitions, no name/email: signer = DocuSign_eSign::Signer.new({ - 'roleName' => 'signer', 'recipientId' => '1', 'routingOrder' => '1' - }) + 'roleName' => 'signer', 'recipientId' => '1', 'routingOrder' => '1' + }) # Create fields using absolute positioning # Create a sign_here tab (field on the document) sign_here = DocuSign_eSign::SignHere.new(