Skip to content

Commit 68e1249

Browse files
yida-tongyid13368patrickarlt
authored
feat(arcgis-rest-developer-credentials): Initial package release
* feat(arcgis-rest-developer-credentials): complete apikey add task * fix(arcgis-rest-developer-credentials): add privilege validation check and implement oauth in demo * fix(arcgis-rest-developer-credentials): online/Enterprise url; simplify createApiKey() interface * feat(arcgis-rest-developer-credentials): get and update api key * fix(arcgis-rest-developer-credentials): export some interfaces in index.ts * feat(arcgis-rest-developer-credentials): get/update api key and their demos * chore: changes from review * chore: changes from review * chore: basic test setup * chore: add files * chore: add test files * fix(arcgis-rest-developer-credentials): perfect apikey management implementation after code review * feat(arcgis-rest-developer-credentials): complete apikey implementation and test * fix(arcgis-rest-developer-credentials): revert create ts * fix: refactor to remove deep copy * chore: finish fixing tests * fix(arcgis-rest-developer-credentials): final improvement and add documentation * fix(arcgis-rest-developer-credentials): reflect PR change request * fix(arcgis-rest-developer-credentials): typo * fix(arcgis-rest-developer-credentials): add demo README * fix(arcgis-rest-developer-credentials): resolve PR issue * feat(arcgis-rest-developer-credentials): oAuth app suite * fix(arcgis-rest-developer-credentials): typo * fix(arcgis-rest-developer-credentials): remove unnecessary question mark * fix(arcgis-rest-developer-credentials): solve PR issue --------- Co-authored-by: yid13368 <[email protected]> Co-authored-by: Patrick Arlt <[email protected]>
1 parent 98ae8ef commit 68e1249

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6069
-126
lines changed
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/app.js
2+
/oAuthApp.js
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Client Web Demo for Developer Credential Package
2+
3+
This page will show API key and OAuth 2.0 app CRUD demo with help of `arcgis-rest-developer-credentials` package. First
4+
step requires a user to log in
5+
via [Authenticate with an ArcGIS identity](https://developers.arcgis.com/arcgis-rest-js/authentication/tutorials/authenticate-with-an-arcgis-identity-rest-js-browser/).
6+
Then you can use the form to create an API key or switch to the OAuth 2.0 form to create an OAuth 2.0 app.
7+
Once you've created an API key or OAuth 2.0 app, you can click on the item in the table below the form to edit it.
8+
9+
## Running this demo
10+
11+
1. Run `npm run build` in the repository's root directory.
12+
2. Go into `demos/dev-credentials-client` and run `npm start` to spin up the development server.
13+
3. Visit [http://localhost:8080](http://localhost:8080).
14+
15+
## Additional tools used
16+
17+
<table>
18+
<tr>
19+
<th>Description</th>
20+
<th>Tool</th>
21+
</tr>
22+
<tr>
23+
<td>Enhanced Multi-Select</td>
24+
<td><a href="https://select2.org/">Select2</a></td>
25+
</tr>
26+
<tr>
27+
<td>Table</td>
28+
<td><a href="https://datatables.net/">jQuery Data Table</a></td>
29+
</tr>
30+
<tr>
31+
<td>Others</td>
32+
<td>jQuery 3, Bootstrap 5</td>
33+
</tr>
34+
</table>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>dev-credentials client</title>
7+
<!-- bootstrap-->
8+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
9+
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
10+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
11+
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"
12+
crossorigin="anonymous"></script>
13+
<!-- jQuery-->
14+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
15+
<!-- select2-->
16+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet"/>
17+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
18+
<!-- datatable-->
19+
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet"/>
20+
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
21+
</head>
22+
<body>
23+
<div id="content" class="container" style="display: none">
24+
<button id="signOut" type="button" class="btn btn-primary mt-3">sign out</button>
25+
<a href="oAuthAppManagement.html" class="btn btn-primary mt-3">
26+
To OAuth2.0
27+
</a>
28+
<form id="form" novalidate>
29+
<div class="card mt-4">
30+
<h5 class="card-header">Create/Edit Key</h5>
31+
<div class="card-body">
32+
<h5 id="pageTitle" class="card-title"></h5>
33+
<div class="mb-3">
34+
<label for="privileges" class="form-label">Privileges</label>
35+
<select class="form-select" id="privileges" multiple="multiple"></select>
36+
</div>
37+
<div class="mb-3">
38+
<label for="httpreferrer" class="form-label">Http Referrers</label>
39+
<select class="form-select" id="httpreferrer" multiple="multiple"></select>
40+
</div>
41+
<div class="row mb-3" id="titleAndDesc">
42+
<div class="col-md-6">
43+
<label for="title" class="form-label">Title</label>
44+
<input type="text" class="form-control" id="title" required>
45+
<div class="invalid-feedback">
46+
Please provide a non-empty title.
47+
</div>
48+
</div>
49+
<div class="col-md-6">
50+
<label for="desc" class="form-label">Description</label>
51+
<input type="text" class="form-control" id="desc">
52+
</div>
53+
</div>
54+
<button id="createKey" type="submit" class="btn btn-primary">Create</button>
55+
<button id="deleteButton" type="button" class="btn btn-danger" style="display: none">Delete</button>
56+
</div>
57+
</div>
58+
</form>
59+
60+
<div class="card mt-4">
61+
<h5 class="card-header" id="selectedKey">Selected: </h5>
62+
<div class="card-body" style="overflow-x:auto;">
63+
<table id="datatable" class="display" style="width:100%">
64+
<thead>
65+
<tr>
66+
<th>Item Id</th>
67+
<th>Title</th>
68+
</tr>
69+
</thead>
70+
</table>
71+
</div>
72+
</div>
73+
74+
<div class="card mt-4">
75+
<h5 class="card-header">Details</h5>
76+
<div class="card-body">
77+
<p class="card-text"></p>
78+
</div>
79+
</div>
80+
</div>
81+
82+
<script type="importmap">
83+
{
84+
"imports": {
85+
"@esri/arcgis-rest-request": "/@esri/arcgis-rest-request/dist/bundled/request.esm.js",
86+
"@esri/arcgis-rest-portal": "/@esri/arcgis-rest-portal/dist/bundled/portal.esm.js",
87+
"@esri/arcgis-rest-developer-credentials": "/@esri/arcgis-rest-developer-credentials/dist/bundled/developer-credentials.esm.js"
88+
}
89+
}
90+
91+
92+
</script>
93+
<script src="app.js" type="module"></script>
94+
</body>
95+
</html>

0 commit comments

Comments
 (0)