arca.rb 1.0.0 → 1.0.2

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: d9ec9a0d7ce9c36571a98f68101f9d64b2957c7b0b4102e42870ac48178735e0
4
- data.tar.gz: d0c45d34625ca35615e333d1d68622f136914311c9377375e6a3a0c383801e83
3
+ metadata.gz: 81ac40aba0c7a3e67dc24402f3888da7af56ab40d785511da1ca310b2a3054e5
4
+ data.tar.gz: 41b29c0590307f836ccbe05d57d6f291382f0c545b6a8f1161533de6fcb24622
5
5
  SHA512:
6
- metadata.gz: cd47f11cd3f4465fa1c38f1a1d511a5d29ebb79e371421b48c7244f51b00d4d898e859ddedf0861d536f30035cfd9ba5f27b729635b266a60097a971a366a9d8
7
- data.tar.gz: d5cdf8bfc5b2f1d9de87b382364e70ce1f14ec2b54008914e591ec06d4858cad76f5df86fbd001ba425390c43794a7dcdc0856783d0671fcd9bef6148f5d22fd
6
+ metadata.gz: ca0895cc00a9f1ebe502fb3021f1305b9073ce1d28b5bab672cac50e124ee2639d88f472659ad17819b6295069e6a28d10603cd48e5d2390eb7fd6b9fe69c03f
7
+ data.tar.gz: 61c8e280fdd2f2d7e177e21fba6ddd5f2b46e25c1f98a98f93ead854e3ba747eb6c935723c5b02968c87913441152d7cdfd794369ac0ca7f6bd4c87d20542384
@@ -3,8 +3,6 @@ on: push
3
3
  jobs:
4
4
  test:
5
5
  runs-on: ubuntu-latest
6
- env:
7
- BUNDLE_FROZEN: false
8
6
  steps:
9
7
  - uses: actions/checkout@v4
10
8
  - name: Set up Ruby
@@ -7,8 +7,6 @@ jobs:
7
7
  release:
8
8
  name: Test and push gem to RubyGems.org
9
9
  runs-on: ubuntu-latest
10
- env:
11
- BUNDLE_FROZEN: false
12
10
  permissions:
13
11
  id-token: write # required for RubyGems Trusted Publishing
14
12
  contents: write # required for rake release to push the release tag
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  pkg/*
2
2
  *.gem
3
- Gemfile.lock
4
3
  .bundle
5
4
  .DS_Store
6
5
  tmp
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Arca Changelog
2
2
 
3
+ ## [1.0.2] - 2025-02-09
4
+
5
+ - **Errores:** En WSAA, `persist_ta` ahora encapsula fallos en `Arca::ServerError` en lugar de re-levantar excepciones crudas (mejor encapsulación y menos riesgo de filtrar datos sensibles en logs).
6
+ - **Test:** Añadido test que verifica que `persist_ta` levanta `ServerError` con la excepción original en `cause`.
7
+ - Actualización de gems/dependencias.
8
+
9
+ ## [1.0.1] - 2025-02-05
10
+ - Fix ruta hardcodeada de certificados SSL CA. Usar OpenSSL::X509::DEFAULT_CERT_FILE en lugar de la ruta hardcodeada
11
+ /etc/ssl/certs/ca-certificates.crt para soportar múltiples plataformas.
12
+
3
13
  ## [1.0.0] - 2025-01-31
4
14
 
5
15
  - Primer release.
data/Gemfile.lock ADDED
@@ -0,0 +1,179 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ arca.rb (1.0.2)
5
+ activesupport
6
+ builder
7
+ httpclient
8
+ nokogiri
9
+ savon (~> 2.15.0)
10
+
11
+ GEM
12
+ remote: http://rubygems.org/
13
+ specs:
14
+ activesupport (8.1.2)
15
+ base64
16
+ bigdecimal
17
+ concurrent-ruby (~> 1.0, >= 1.3.1)
18
+ connection_pool (>= 2.2.5)
19
+ drb
20
+ i18n (>= 1.6, < 2)
21
+ json
22
+ logger (>= 1.4.2)
23
+ minitest (>= 5.1)
24
+ securerandom (>= 0.3)
25
+ tzinfo (~> 2.0, >= 2.0.5)
26
+ uri (>= 0.13.1)
27
+ addressable (2.8.8)
28
+ public_suffix (>= 2.0.2, < 8.0)
29
+ akami (1.3.3)
30
+ base64
31
+ gyoku (>= 0.4.0)
32
+ nokogiri
33
+ ast (2.4.3)
34
+ base64 (0.3.0)
35
+ bigdecimal (4.0.1)
36
+ builder (3.3.0)
37
+ coderay (1.1.3)
38
+ concurrent-ruby (1.3.6)
39
+ connection_pool (3.0.2)
40
+ date (3.5.1)
41
+ drb (2.2.3)
42
+ faraday (2.14.1)
43
+ faraday-net_http (>= 2.0, < 3.5)
44
+ json
45
+ logger
46
+ faraday-net_http (3.4.2)
47
+ net-http (~> 0.5)
48
+ gyoku (1.4.0)
49
+ builder (>= 2.1.2)
50
+ rexml (~> 3.0)
51
+ httpclient (2.9.0)
52
+ mutex_m
53
+ httpi (4.0.4)
54
+ base64
55
+ mutex_m
56
+ nkf
57
+ rack (>= 2.0, < 4)
58
+ i18n (1.14.8)
59
+ concurrent-ruby (~> 1.0)
60
+ io-console (0.8.2)
61
+ json (2.18.1)
62
+ language_server-protocol (3.17.0.5)
63
+ lint_roller (1.1.0)
64
+ logger (1.7.0)
65
+ mail (2.9.0)
66
+ logger
67
+ mini_mime (>= 0.1.1)
68
+ net-imap
69
+ net-pop
70
+ net-smtp
71
+ method_source (1.1.0)
72
+ mini_mime (1.1.5)
73
+ minitest (6.0.1)
74
+ prism (~> 1.5)
75
+ mocha (3.0.1)
76
+ ruby2_keywords (>= 0.0.5)
77
+ mutex_m (0.3.0)
78
+ net-http (0.9.1)
79
+ uri (>= 0.11.1)
80
+ net-imap (0.6.2)
81
+ date
82
+ net-protocol
83
+ net-pop (0.1.2)
84
+ net-protocol
85
+ net-protocol (0.2.2)
86
+ timeout
87
+ net-smtp (0.5.1)
88
+ net-protocol
89
+ nkf (0.2.0)
90
+ nokogiri (1.19.0-aarch64-linux-gnu)
91
+ racc (~> 1.4)
92
+ nokogiri (1.19.0-x86_64-linux-gnu)
93
+ racc (~> 1.4)
94
+ nori (2.7.1)
95
+ bigdecimal
96
+ parallel (1.27.0)
97
+ parser (3.3.10.1)
98
+ ast (~> 2.4.1)
99
+ racc
100
+ prism (1.9.0)
101
+ pry (0.16.0)
102
+ coderay (~> 1.1)
103
+ method_source (~> 1.0)
104
+ reline (>= 0.6.0)
105
+ public_suffix (7.0.2)
106
+ racc (1.8.1)
107
+ rack (3.2.4)
108
+ rainbow (3.1.1)
109
+ rake (13.3.1)
110
+ regexp_parser (2.11.3)
111
+ reline (0.6.3)
112
+ io-console (~> 0.5)
113
+ rexml (3.4.4)
114
+ rubocop (1.84.1)
115
+ json (~> 2.3)
116
+ language_server-protocol (~> 3.17.0.2)
117
+ lint_roller (~> 1.1.0)
118
+ parallel (~> 1.10)
119
+ parser (>= 3.3.0.2)
120
+ rainbow (>= 2.2.2, < 4.0)
121
+ regexp_parser (>= 2.9.3, < 3.0)
122
+ rubocop-ast (>= 1.49.0, < 2.0)
123
+ ruby-progressbar (~> 1.7)
124
+ unicode-display_width (>= 2.4.0, < 4.0)
125
+ rubocop-ast (1.49.0)
126
+ parser (>= 3.3.7.2)
127
+ prism (~> 1.7)
128
+ rubocop-performance (1.26.1)
129
+ lint_roller (~> 1.1)
130
+ rubocop (>= 1.75.0, < 2.0)
131
+ rubocop-ast (>= 1.47.1, < 2.0)
132
+ rubocop-rails (2.34.3)
133
+ activesupport (>= 4.2.0)
134
+ lint_roller (~> 1.1)
135
+ rack (>= 1.1)
136
+ rubocop (>= 1.75.0, < 2.0)
137
+ rubocop-ast (>= 1.44.0, < 2.0)
138
+ rubocop-rails-omakase (1.1.0)
139
+ rubocop (>= 1.72)
140
+ rubocop-performance (>= 1.24)
141
+ rubocop-rails (>= 2.30)
142
+ ruby-progressbar (1.13.0)
143
+ ruby2_keywords (0.0.5)
144
+ savon (2.15.1)
145
+ akami (~> 1.2)
146
+ builder (>= 2.1.2)
147
+ gyoku (~> 1.2)
148
+ httpi (>= 4, < 5)
149
+ mail (~> 2.5)
150
+ nokogiri (>= 1.8.1)
151
+ nori (~> 2.4)
152
+ wasabi (>= 3.7, < 6)
153
+ securerandom (0.4.1)
154
+ timeout (0.6.0)
155
+ tzinfo (2.0.6)
156
+ concurrent-ruby (~> 1.0)
157
+ unicode-display_width (3.2.0)
158
+ unicode-emoji (~> 4.1)
159
+ unicode-emoji (4.2.0)
160
+ uri (1.1.1)
161
+ wasabi (5.1.0)
162
+ addressable
163
+ faraday (>= 1.9, < 3)
164
+ nokogiri (>= 1.13.9)
165
+
166
+ PLATFORMS
167
+ aarch64-linux
168
+ x86_64-linux
169
+
170
+ DEPENDENCIES
171
+ arca.rb!
172
+ minitest
173
+ mocha
174
+ pry
175
+ rake
176
+ rubocop-rails-omakase
177
+
178
+ BUNDLED WITH
179
+ 4.0.5
data/arca.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.email = [ 'hola@arcakit.dev' ]
13
13
  s.homepage = 'https://arcakit.dev'
14
14
  s.summary = 'Cliente Ruby para webservices de AFIP/ARCA: facturación electrónica, comprobantes y servicios tributarios de Argentina'
15
- s.description = 'Cliente Ruby para integrar webservices SOAP de ARCA/AFIPen Argentina. Soporta facturación electrónica (WSFE), factura electrónica de crédito MiPyMEs (WSFeCred), autenticación WSAA, consulta de padrón de contribuyentes, constatación de comprobantes fiscales y todos los servicios tributarios de la API de AFIP. Ideal para aplicaciones Rails que necesitan generar facturas electrónicas y comprobantes en Argentina.'
15
+ s.description = 'Cliente Ruby para integrar webservices SOAP de ARCA/AFIP en Argentina.'
16
16
  s.license = 'MIT'
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
data/lib/arca/client.rb CHANGED
@@ -7,8 +7,7 @@ module Arca
7
7
  soap_version: 2,
8
8
  ssl_version: :TLSv1_2,
9
9
  ssl_ciphers: "DEFAULT:!DH:!DHE",
10
- # This will load the CA certificates from the system's certificate store.
11
- ssl_ca_cert_file: "/etc/ssl/certs/ca-certificates.crt"
10
+ ssl_ca_cert_file: OpenSSL::X509::DEFAULT_CERT_FILE
12
11
  )
13
12
 
14
13
  @savon = Savon.client savon_opts
@@ -26,4 +25,4 @@ module Arca
26
25
 
27
26
  delegate :operations, to: :@savon
28
27
  end
29
- end
28
+ end
data/lib/arca/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arca
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
data/lib/arca/wsaa.rb CHANGED
@@ -116,13 +116,13 @@ module Arca
116
116
  temp_path = "#{@ta_path}.#{Process.pid}.tmp"
117
117
  File.write(temp_path, JSON.generate(payload))
118
118
  File.rename(temp_path, @ta_path)
119
- rescue StandardError
119
+ rescue StandardError => e
120
120
  File.delete(temp_path) if defined?(temp_path) && File.exist?(temp_path)
121
- raise
121
+ raise ServerError, e
122
122
  end
123
123
 
124
124
  def xsd_datetime(time)
125
- time.strftime("%Y-%m-%dT%H:%M:%S%z").sub /(\d{2})(\d{2})$/, '\1:\2'
125
+ time.strftime("%Y-%m-%dT%H:%M:%S%z").sub(/(\d{2})(\d{2})$/, '\1:\2')
126
126
  end
127
127
 
128
128
  def from_xsd_datetime(str)
@@ -76,5 +76,15 @@ module Arca
76
76
  subject.auth
77
77
  assert_equal "t2", subject.ta[:token]
78
78
  end
79
+
80
+ def test_persist_ta_encapsula_errores_en_server_error
81
+ File.stubs(:write).raises(Errno::EACCES.new("Permission denied"))
82
+ ta = { token: "t", sign: "s", generation_time: Time.now, expiration_time: Time.now + 60 }
83
+ ws = WSAA.new(wsdl: Arca::WSFE::WSDL[:test])
84
+
85
+ error = assert_raises(ServerError) { ws.send(:persist_ta, ta) }
86
+ assert_equal Errno::EACCES, error.cause.class
87
+ assert_match(/Permission denied/, error.cause.message)
88
+ end
79
89
  end
80
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arca.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arca Kit
@@ -149,11 +149,7 @@ dependencies:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
151
  version: 2.15.0
152
- description: Cliente Ruby para integrar webservices SOAP de ARCA/AFIPen Argentina.
153
- Soporta facturación electrónica (WSFE), factura electrónica de crédito MiPyMEs (WSFeCred),
154
- autenticación WSAA, consulta de padrón de contribuyentes, constatación de comprobantes
155
- fiscales y todos los servicios tributarios de la API de AFIP. Ideal para aplicaciones
156
- Rails que necesitan generar facturas electrónicas y comprobantes en Argentina.
152
+ description: Cliente Ruby para integrar webservices SOAP de ARCA/AFIP en Argentina.
157
153
  email:
158
154
  - hola@arcakit.dev
159
155
  executables:
@@ -173,6 +169,7 @@ files:
173
169
  - CHANGELOG.md
174
170
  - CONTRIBUTING.md
175
171
  - Gemfile
172
+ - Gemfile.lock
176
173
  - LICENSE
177
174
  - README.md
178
175
  - Rakefile