Skip to content

Commit e8c2457

Browse files
committed
Added scopes
1 parent 66a3cf7 commit e8c2457

File tree

8 files changed

+104
-8
lines changed

8 files changed

+104
-8
lines changed

JWTAuth.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public static OAuthToken AuthenticateWithJwt(string api, string clientId, string
5050
});
5151
}
5252

53+
if (apiType == ExamplesApiType.Maestro)
54+
{
55+
scopes.AddRange(new List<string>
56+
{
57+
"aow_manage",
58+
});
59+
}
60+
5361
if (apiType == ExamplesApiType.Monitor)
5462
{
5563
scopes.AddRange(new List<string>

launcher-csharp/Common/RequestItemsService.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ public class RequestItemsService : IRequestItemsService
2323

2424
private static Guid? organizationId;
2525

26-
#nullable enable
26+
#nullable enable
2727
private static string? authenticatedUserEmail;
28-
#nullable disable
28+
#nullable disable
2929

3030
private readonly IHttpContextAccessor httpContextAccessor;
3131

3232
private readonly IMemoryCache cache;
3333

34-
#nullable enable
34+
#nullable enable
3535
private readonly string? id;
36-
#nullable disable
36+
#nullable disable
3737

3838
private OAuthToken authToken;
3939

@@ -54,27 +54,27 @@ public RequestItemsService(IHttpContextAccessor httpContextAccessor, IMemoryCach
5454

5555
public IConfiguration Configuration { get; set; }
5656

57-
#nullable enable
57+
#nullable enable
5858
public string? EgName
5959
{
6060
get => this.cache.Get<string>(this.GetKey("EgName"));
6161
set => this.cache.Set(this.GetKey("EgName"), value);
6262
}
63-
#nullable disable
63+
#nullable disable
6464

6565
public Session Session
6666
{
6767
get => this.cache.Get<Session>(this.GetKey("Session"));
6868
set => this.cache.Set(this.GetKey("Session"), value);
6969
}
7070

71-
#nullable enable
71+
#nullable enable
7272
public User? User
7373
{
7474
get => this.cache.Get<User>(this.GetKey("User"));
7575
set => this.cache.Set(this.GetKey("User"), value);
7676
}
77-
#nullable disable
77+
#nullable disable
7878

7979
public Guid? OrganizationId
8080
{
@@ -305,6 +305,10 @@ public string IdentifyApiOfCodeExample(string eg)
305305
{
306306
currentApiType = ExamplesApiType.Navigator.ToString();
307307
}
308+
else if (eg.Contains(ExamplesApiType.Maestro.ToKeywordString()))
309+
{
310+
currentApiType = ExamplesApiType.Maestro.ToString();
311+
}
308312
else
309313
{
310314
currentApiType = ExamplesApiType.ESignature.ToString();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h2>@ViewBag.h1</h2>
2+
<p>@Html.Raw(ViewBag.message)</p>
3+
4+
<iframe width="900" height="600" src="@ViewBag.Url">
5+
6+
</iframe>
7+
8+
9+
<p><a href="/">@Html.Raw(ViewBag.SupportingTexts.ContinueButton)</a></p>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<h4>@Html.Raw(ViewBag.CodeExampleText.ExampleName)</h4>
2+
3+
<p>
4+
@Html.Raw(ViewBag.CodeExampleText.ExampleDescription)
5+
</p>
6+
<p>
7+
8+
API method used:
9+
<a target='_blank'
10+
href="@ViewBag.CodeExampleText.LinksToApiMethod[0].Path">@ViewBag.CodeExampleText.LinksToApiMethod[0].PathName</a>
11+
</p>
12+
13+
<p>
14+
@Html.Raw(
15+
@String.Format(
16+
ViewBag.SupportingTexts.ViewSourceFile,
17+
"<a target='_blank' href=" + @ViewBag.source + ">TriggerWorkflow.cs</a>"
18+
)
19+
)
20+
</p>
21+
22+
<form class="eg" action="" method="post" data-busy="form">
23+
<div class="form-group">
24+
<label for="instanceName">
25+
@Html.Raw(ViewBag.CodeExampleText.Forms[0].Inputs[0].InputName)
26+
</label>
27+
<input type="text" class="form-control" id="instanceName" name="instanceName"
28+
placeholder="@ViewBag.CodeExampleText.Forms[0].Inputs[0].InputPlaceholder" required>
29+
</div>
30+
<div class="form-group">
31+
<label for="signerEmail">
32+
@Html.Raw(ViewBag.CodeExampleText.Forms[0].Inputs[1].InputName)
33+
</label>
34+
<input type="email" class="form-control" id="signerEmail" name="signerEmail" aria-describedby="emailHelp"
35+
value="@ViewBag.Locals.DsConfig.SignerEmail"
36+
placeholder="@ViewBag.CodeExampleText.Forms[0].Inputs[1].InputPlaceholder" required>
37+
<small id="emailHelp"
38+
class="form-text text-muted">@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)</small>
39+
</div>
40+
<div class="form-group">
41+
<label for="signerName">
42+
@Html.Raw(ViewBag.CodeExampleText.Forms[0].Inputs[2].InputName)
43+
</label>
44+
<input type="text" class="form-control" id="signerName" name="signerName"
45+
value="@ViewBag.Locals.DsConfig.SignerName"
46+
placeholder="@ViewBag.CodeExampleText.Forms[0].Inputs[2].InputPlaceholder" required>
47+
</div>
48+
<div class="form-group">
49+
<label for="ccEmail">
50+
@Html.Raw(ViewBag.CodeExampleText.Forms[0].Inputs[3].InputName)
51+
</label>
52+
<input type="email" class="form-control" id="ccEmail" name="ccEmail" aria-describedby="emailHelp"
53+
placeholder="@ViewBag.CodeExampleText.Forms[0].Inputs[3].InputPlaceholder" required>
54+
<small id="emailHelp"
55+
class="form-text text-muted">@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.CcEmailShouldDifferFromSigner)</small>
56+
</div>
57+
<div class="form-group">
58+
<label for="ccName">
59+
@Html.Raw(ViewBag.CodeExampleText.Forms[0].Inputs[4].InputName)
60+
</label>
61+
<input type="text" class="form-control" id="ccName" name="ccName"
62+
placeholder="@ViewBag.CodeExampleText.Forms[0].Inputs[4].InputPlaceholder" required>
63+
</div>
64+
<button type="submit" class="btn btn-primary">@Html.Raw(ViewBag.SupportingTexts.SubmitButton)</button>
65+
</form>

launcher-csharp/Startup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public Startup(IConfiguration configuration)
5656
"room_forms",
5757
});
5858

59+
this.apiTypes.Add(ExamplesApiType.Maestro, new List<string> { "signature", "aow_manage" });
60+
5961
this.apiTypes.Add(ExamplesApiType.Click, new List<string>
6062
{
6163
"click.manage",

launcher-csharp/Views/Home/Index.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
: ((ApIs) api).Name.ToLower() == ExamplesApiType.Rooms.ToString().ToLower() ? ExamplesApiType.Rooms.ToKeywordString()
4343
: ((ApIs) api).Name.ToLower() == ExamplesApiType.Connect.ToString().ToLower() ? ExamplesApiType.Connect.ToKeywordString()
4444
: ((ApIs) api).Name.ToLower() == ExamplesApiType.WebForms.ToString().ToLower() ? ExamplesApiType.WebForms.ToKeywordString()
45+
: ((ApIs) api).Name.ToLower() == ExamplesApiType.Maestro.ToString().ToLower() ? ExamplesApiType.Maestro.ToKeywordString()
4546
: ((ApIs) api).Name.ToLower() == ExamplesApiType.Notary.ToString().ToLower() ? ExamplesApiType.Notary.ToKeywordString()
4647
: ((ApIs) api).Name.ToLower() == ExamplesApiType.ConnectedFields.ToString().ToLower() ? ExamplesApiType.ConnectedFields.ToKeywordString()
4748
: ((ApIs) api).Name.ToLower() == ExamplesApiType.Navigator.ToString().ToLower() ? ExamplesApiType.Navigator.ToKeywordString()

launcher-csharp/eSignature/Controllers/AccountController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ private string BuildConsentUrl()
126126
{
127127
scopes += " adm_store_unified_repo_read";
128128
}
129+
else if (apiType == ExamplesApiType.Maestro)
130+
{
131+
scopes += " aow_manage";
132+
}
129133
else if (apiType == ExamplesApiType.Navigator)
130134
{
131135
scopes += " adm_store_unified_repo_read";

launcher-csharp/wwwroot/js/search.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
CONNECT: 'connect',
99
WEBFORMS: 'webforms',
1010
NOTARY: 'notary',
11+
MAESTRO: 'maestro',
1112
CONNECTEDFIELDS: 'connectedfields',
1213
NAVIGATOR: 'navigator',
1314
};
@@ -129,6 +130,8 @@
129130
return "eg";
130131
case API_TYPES.CONNECT:
131132
return "con";
133+
case API_TYPES.MAESTRO:
134+
return "mae";
132135
case API_TYPES.WEBFORMS:
133136
return "web";
134137
case API_TYPES.NOTARY:

0 commit comments

Comments
 (0)