Skip to content

Commit 34a4b4f

Browse files
added cicd
1 parent ce5cd93 commit 34a4b4f

File tree

6 files changed

+68
-23
lines changed

6 files changed

+68
-23
lines changed

.github/workflows/ci-cd.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,25 @@ jobs:
4343
push: true
4444
tags: ${{ secrets.ACR_LOGIN_SERVER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
4545

46+
- name: Configure app settings
47+
run: |
48+
az webapp config appsettings set \
49+
--name ${{ env.AZURE_WEBAPP_NAME }} \
50+
--resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \
51+
--settings \
52+
"DocuSign__IntegrationKey=${{ secrets.DOCUSIGN_INTEGRATION_KEY }}" \
53+
"DocuSign__SecretKey=${{ secrets.DOCUSIGN_SECRET_KEY }}" \
54+
"DocuSign__SecretKeyProd=${{ secrets.DOCUSIGN_SECRET_KEY_PROD }}" \
55+
"DocuSign__RedirectBaseUrl=${{ secrets.DOCUSIGN_REDIRECT_BASE_URL }}" \
56+
"DocuSign__EventNotificationBaseUrl=${{ secrets.DOCUSIGN_EVENT_NOTIFICATION_BASE_URL }}" \
57+
"DocuSign__TestAccountConnectionSettings__UserId=${{ secrets.DOCUSIGN_USER_ID }}" \
58+
"DocuSign__TestAccountConnectionSettings__AccountId=${{ secrets.DOCUSIGN_ACCOUNT_ID }}" \
59+
"CustomerProfile__Login=${{ secrets.CUSTOMERPROFILE_LOGIN }}" \
60+
"CustomerProfile__Password=${{ secrets.CUSTOMERPROFILE_PASSWORD }}" \
61+
"DocuSign__RSAPrivateKeyFile=/app/private.key" \
62+
"DOCUSIGN_PRIVATE_KEY_BASE64=${{ secrets.DOCUSIGN_PRIVATE_KEY_BASE64 }}" \
63+
"DOCUSIGN_PRIVATE_KEY=${{ secrets.DOCUSIGN_PRIVATE_KEY }}"
64+
4665
- name: Restart Azure Web App
4766
run: |
48-
az webapp restart --name ${{ env.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}
67+
az webapp restart --name ${{ env.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}

DocuSign.Workspaces/DocuSign.Workspaces/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ BASH
2828
FROM base AS final
2929
WORKDIR /app
3030
COPY --from=build /app/publish .
31-
ENTRYPOINT ["dotnet", "DocuSign.Workspaces.dll"]
31+
COPY DocuSign.Workspaces/DocuSign.Workspaces/entrypoint.sh /app/entrypoint.sh
32+
RUN chmod +x /app/entrypoint.sh
33+
ENTRYPOINT ["/app/entrypoint.sh"]

DocuSign.Workspaces/DocuSign.Workspaces/Domain/Common/Services/AuthenticationService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public List<ResponseGetAccountsModel> GetAccounts(string basePath, string userId
6565
authServer,
6666
File.ReadAllBytes(_appConfiguration.DocuSign.RSAPrivateKeyFile),
6767
_appConfiguration.DocuSign.JWTLifeTime,
68-
new List<string> { "impersonation", "signature" });
68+
new List<string> { "signature" });
6969
}
7070
catch (ApiException ex)
7171
{
@@ -138,8 +138,8 @@ public ClaimsPrincipal AuthenticateFromJwt(AccountConnectionSettings accountConn
138138
public string CreateAdminConsentUrl(string baseUrl, string redirectUrl)
139139
{
140140
var integrationKey = _appConfiguration.DocuSign.IntegrationKey;
141-
var scope = "openid signature impersonation";
142-
var adminConsentScope = "signature impersonation";
141+
var scope = "openid signature";
142+
var adminConsentScope = "signature";
143143

144144
var fullRedirectUrl = $"{_appConfiguration.DocuSign.RedirectBaseUrl}/{redirectUrl}";
145145

@@ -150,7 +150,8 @@ public string CreateAdminConsentUrl(string baseUrl, string redirectUrl)
150150
public string CreateUserConsentUrl(string baseUrl, string redirectUrl)
151151
{
152152
var integrationKey = _appConfiguration.DocuSign.IntegrationKey;
153-
var scope = "signature impersonation";
153+
var scope = "signature dtr.company.read dtr.rooms.read dtr.rooms.write dtr.documents.write";
154+
//var scope = "signature impersonation";
154155
var fullRedirectUrl = $"{_appConfiguration.DocuSign.RedirectBaseUrl}/{redirectUrl}";
155156

156157
var builder = new UriBuilder($"{baseUrl}/oauth/auth?response_type=code&scope={scope}&client_id={integrationKey}&redirect_uri={fullRedirectUrl}");

DocuSign.Workspaces/DocuSign.Workspaces/Domain/Workspaces/WealthManagementClient.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,7 @@ private async Task<EnvelopeModel> UpdateEachEnvelopWithDocument(string envelopeI
138138

139139
var recipientIdentityVerification = new RecipientIdentityVerification
140140
{
141-
WorkflowId = workflowId,
142-
InputOptions =
143-
[
144-
new RecipientIdentityInputOption
145-
{
146-
Name = "phone_number_list",
147-
ValueType = "PhoneNumberList",
148-
PhoneNumberList =
149-
[
150-
new RecipientIdentityPhoneNumber
151-
{
152-
Number = "1115552222",
153-
CountryCode = "+1",
154-
}
155-
],
156-
}
157-
],
141+
WorkflowId = workflowId
158142
};
159143

160144
var recipients = new Recipients
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Warning"
5+
}
6+
},
7+
"AllowedHosts": "*",
8+
"DocuSign": {
9+
"IntegrationKey": "{DocuSign__IntegrationKey}",
10+
"SecretKey": "{DocuSign__SecretKey}",
11+
"SecretKeyProd": "{DocuSign__SecretKeyProd}",
12+
"RedirectBaseUrl": "{DocuSign__RedirectBaseUrl}",
13+
"EventNotificationBaseUrl": "{DocuSign__EventNotificationBaseUrl}",
14+
"RSAPrivateKeyFile": "{DocuSign__RSAPrivateKeyFile}",
15+
"JWTLifeTime": "1",
16+
"TestAccountConnectionSettings": {
17+
"BasePath": "https://account-d.docusign.com",
18+
"BaseUri": "https://demo.docusign.net",
19+
"UserId": "{DocuSign__TestAccountConnectionSettings__UserId}",
20+
"AccountId": "{DocuSign__TestAccountConnectionSettings__AccountId}"
21+
}
22+
},
23+
"CustomerProfile": {
24+
"Login": "{CustomerProfile__Login}",
25+
"Password": "{CustomerProfile__Password}"
26+
}
27+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ -n "${DOCUSIGN_PRIVATE_KEY_BASE64:-}" ]; then
5+
echo "$DOCUSIGN_PRIVATE_KEY_BASE64" | base64 -d > /app/private.key
6+
chmod 600 /app/private.key
7+
elif [ -n "${DOCUSIGN_PRIVATE_KEY:-}" ]; then
8+
printf "%s" "$DOCUSIGN_PRIVATE_KEY" > /app/private.key
9+
chmod 600 /app/private.key
10+
fi
11+
12+
exec dotnet DocuSign.Workspaces.dll

0 commit comments

Comments
 (0)