pdnd-ruby-client 0.1.7 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7465358f480a660082893609f41ce73652d42733474cd9110ef614ee15ac84c2
4
- data.tar.gz: f242965866041e9fb499babb40dd77cd2e1eaa81e037fe40c02c10965b60c518
3
+ metadata.gz: af413a45032167a856a8d51b5e222c315632eb196771bc3f7d851a43557fa662
4
+ data.tar.gz: 1e08ac4933156f71f4fd4036ddd8dbf147bd416b60980aa1de73fa455d20b301
5
5
  SHA512:
6
- metadata.gz: e86020921bef23dd31737efe38f1970ad25329a5dd5c7c42c672ee5e8e67ed1f1a6d728db5756aa5c48850cd663712ff277c6fd1a44e4932f12b201b49abcc29
7
- data.tar.gz: ff73db88ac3b4139ec84c0597ad99fc1525198c5e7da19996af79fec5974db3bec920298b483e2a4ffe6333f861f50f0013a91336e71301367a830679af1574b
6
+ metadata.gz: d9c68932ffd968fe47f0148952960b6d96ac3e0bc7772eff157f1fa085c3a3acfb7876ccdbe3a59bf91d6ad8802217e739ad148795527fdb5347e7b2e7abc817
7
+ data.tar.gz: ce49b346ec42eeb4506bd1552821c207b90c35ea3aa4f6ebe2930cd1a418edfc794c549a4506c5f1443246bb0d86534fbb2c4b031e7edf6662a095e4e719c85f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.1.9](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.9) (2025-12-12)
4
+
5
+ [Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.8...v0.1.9)
6
+
7
+ ## [v0.1.8](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.8) (2025-11-14)
8
+
9
+ [Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.7...v0.1.8)
10
+
3
11
  ## [v0.1.7](https://github.com/isprambiente/pdnd-ruby-client/tree/v0.1.7) (2025-11-07)
4
12
 
5
13
  [Full Changelog](https://github.com/isprambiente/pdnd-ruby-client/compare/v0.1.6...v0.1.7)
data/README.md CHANGED
@@ -1,4 +1,10 @@
1
- # pdnd-ruby-client ![CI](https://img.shields.io/github/actions/workflow/status/isprambiente/pdnd-ruby-client/README.md) ![Versione Ruby](https://img.shields.io/badge/ruby-%3E%3D3.2-blue) ![Licenza MIT](https://img.shields.io/badge/license-MIT-green)
1
+ # pdnd-ruby-client
2
+ ![CI](https://img.shields.io/github/actions/workflow/status/isprambiente/pdnd-ruby-client/ci.yml?label=CI)
3
+ ![Security Audit](https://img.shields.io/github/actions/workflow/status/isprambiente/pdnd-ruby-client/security-audit.yml?label=Security%20Audit)
4
+ ![Licenza MIT](https://img.shields.io/badge/license-MIT-green)
5
+ ![Versione Ruby](https://img.shields.io/badge/ruby-%3E%3D3.2-blue)
6
+ ![Ultima versione](https://img.shields.io/gem/v/pdnd-ruby-client)
7
+ ![Download totali](https://img.shields.io/gem/dt/pdnd-ruby-client)
2
8
 
3
9
  Client Ruby per autenticazione e interazione con le API della Piattaforma Digitale Nazionale Dati (PDND).
4
10
 
@@ -164,6 +170,7 @@ ruby bin/pdnd_client.rb --api-url "https://api.pdnd.example.it/resource" --confi
164
170
  - `--env` : Specifica l'ambiente da usare (es. collaudo, produzione). Default: `produzione`
165
171
  - `--config` : Specifica il percorso completo del file di configurazione (es: `--config /configs/sample.json`)
166
172
  - `--debug` : Abilita output dettagliato
173
+ - `--pretty` : Abilita output dei json formattato in modalità leggibile
167
174
  - `--api-url` : URL dell’API da chiamare dopo la generazione del token
168
175
  - `--api-url-filters` : Filtri da applicare all'API (es. ?parametro=valore)
169
176
  - `--status-url` : URL dell’API di status per verificare la validità del token
@@ -189,6 +196,11 @@ ruby bin/pdnd_client.rb --status-url="https://api.pdnd.example.it/status" --conf
189
196
  ruby bin/pdnd_client.rb --debug --api-url="https://api.pdnd.example.it/resource"
190
197
  ```
191
198
 
199
+ **Pretty attivo:**
200
+ ```bash
201
+ ruby bin/pdnd_client.rb --pretty --api-url="https://api.pdnd.example.it/resource"
202
+ ```
203
+
192
204
  ### Opzione di aiuto
193
205
 
194
206
  Se esegui il comando con `--help` oppure senza parametri, viene mostrata una descrizione delle opzioni disponibili e alcuni esempi di utilizzo:
@@ -207,6 +219,7 @@ Opzioni:
207
219
  Default: produzione
208
220
  --config Specifica il percorso completo del file di configurazione
209
221
  --debug Abilita output dettagliato
222
+ --pretty Abilita output dei json formattato in modalità leggibile
210
223
  --api-url URL dell’API da chiamare dopo la generazione del token
211
224
  --api-url-filters Filtri da applicare all'API (es. ?parametro=valore)
212
225
  --status-url URL dell’API di status per verificare la validità del token
@@ -219,6 +232,7 @@ Esempi:
219
232
  ruby bin/pdnd_client.rb --api-url="https://api.pdnd.example.it/resource" --config /percorso/config.json
220
233
  ruby bin/pdnd_client.rb --status-url="https://api.pdnd.example.it/status" --config /percorso/config.json
221
234
  ruby bin/pdnd_client.rb --debug --api-url="https://api.pdnd.example.it/resource"
235
+ ruby bin/pdnd_client.rb --pretty --api-url="https://api.pdnd.example.it/resource"
222
236
  ```
223
237
 
224
238
  ## Variabili di ambiente supportate
@@ -39,20 +39,20 @@ module PDND
39
39
  log_api_search
40
40
 
41
41
  response = perform_request(@api_search.to_s)
42
+ body = response.body.force_encoding('UTF-8')
43
+ raise PDND::APIError.new(response.status, body) unless response.success?
42
44
 
43
- raise PDND::APIError.new(response.status, response.body.force_encoding('UTF-8')) unless response.success?
44
-
45
- puts "📡 Response: #{response.body}" if @debug
46
- [response.status, JSON.parse(response.body)]
45
+ puts "📡 Response: #{body}" if @debug
46
+ [response.status, JSON.parse(body)]
47
47
  end
48
48
 
49
49
  def check_status
50
50
  validate_status_config
51
51
 
52
52
  response = perform_request(@status_url)
53
-
54
- puts "📡 Status response: #{response.body}" if @debug
55
- [response.status, JSON.parse(response.body)]
53
+ body = response.body.force_encoding('UTF-8')
54
+ puts "📡 Status response: #{body}" if @debug
55
+ [response.status, JSON.parse(body)]
56
56
  end
57
57
 
58
58
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PDND
4
4
  class ClientVersion
5
- VERSION = '0.1.7'
5
+ VERSION = '0.1.9'
6
6
  end
7
7
  end
data/publiccode.yml ADDED
@@ -0,0 +1,50 @@
1
+ publiccodeYmlVersion: 0.5.0
2
+ name: PDND Ruby Client
3
+ applicationSuite: PDNDClient
4
+ url: https://github.com/isprambiente/pdnd-ruby-client.git
5
+ landingURL: https://github.com/isprambiente/pdnd-ruby-client
6
+ softwareVersion: 0.1.9
7
+ releaseDate: 2025-12-12
8
+ platforms:
9
+ - web
10
+ - windows
11
+ - linux
12
+ categories:
13
+ - application-development
14
+ - it-development
15
+ organisation:
16
+ uri: urn:x-italian-pa:ispra_rm
17
+ usedBy:
18
+ - ISPRA
19
+ developmentStatus: stable
20
+ softwareType: library
21
+ description:
22
+ it:
23
+ localisedName: PDND Ruby Client
24
+ shortDescription: Client Ruby per autenticazione e chiamata API PDND (Piattaforma
25
+ Digitale Nazionale Dati).
26
+ longDescription: Client Ruby per autenticazione e interazione con le API della Piattaforma Digitale Nazionale Dati (PDND).
27
+ https://github.com/isprambiente/pdnd-ruby-client
28
+ documentation: https://github.com/isprambiente/pdnd-ruby-client?tab=readme-ov-file#pdnd-ruby-client---
29
+ apiDocumentation: https://github.com/isprambiente/pdnd-ruby-client?tab=readme-ov-file#esempio-di-configurazione-minima
30
+ features:
31
+ - Compatibile con Ruby 3.2 e versioni successive
32
+ - Supporta autenticazione OAuth2 con JWT Bearer Token
33
+ - Gestione automatica del rinnovo del token di accesso
34
+ - Facile integrazione con API RESTful di PDND
35
+ - Documentazione completa e esempi di utilizzo
36
+ - Open Source con licenza MIT
37
+ - Audit di sicurezza
38
+ legal:
39
+ license: MIT
40
+ maintenance:
41
+ type: internal
42
+ contacts:
43
+ - name: Francesco Loreti
44
+ email: francesco.loreti@isprambiente.it
45
+ phone: "0650072225"
46
+ affiliation: ISPRA
47
+ localisation:
48
+ localisationReady: false
49
+ availableLanguages:
50
+ - it-IT
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdnd-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Loreti
@@ -108,6 +108,7 @@ files:
108
108
  - lib/pdnd-ruby-client/jwt_generator.rb
109
109
  - lib/pdnd-ruby-client/token_manager.rb
110
110
  - lib/pdnd-ruby-client/version.rb
111
+ - publiccode.yml
111
112
  - sig/pdnd-ruby-client.rbs
112
113
  - tmp/.gitkeep
113
114
  homepage: https://github.com/isprambiente/pdnd-ruby-client