@sap/cli-core 2023.18.0 → 2023.19.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
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 2023.19.0
9
+
10
+ ### Fixed
11
+
12
+ - Logging in failed if required information such as the client ID or client secret were provided via interactive input prompt. When the information were provided using a secrets file or via options, the login worked as expected.
13
+
8
14
  ## 2023.18.0
9
15
 
10
16
  ### Added
@@ -95,7 +95,8 @@ class SecretsStorageImpl {
95
95
  if (secret.client_id) {
96
96
  const config = (0, config_1.get)();
97
97
  let oauth = {};
98
- if (!secret.customClient) {
98
+ if (!secret.customClient &&
99
+ (!secret.authorization_url || !secret.token_url)) {
99
100
  oauth = (await (0, http_1.fetch)({
100
101
  method: "GET",
101
102
  url: `${config.tenantUrl}/oauth`,
@@ -119,6 +120,9 @@ class SecretsStorageImpl {
119
120
  tokenUrl = config.tokenUrl;
120
121
  }
121
122
  }
123
+ if (!tokenUrl || !authorizationUrl) {
124
+ throw new Error("invalid token url or authorization url");
125
+ }
122
126
  this.secrets[secretIndex].authorization_url =
123
127
  (0, utils_1.removeQueryParametersFromUrl)(authorizationUrl);
124
128
  this.secrets[secretIndex].token_url = (0, utils_1.removeQueryParametersFromUrl)(tokenUrl);
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getTechnicalJwt = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
7
  const path_1 = __importDefault(require("path"));
9
8
  const url_1 = require("url");
9
+ const fs_extra_1 = __importDefault(require("fs-extra"));
10
10
  const config_1 = require("../../../../config");
11
11
  const logger_1 = require("../../../../logger");
12
12
  const http_1 = require("../../../../utils/http");
@@ -41,6 +41,6 @@ const loginCommand = {
41
41
  { ...constants_1.OPTION_HOST, hidden: false, required: true },
42
42
  constants_1.OPTION_VERBOSE,
43
43
  constants_1.OPTION_OPTIONS_FILE,
44
- ]), verifyHost, (0, handler_1.createOauthHandler)(), initializeCache),
44
+ ]), (0, handler_1.createMandatoryOptionsHandler)(), verifyHost, (0, handler_1.createOauthHandler)(), initializeCache),
45
45
  };
46
46
  exports.default = loginCommand;
package/dwc/dwc.js CHANGED
@@ -7,6 +7,7 @@ exports.getCommands = exports.executeCommand = exports.init = void 0;
7
7
  if (process.env.SUPPRESS_NO_CONFIG_WARNING === undefined) {
8
8
  process.env.SUPPRESS_NO_CONFIG_WARNING = "true";
9
9
  }
10
+ /* eslint-disable import/first */
10
11
  const path_1 = __importDefault(require("path"));
11
12
  const logger_1 = require("../logger");
12
13
  const constants_1 = require("../constants");
package/dwc/utils.js CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getOptionValueFromArgv = exports.compareEtags = exports.checkVersion = exports.addCommandsFromFolder = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
7
  const path_1 = __importDefault(require("path"));
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
9
9
  const logger_1 = require("../logger");
10
10
  const discovery_1 = require("../discovery");
11
11
  const commands_1 = require("../utils/commands");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cli-core",
3
- "version": "2023.18.0",
3
+ "version": "2023.19.0",
4
4
  "description": "Command-Line Interface (CLI) Core Module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "SAP SE",