multicloud_rule_manager 1.0.2 → 1.0.4

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.
@@ -13,22 +13,24 @@ export default {
13
13
  const cred = getAlias(argv.alias);
14
14
 
15
15
  // Token
16
- const loginResp = await fetch(`${cred.realm}/token`, {
16
+ const loginResp = await fetch(`https://login-eon-no-prod.bit2win.cloud/auth/realms/${cred.realm}/protocol/openid-connect/token`, {
17
17
  method: "POST",
18
18
  headers: { "Content-Type": "application/json" },
19
19
  body: JSON.stringify({
20
20
  client_id: cred.clientId,
21
21
  client_secret: cred.clientSecret,
22
22
  username: cred.username,
23
- password: cred.password
23
+ password: cred.password,
24
+ grant_type: "password"
24
25
  })
25
26
  });
26
27
 
27
- const { access_token } = await loginResp.json();
28
+ const { access_token } = await loginResp.json().access_token;
28
29
  if (!access_token) throw new Error("Token non ricevuto");
29
30
 
30
31
  // Retrieve
31
- const apiResp = await fetch(`${cred.realm}/retrieve`, {
32
+ const apiResp = await fetch(`https://${cred.realm}.bit2win.cloud/api/data/v1/rules/`, {
33
+ method: "GET",
32
34
  headers: { Authorization: `Bearer ${access_token}` }
33
35
  });
34
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multicloud_rule_manager",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "CLI interna per retrieve/upload con token",
5
5
  "main": "index.js",
6
6
  "type": "module",