@oneidentity/safeguard 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/package.json +4 -3
- package/src/README.md +67 -0
package/README.md
CHANGED
|
@@ -11,7 +11,9 @@ One Identity Safeguard JavaScript SDK
|
|
|
11
11
|
|
|
12
12
|
## Support
|
|
13
13
|
|
|
14
|
-
One Identity open source projects are supported through [One Identity GitHub issues](https://github.com/OneIdentity/safeguard.js/issues) and the [One Identity Community](https://www.oneidentity.com/community/). This includes all scripts, plugins, SDKs, modules, code snippets or other solutions. For assistance with any One Identity GitHub project, please raise a new Issue on the [One Identity GitHub project](https://github.com/OneIdentity/safeguard.js/issues) page. You may also visit the [One Identity Community](https://www.oneidentity.com/community/) to ask questions. Requests for assistance made through official One Identity Support will be referred back to GitHub and the One Identity Community forums where those requests can benefit all users.
|
|
14
|
+
One Identity open source projects are supported through [One Identity GitHub issues](https://github.com/OneIdentity/safeguard.js/issues) and the [One Identity Community](https://www.oneidentity.com/community/). This includes all scripts, plugins, SDKs, modules, code snippets or other solutions. For assistance with any One Identity GitHub project, please raise a new Issue on the [One Identity GitHub project](https://github.com/OneIdentity/safeguard.js/issues) page. You may also visit the [One Identity Community](https://www.oneidentity.com/community/) to ask questions. Requests for assistance made through official One Identity Support will be referred back to GitHub and the One Identity Community forums where those requests can benefit all users.
|
|
15
|
+
|
|
16
|
+
If you would like to add to safeguard.js? See the [developer guide](https://github.com/OneIdentity/safeguard.js/blob/master/src/README.md).
|
|
15
17
|
|
|
16
18
|
## Introduction
|
|
17
19
|
|
|
@@ -274,4 +276,4 @@ SafeguardJs.connectRsts('safeguard.sample.corp', `${window.location.protocol}//$
|
|
|
274
276
|
connection.invoke(SafeguardJs.Services.CORE, SafeguardJs.HttpMethods.PUT, `v3/Users/${newUser.Id}/Password`, `"${password}"`);
|
|
275
277
|
});
|
|
276
278
|
});
|
|
277
|
-
```
|
|
279
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneidentity/safeguard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "One Identity Safeguard JavaScript SDK",
|
|
5
5
|
"main": "src/safeguard.js",
|
|
6
6
|
"browser": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"Privileged",
|
|
26
26
|
"Passwords"
|
|
27
27
|
],
|
|
28
|
-
"author": "
|
|
28
|
+
"author": "Safeguard DevOps <safeguard-devops@groups.quest.com> (https://www.oneidentity.com/products/one-identity-safeguard-for-privileged-passwords/)",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/OneIdentity/safeguard.js/issues"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"browserify": "^17.0.0",
|
|
41
|
-
"mocha": "^8.3.2"
|
|
41
|
+
"mocha": "^8.3.2",
|
|
42
|
+
"uglify-js": "^3.17.3"
|
|
42
43
|
}
|
|
43
44
|
}
|
package/src/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# safeguard-js Developer Guide
|
|
2
|
+
JavaScript development can be done many ways, this is just one way with Visual Studio Code.
|
|
3
|
+
|
|
4
|
+
### Requirements
|
|
5
|
+
* Install [Visual Studio Code](https://code.visualstudio.com/download)
|
|
6
|
+
|
|
7
|
+
* Install [Node.js](https://nodejs.org/en/)
|
|
8
|
+
|
|
9
|
+
* Clone this repository
|
|
10
|
+
|
|
11
|
+
### Build
|
|
12
|
+
* Start Visual Studio Code
|
|
13
|
+
* Open root folder of safeguard-js.
|
|
14
|
+
* Open a New Terminal and execute the following.
|
|
15
|
+
```
|
|
16
|
+
npm run build
|
|
17
|
+
```
|
|
18
|
+
Running the build script does a few things for the Browser samples, but is not needed for Node.JS samples.
|
|
19
|
+
* Runs browserify on `.../src/safeguard.js` output `.../src/safeguardWeb.js`
|
|
20
|
+
* Runs uglifyjs on `.../src/safeguardWeb.js` output `.../src/safeguard.min.js`
|
|
21
|
+
* Runs uglifyjs on `.../src/safeguardJsAccessTokenChecker.js` output `.../src/safeguardJsAccessTokenChecker.min.js`
|
|
22
|
+
* Removes `.../src/safeguardWeb.js`
|
|
23
|
+
* Copies `.../src/safeguard.min.js` and `.../src/safeguardJsAccessTokenChecker.min.js` to all the Browser samples.
|
|
24
|
+
|
|
25
|
+
### Test
|
|
26
|
+
* From a Terminal excute the following
|
|
27
|
+
```
|
|
28
|
+
npm test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Samples
|
|
32
|
+
* Node.JS
|
|
33
|
+
|
|
34
|
+
To run any of the Node.JS samples you will need to fill in any of the missing values the scripts need.
|
|
35
|
+
For example `.../samples/Node.JS/passwordExample.js` you will need to fill in caFile, hostname, userName and password.
|
|
36
|
+
```
|
|
37
|
+
// The trusted root ca of the appliance
|
|
38
|
+
const caFile = '';
|
|
39
|
+
|
|
40
|
+
// The appliance host name or IP address
|
|
41
|
+
const hostName = '';
|
|
42
|
+
|
|
43
|
+
// The user name for password authentication
|
|
44
|
+
const userName = '';
|
|
45
|
+
|
|
46
|
+
// The password for password authentication
|
|
47
|
+
const password = '';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Once those values you are filled in you can run the example from a JavaScript Debug Terminal.
|
|
51
|
+
```
|
|
52
|
+
node .\passwordExample.ja
|
|
53
|
+
```
|
|
54
|
+
Running the script in the JavasScript Debug Terminal will allow you to debug the js file, setting breakpoints, etc.
|
|
55
|
+
|
|
56
|
+
* Browser
|
|
57
|
+
|
|
58
|
+
To run any of the Browser samples you will need to serve the pages from a web server. There are many ways to do this but this is one way through Visual Studio Code.
|
|
59
|
+
|
|
60
|
+
* Generate your own self signed certificates. For example if you have openssl setup you can execute a command like the following
|
|
61
|
+
```
|
|
62
|
+
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
|
|
63
|
+
```
|
|
64
|
+
* Install the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) Visual Studio Code extension
|
|
65
|
+
* Add the `cert.pem` and `key.pem` files to the Liver Server extension settings Https section.
|
|
66
|
+
* Start Live Server by clicking on the `Go Live` link in the bottom right corner of Visual Studio Code.
|
|
67
|
+
* Navigate to any of the Browser samples from the launched web page.
|