licensemanager-sdk 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b4c3e03efd058239a8cecf60b9ad559e6f3ae8f986528efe9dd7952785132fa
4
- data.tar.gz: 9e61b216924df3fa6f8ac0781d97dee72925532b473a5fa2a9d17ae5fed60f6a
3
+ metadata.gz: b75c5d2384100222a38ab923c16fa3a3882539ee75c32e4b963fdb907607cfb1
4
+ data.tar.gz: '08e9cc22ddd22b1a9197637a90b6b81e1232c22c3e0ac90b979fe46c37853346'
5
5
  SHA512:
6
- metadata.gz: eaf98ed8b9f085719405488f0da35dee6642a34a6486624f7a401e7f080cfd944995dcf261697b03f39180d0fa1be31b5f52b1c4097ef8868d94ea1787185ff3
7
- data.tar.gz: 2025c482a50813d8a460a96734d399e7848044f9ec7b7115ce3c2e41cee08934180adf51c89a0a9924e42c6a8980d72dce0304c558960853fd8db2bf09f4a9ea
6
+ metadata.gz: 12ed49a2a94e1f457fcacfdafbc65e20e90c55ee503fe6d6a4304192c71b83c27af55d1ed6c642d6dc2991b1c0e9c925d1f73abd8fe8e2ef814b10445b6ec12f
7
+ data.tar.gz: 21aa122b030d52246f0d5a392ba6b4a49638011b47969f96a90df48379da20438ed80ea6bdf8ed9f0a2702f00eda62eac7f4e2e582264d51abbfc163a1519d0b
@@ -20,7 +20,10 @@ module LicenseManagerSdk
20
20
 
21
21
  @base_url = base_url.chomp("/")
22
22
  @token = token
23
- @license_id = license_id
23
+ # Normaliza GUID para lowercase com hífens — igual ao servidor (idLicenca:D)
24
+ @license_id = license_id.match?(/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i) \
25
+ ? license_id.downcase \
26
+ : license_id
24
27
  @timeout = timeout
25
28
  end
26
29
 
@@ -79,22 +82,23 @@ module LicenseManagerSdk
79
82
 
80
83
  def post(path, body)
81
84
  body_json = JSON.generate(body)
82
- timestamp = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
83
- nonce = SecureRandom.hex(16)
84
- signature = compute_signature(@license_id, timestamp, body_json)
85
-
86
85
  uri = URI.parse("#{@base_url}/#{path}")
87
- headers = {
88
- "Content-Type" => "application/json",
89
- "X-Token" => @token,
90
- "X-Timestamp" => timestamp,
91
- "X-Nonce" => nonce,
92
- "X-Signature" => signature
93
- }
94
86
 
95
87
  last_error = nil
96
88
  MAX_RETRIES.times do |attempt|
97
89
  begin
90
+ timestamp = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
91
+ nonce = SecureRandom.hex(16)
92
+ signature = compute_signature(@license_id, timestamp, body_json)
93
+
94
+ headers = {
95
+ "Content-Type" => "application/json",
96
+ "X-Token" => @token,
97
+ "X-Timestamp" => timestamp,
98
+ "X-Nonce" => nonce,
99
+ "X-Signature" => signature
100
+ }
101
+
98
102
  http = Net::HTTP.new(uri.host, uri.port)
99
103
  http.use_ssl = uri.scheme == "https"
100
104
  http.read_timeout = @timeout
@@ -1,3 +1,3 @@
1
1
  module LicenseManagerSdk
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "licensemanager-sdk"
3
- spec.version = "1.0.2"
3
+ spec.version = "1.0.4"
4
4
  spec.authors = ["LicenciamentoSoftware"]
5
5
  spec.summary = "SDK cliente para a API de validação do LicenseManager"
6
6
  spec.description = "Encapsula autenticação HMAC-SHA256 e os endpoints de validação de licença."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensemanager-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - LicenciamentoSoftware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-12 00:00:00.000000000 Z
11
+ date: 2026-08-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Encapsula autenticação HMAC-SHA256 e os endpoints de validação de licença.
14
14
  email: