Skip to content

Commit 14465c1

Browse files
committed
Merged master
2 parents 5b1868c + 53bb735 commit 14465c1

32 files changed

+3929
-2439
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,5 @@ __pycache__/
263263
#configuration files (secrets), should not be checked in to source control
264264
appsettings.json
265265
private.key
266-
app.config
266+
app.config
267+
web-form-config.json

ExamplesAPIType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ public enum ExamplesApiType
4343
/// </summary>
4444
[Description("con")]
4545
Connect = 5,
46+
47+
/// <summary>
48+
/// Web Forms API
49+
/// </summary>
50+
[Description("web")]
51+
WebForms = 6,
4652
}
4753

4854
public static class ExamplesApiTypeExtensions

JWTAuth.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ public static OAuthToken AuthenticateWithJwt(string api, string clientId, string
7878
});
7979
}
8080

81+
if (apiType == ExamplesApiType.WebForms)
82+
{
83+
scopes.Add("webforms_read");
84+
scopes.Add("webforms_instance_write");
85+
scopes.Add("webforms_instance_read");
86+
}
87+
8188
return docuSignClient.RequestJWTUserToken(
8289
clientId,
8390
impersonatedUserId,

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ For information about the scopes used for obtaining authorization to use the Adm
5454
For a list of code examples that use the Admin API, see the [How-to guides overview](https://developers.docusign.com/docs/admin-api/how-to/) on the DocuSign Developer Center.
5555

5656

57+
## Web Forms API
58+
59+
The Web Forms API is available in all developer accounts, but only in certain production account plans. Contact [DocuSign Support](https://support.docusign.com/) or your account manager to find out whether the Web Forms API is available for your production account plan.
60+
61+
For more information about the scopes used for obtaining authorization to use the Rooms API, see [Required scopes](https://developers.docusign.com/docs/web-forms-api/plan-integration/authentication/).
62+
63+
For a list of code examples that use the Web Forms API, see the [How-to guides overview](https://developers.docusign.com/docs/web-forms-api/how-to/) on the DocuSign Developer Center.
64+
65+
5766
## Installation
5867

5968
### Prerequisites

azure-pipelines.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
resources:
6+
repositories:
7+
- repository: launcher-automation
8+
type: github
9+
name: docusign/launcher-automation
10+
ref: main
11+
endpoint: launcherAutomationServiceConnection
12+
13+
pr:
14+
- master
15+
- releases/*
16+
17+
pool:
18+
name: launcher-automation-pool
19+
20+
steps:
21+
- script: echo Hello, world!
22+
displayName: 'Run a one-line script'
23+
- checkout: self
24+
- checkout: launcher-automation
25+
26+
- script: dir $(Build.SourcesDirectory)
27+
28+
- task: DownloadSecureFile@1
29+
name: csharp_dockerfile
30+
displayName: 'download Dockerfile'
31+
inputs:
32+
secureFile: 'csharp.Dockerfile'
33+
34+
- script: |
35+
echo "place csharp.Dockerfile"
36+
echo $(csharp_dockerfile.secureFilePath)
37+
cp $(csharp_Dockerfile.secureFilePath) code-examples-csharp-private/Dockerfile
38+
displayName: 'place Dockerfile'
39+
40+
- script: |
41+
allure –-version
42+
java --version
43+
javac --version
44+
mvn --version
45+
docker --version
46+
47+
- task: DownloadSecureFile@1
48+
name: csharp_config_properties
49+
displayName: 'download config.properties'
50+
inputs:
51+
secureFile: 'csharp.config.properties'
52+
53+
54+
- script: |
55+
echo "place config.properties"
56+
echo $(csharp_config_properties.secureFilePath)
57+
cp $(csharp_config_properties.secureFilePath) launcher-automation/src/main/resources/config.properties
58+
displayName: 'place config.properties'
59+
60+
- task: DownloadSecureFile@1
61+
name: csharp_appsettings
62+
displayName: 'download appsettings.json'
63+
inputs:
64+
secureFile: 'csharp.appsettings.json'
65+
66+
67+
- script: |
68+
echo "place appsettings.json"
69+
cp $(csharp_appsettings.secureFilePath) code-examples-csharp-private/launcher-csharp/appsettings.json
70+
displayName: 'place appsettings.json'
71+
72+
73+
- task: DownloadSecureFile@1
74+
name: csharp_private_key
75+
displayName: 'download private.key'
76+
inputs:
77+
secureFile: 'private.key'
78+
79+
80+
- script: |
81+
echo "place private.key"
82+
cp $(csharp_private_key.secureFilePath) code-examples-csharp-private/launcher-csharp/private.key
83+
displayName: 'place private.key'
84+
85+
- script: dir $(Build.SourcesDirectory)
86+
87+
- script: dir $(Build.SourcesDirectory)/code-examples-csharp-private
88+
89+
- task: Docker@2
90+
displayName: Build csharp image
91+
inputs:
92+
command: build
93+
repository: 'launcher-automation-csharp'
94+
dockerfile: '$(Build.SourcesDirectory)/code-examples-csharp-private/Dockerfile'
95+
buildContext: '$(Build.SourcesDirectory)/code-examples-csharp-private '
96+
tags: |
97+
latest
98+
99+
- script: |
100+
docker run -p 44333:44333 -d launcher-automation-csharp:latest
101+
displayName: 'start csharp app'
102+
103+
- script: |
104+
cd launcher-automation
105+
mvn clean test -DsuiteXmlFile="csharp_suite.xml"
106+
displayName: 'C# app tests'
107+
108+
- script: |
109+
docker stop $(docker ps -a -q)
110+
docker rm $(docker ps -a -q)
111+
displayName: 'stop csharp app'
112+
113+
- script: |
114+
allure generate --clean --output $(Build.SourcesDirectory)/csharp-allure-output '$(Build.SourcesDirectory)/launcher-automation/target/allure-results'
115+
displayName: generate allure html reports
116+
117+
- task: PublishAllureReport@1
118+
displayName: 'Publish Allure Report'
119+
inputs:
120+
reportDir: '$(Build.SourcesDirectory)/csharp-allure-output'

launcher-csharp.Tests/JwtLoginMethodUnitTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ private string BuildConsentUrl(ExamplesApiType apiType, TestConfig testConfig)
9292
scopes += "%20user_read%20user_write%20organization_read%20account_read%20group_read%20"
9393
+ "permission_read%20identity_provider_read%20domain_read%20user_data_redact%20"
9494
+ "asset_group_account_read%20asset_group_account_clone_write%20asset_group_account_clone_read";
95+
} else if (apiType == ExamplesApiType.WebForms)
96+
{
97+
scopes += "%20webforms_manage";
9598
}
9699

97100
string caret = "";

launcher-csharp/Common/IRequestItemsService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public interface IRequestItemsService
3434

3535
public string TemplateId { get; set; }
3636

37+
public string WebFormsTemplateId { get; set; }
38+
3739
public string WorkflowId { get; set; }
3840

3941
public bool IsWorkflowPublished { get; set; }

launcher-csharp/Common/LocalsFilter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public void OnActionExecuting(ActionExecutingContext context)
9898
RoomsApiBasePath = this.configuration["DocuSign:RoomsApiEndpoint"],
9999
AdminApiBasePath = this.configuration["DocuSign:AdminApiEndpoint"],
100100
MaestroApiBasePath = this.configuration["DocuSign:MaestroApiEndpoint"],
101+
WebFormsBasePath = this.configuration["DocuSign:WebFormsBasePath"],
101102
}
102103
:
103104
new Session
@@ -108,6 +109,7 @@ public void OnActionExecuting(ActionExecutingContext context)
108109
RoomsApiBasePath = this.configuration["DocuSign:RoomsApiEndpoint"],
109110
AdminApiBasePath = this.configuration["DocuSign:AdminApiEndpoint"],
110111
MaestroApiBasePath = this.configuration["DocuSign:MaestroApiEndpoint"],
112+
WebFormsBasePath = this.configuration["DocuSign:WebFormsBasePath"],
111113
};
112114

113115
this.requestItemsService.Session = locals.Session;

launcher-csharp/Common/RequestItemsService.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ public string InstanceId
166166
set => this.cache.Set(this.GetKey("InstanceId"), value);
167167
}
168168

169+
public string WebFormsTemplateId
170+
{
171+
get => this.cache.Get<string>(this.GetKey("WebFormsTemplateId"));
172+
set => this.cache.Set(this.GetKey("WebFormsTemplateId"), value);
173+
}
174+
169175
public string ClickwrapId
170176
{
171177
get => this.cache.Get<string>(this.GetKey("ClickwrapId"));
@@ -224,6 +230,7 @@ public void UpdateUserFromJwt()
224230
BasePath = account.BaseUri,
225231
RoomsApiBasePath = this.Configuration["DocuSign:RoomsApiEndpoint"],
226232
AdminApiBasePath = this.Configuration["DocuSign:AdminApiEndpoint"],
233+
WebFormsBasePath = this.Configuration["DocuSign:WebFormsBasePath"],
227234
MaestroApiBasePath = this.Configuration["DocuSign:MaestroApiEndpoint"],
228235
};
229236
}
@@ -278,6 +285,10 @@ public string IdentifyApiOfCodeExample(string eg)
278285
{
279286
currentApiType = ExamplesApiType.Maestro.ToString();
280287
}
288+
else if (eg.Contains(ExamplesApiType.WebForms.ToKeywordString()))
289+
{
290+
currentApiType = ExamplesApiType.WebForms.ToString();
291+
}
281292
else
282293
{
283294
currentApiType = ExamplesApiType.ESignature.ToString();

launcher-csharp/Properties/launchSettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
"IIS Express": {
1212
"commandName": "IISExpress",
1313
"launchBrowser": true,
14+
"applicationUrl": "https://localhost:8080;http://localhost:5000",
1415
"environmentVariables": {
1516
"ASPNETCORE_ENVIRONMENT": "Development"
16-
},
17-
"applicationUrl": "https://localhost:8080;http://localhost:5000"
17+
}
1818
},
1919
"CodeExamples": {
2020
"commandName": "Project",
2121
"launchBrowser": true,
22+
"applicationUrl": "https://localhost:44333;http://localhost:5002",
2223
"environmentVariables": {
2324
"ASPNETCORE_ENVIRONMENT": "Development"
24-
},
25-
"applicationUrl": "https://localhost:44333;http://localhost:5002"
25+
}
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)