@signageos/cli 1.3.0 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.4.0] - 2023-09-25
8
+ ### Added
9
+ - Update readme
10
+ - Auth0 compatibility
11
+
12
+ ## [1.3.1] - 2023-08-29
13
+
7
14
  ## [1.3.0] - 2023-05-19
8
15
  ### Fixed
9
16
  - New version announcement has a link to the changelog
package/README.md CHANGED
@@ -29,6 +29,9 @@ npm run test-integration
29
29
  | --profile *(optional)* | Profile used for separation of credentials and other configurations set in the `~/.sosrc` file | ${SOS_PROFILE} |
30
30
 
31
31
  ### Login
32
+ #### Requirements
33
+ - Active account. It can be obtained by manual sign-up in [https://box.signageos.io](https://box.signageos.io)
34
+
32
35
  ```bash
33
36
  sos login
34
37
  ```
@@ -4,6 +4,19 @@ declare const OPTION_LIST: readonly [{
4
4
  readonly type: StringConstructor;
5
5
  readonly description: `Username or e-mail used for ${string}`;
6
6
  }];
7
+ /**
8
+ * To explicitly enable auth0 authentication add flag --auth0-enabled to command line options
9
+ * { _unknown: [ '--auth0-enabled' ], command: [ 'login' ] }
10
+ *
11
+ * To explicitly enable legacy authentication add flag --legacy-enabled to command line options
12
+ * { _unknown: [ '--legacy-enabled' ], command: [ 'login' ] }
13
+ *
14
+ * Only one from auth0 and legacy authentication can be active at the moment
15
+ */
16
+ export declare const getIsAuth0OrLegacyEnabled: (options: any) => {
17
+ isAuth0Enabled: boolean;
18
+ isLegacyEnabled: boolean;
19
+ };
7
20
  export declare const login: {
8
21
  name: "login";
9
22
  description: string;
@@ -36,22 +36,47 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.login = void 0;
39
+ exports.login = exports.getIsAuth0OrLegacyEnabled = void 0;
40
40
  var chalk_1 = require("chalk");
41
41
  var prompts = require("prompts");
42
42
  var Debug = require("debug");
43
43
  var os = require("os");
44
+ var apiVersions_1 = require("@signageos/sdk/dist/RestApi/apiVersions");
45
+ var log_1 = require("@signageos/sdk/dist/Console/log");
46
+ var sosControlHelper_1 = require("@signageos/sdk/dist/SosHelper/sosControlHelper");
44
47
  var helper_1 = require("../helper");
45
48
  var runControlHelper_1 = require("../RunControl/runControlHelper");
46
49
  var parameters_1 = require("../parameters");
47
50
  var commandDefinition_1 = require("../Command/commandDefinition");
48
- var apiVersions_1 = require("@signageos/sdk/dist/RestApi/apiVersions");
49
- var log_1 = require("@signageos/sdk/dist/Console/log");
50
- var sosControlHelper_1 = require("@signageos/sdk/dist/SosHelper/sosControlHelper");
51
51
  var debug = Debug('@signageos/cli:Auth:login');
52
- var OPTION_LIST = [
53
- { name: 'username', type: String, description: "Username or e-mail used for ".concat(parameters_1.parameters.boxHost) },
54
- ];
52
+ var OPTION_LIST = [{ name: 'username', type: String, description: "Username or e-mail used for ".concat(parameters_1.parameters.boxHost) }];
53
+ /**
54
+ * To explicitly enable auth0 authentication add flag --auth0-enabled to command line options
55
+ * { _unknown: [ '--auth0-enabled' ], command: [ 'login' ] }
56
+ *
57
+ * To explicitly enable legacy authentication add flag --legacy-enabled to command line options
58
+ * { _unknown: [ '--legacy-enabled' ], command: [ 'login' ] }
59
+ *
60
+ * Only one from auth0 and legacy authentication can be active at the moment
61
+ */
62
+ var getIsAuth0OrLegacyEnabled = function (options) {
63
+ var _a, _b;
64
+ var isAuth0Enabled = false;
65
+ var isLegacyEnabled = false;
66
+ // tslint:disable-next-line no-string-literal
67
+ if ((_a = options['_unknown']) === null || _a === void 0 ? void 0 : _a.includes('--auth0-enabled')) {
68
+ isAuth0Enabled = true;
69
+ }
70
+ // tslint:disable-next-line no-string-literal
71
+ if ((_b = options['_unknown']) === null || _b === void 0 ? void 0 : _b.includes('--legacy-enabled')) {
72
+ isLegacyEnabled = true;
73
+ }
74
+ if (isAuth0Enabled && isLegacyEnabled) {
75
+ throw new Error('Only one override from auth0 and legacy authentication options can be active at the moment.');
76
+ }
77
+ return { isAuth0Enabled: isAuth0Enabled, isLegacyEnabled: isLegacyEnabled };
78
+ };
79
+ exports.getIsAuth0OrLegacyEnabled = getIsAuth0OrLegacyEnabled;
55
80
  exports.login = (0, commandDefinition_1.createCommandDefinition)({
56
81
  name: 'login',
57
82
  description: 'Login account using username & password',
@@ -59,9 +84,9 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
59
84
  commands: [],
60
85
  run: function (options) {
61
86
  return __awaiter(this, void 0, void 0, function () {
62
- var identification, response, password, config, apiUrl, _a, tokenId, apiSecurityToken, name;
63
- return __generator(this, function (_b) {
64
- switch (_b.label) {
87
+ var identification, response, password, config, apiUrl, _a, isAuth0Enabled, isLegacyEnabled, _b, tokenId, apiSecurityToken, name;
88
+ return __generator(this, function (_c) {
89
+ switch (_c.label) {
65
90
  case 0:
66
91
  identification = options.username;
67
92
  if (!!identification) return [3 /*break*/, 2];
@@ -71,9 +96,9 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
71
96
  message: "Type your username or e-mail used for ".concat(parameters_1.parameters.boxHost),
72
97
  })];
73
98
  case 1:
74
- response = _b.sent();
99
+ response = _c.sent();
75
100
  identification = response.username;
76
- _b.label = 2;
101
+ _c.label = 2;
77
102
  case 2:
78
103
  if (!identification) {
79
104
  throw new Error('Missing argument --username <string>');
@@ -84,21 +109,28 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
84
109
  message: "Type your password used for ".concat(parameters_1.parameters.boxHost),
85
110
  })];
86
111
  case 3:
87
- password = (_b.sent()).password;
112
+ password = (_c.sent()).password;
88
113
  return [4 /*yield*/, (0, runControlHelper_1.loadConfig)()];
89
114
  case 4:
90
- config = _b.sent();
115
+ config = _c.sent();
91
116
  apiUrl = (0, helper_1.getApiUrl)(config);
92
- return [4 /*yield*/, getOrCreateApiSecurityToken(identification, password, apiUrl)];
117
+ _a = (0, exports.getIsAuth0OrLegacyEnabled)(options), isAuth0Enabled = _a.isAuth0Enabled, isLegacyEnabled = _a.isLegacyEnabled;
118
+ return [4 /*yield*/, getOrCreateApiSecurityToken({
119
+ identification: identification,
120
+ password: password,
121
+ apiUrl: apiUrl,
122
+ isAuth0Enabled: isAuth0Enabled,
123
+ isLegacyEnabled: isLegacyEnabled,
124
+ })];
93
125
  case 5:
94
- _a = _b.sent(), tokenId = _a.id, apiSecurityToken = _a.securityToken, name = _a.name;
126
+ _b = _c.sent(), tokenId = _b.id, apiSecurityToken = _b.securityToken, name = _b.name;
95
127
  return [4 /*yield*/, (0, runControlHelper_1.saveConfig)({
96
128
  apiUrl: apiUrl !== parameters_1.parameters.apiUrl ? apiUrl : undefined,
97
129
  identification: tokenId,
98
130
  apiSecurityToken: apiSecurityToken,
99
131
  })];
100
132
  case 6:
101
- _b.sent();
133
+ _c.sent();
102
134
  (0, log_1.log)('info', "User ".concat(chalk_1.default.green(identification), " has been logged in with token \"").concat(name, "\". Credentials are stored in ").concat(chalk_1.default.blue((0, sosControlHelper_1.getConfigFilePath)())));
103
135
  return [2 /*return*/];
104
136
  }
@@ -106,11 +138,12 @@ exports.login = (0, commandDefinition_1.createCommandDefinition)({
106
138
  });
107
139
  },
108
140
  });
109
- function getOrCreateApiSecurityToken(identification, password, apiUrl) {
141
+ function getOrCreateApiSecurityToken(_a) {
142
+ var identification = _a.identification, password = _a.password, apiUrl = _a.apiUrl, isAuth0Enabled = _a.isAuth0Enabled, isLegacyEnabled = _a.isLegacyEnabled;
110
143
  return __awaiter(this, void 0, void 0, function () {
111
- var ACCOUNT_SECURITY_TOKEN_RESOURCE, options, tokenName, query, responseOfPost, bodyOfPost, _a, _b;
112
- return __generator(this, function (_c) {
113
- switch (_c.label) {
144
+ var ACCOUNT_SECURITY_TOKEN_RESOURCE, options, tokenName, query, responseOfPost, bodyOfPost, _b, _c;
145
+ return __generator(this, function (_d) {
146
+ switch (_d.label) {
114
147
  case 0:
115
148
  ACCOUNT_SECURITY_TOKEN_RESOURCE = 'account/security-token';
116
149
  options = {
@@ -123,14 +156,16 @@ function getOrCreateApiSecurityToken(identification, password, apiUrl) {
123
156
  identification: identification,
124
157
  password: password,
125
158
  name: tokenName,
159
+ isAuth0AuthenticationEnabled: isAuth0Enabled,
160
+ isLegacyAuthenticationEnabled: isLegacyEnabled,
126
161
  };
127
162
  return [4 /*yield*/, (0, helper_1.postResource)(options, ACCOUNT_SECURITY_TOKEN_RESOURCE, query)];
128
163
  case 1:
129
- responseOfPost = _c.sent();
130
- _b = (_a = JSON).parse;
164
+ responseOfPost = _d.sent();
165
+ _c = (_b = JSON).parse;
131
166
  return [4 /*yield*/, responseOfPost.text()];
132
167
  case 2:
133
- bodyOfPost = _b.apply(_a, [_c.sent(), helper_1.deserializeJSON]);
168
+ bodyOfPost = _c.apply(_b, [_d.sent(), helper_1.deserializeJSON]);
134
169
  debug('POST security-token response', bodyOfPost);
135
170
  if (responseOfPost.status === 201) {
136
171
  return [2 /*return*/, bodyOfPost];
@@ -1 +1 @@
1
- {"version":3,"file":"loginCommand.js","sourceRoot":"","sources":["../../src/Auth/loginCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA0B;AAC1B,iCAAmC;AACnC,6BAA+B;AAC/B,uBAAyB;AACzB,oCAAqE;AACrE,mEAAwE;AACxE,4CAA2C;AAC3C,kEAA2F;AAC3F,uEAAsE;AACtE,uDAAsD;AACtD,mFAAmF;AACnF,IAAM,KAAK,GAAG,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAEjD,IAAM,WAAW,GAAG;IACnB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAA+B,uBAAU,CAAC,OAAO,CAAE,EAAE;CAC3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AAY,EAAC,OAAO,EAAE,+BAA+B,EAAE,KAAK,CAAC,EAAA;;oBAApF,cAAc,GAAG,SAAmE;oBACvE,KAAA,CAAA,KAAA,IAAI,CAAA,CAAC,KAAK,CAAA;oBAAC,qBAAM,cAAc,CAAC,IAAI,EAAE,EAAA;;oBAAnD,UAAU,GAAG,cAAW,SAA2B,EAAE,wBAAe,EAAC;oBAE3E,KAAK,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;oBAElD,IAAI,cAAc,CAAC,MAAM,KAAK,GAAG,EAAE;wBAClC,sBAAO,UAAU,EAAC;qBAClB;yBAAM,IAAI,cAAc,CAAC,MAAM,KAAK,GAAG,EAAE;wBACzC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;qBAClD;yBAAM;wBACN,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;qBACrH;;;;;CACD;AAED,SAAS,iBAAiB;IACzB,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,IAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE/B,OAAO,UAAG,QAAQ,CAAC,QAAQ,cAAI,aAAa,CAAE,CAAC;AAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signageos/cli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  ".env",
@@ -13,21 +13,24 @@
13
13
  "type": "git"
14
14
  },
15
15
  "scripts": {
16
- "build": "tsc",
16
+ "build": "npx check-engine@latest && tsc",
17
17
  "lint": "tslint --config node_modules/@signageos/codestyle/tslint.json {src,tests}/**/*.ts",
18
18
  "prebuild": "rm -rf dist/*",
19
19
  "prepare": "npm run prebuild && npm run build && chmod +x dist/index.js",
20
20
  "test": "env NODE_ENV=test mocha --config .mocharc.unit.json",
21
21
  "test-integration": "env NODE_ENV=test mocha --config .mocharc.integration.json",
22
+ "test:coverage": "c8 npm run test",
22
23
  "watch": "tsc --watch",
23
24
  "check": "npm run depcheck && npx --userconfig ./.npmrc @signageos/lib check-deps && npm run check-circular-deps",
24
25
  "check-circular-deps": "npx madge@5 --circular --extensions ts ./src/",
25
- "depcheck": "depcheck --config .depcheckrc.json"
26
+ "depcheck": "depcheck --config .depcheckrc.json",
27
+ "check-types": "tsc --noEmit",
28
+ "prettier:format": "prettier \"(src|tests|tools)/**/*.+(ts|js)\" --write"
26
29
  },
27
30
  "license": "MIT",
28
31
  "engines": {
29
- "node": ">=12.0.0",
30
- "npm": ">=6.0.0"
32
+ "node": "12",
33
+ "npm": "6"
31
34
  },
32
35
  "bin": {
33
36
  "sos": "./dist/index.js"
@@ -37,7 +40,8 @@
37
40
  "access": "public"
38
41
  },
39
42
  "devDependencies": {
40
- "@signageos/codestyle": "0.0.21",
43
+ "@istanbuljs/nyc-config-typescript": "1.0.2",
44
+ "@signageos/codestyle": "0.0.23",
41
45
  "@types/chalk": "2.2.0",
42
46
  "@types/child-process-promise": "2.2.1",
43
47
  "@types/cli-progress": "3.7.0",
@@ -57,8 +61,10 @@
57
61
  "@types/should": "13.0.0",
58
62
  "@types/sinon": "7.5.0",
59
63
  "@types/webpack": "4.41.7",
64
+ "c8": "7.13.0",
60
65
  "depcheck": "1.4.3",
61
66
  "mocha": "8.4.0",
67
+ "prettier": "2.8.8",
62
68
  "rewiremock": "3.13.9",
63
69
  "should": "13.2.3",
64
70
  "sinon": "9.2.0",