opensrs 0.3.8 → 0.4.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.
- checksums.yaml +5 -5
- data/.github/workflows/rubocop-analysis.yml +43 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +131 -0
- data/Gemfile.lock +49 -15
- data/README.md +3 -11
- data/Rakefile +1 -1
- data/SECURITY.md +12 -0
- data/bin/console +4 -5
- data/lib/opensrs.rb +6 -4
- data/lib/opensrs/response.rb +11 -7
- data/lib/opensrs/sanitizable_string.rb +21 -0
- data/lib/opensrs/server.rb +34 -21
- data/lib/opensrs/version.rb +1 -1
- data/lib/opensrs/xml_processor.rb +14 -11
- data/lib/opensrs/xml_processor/libxml.rb +30 -16
- data/lib/opensrs/xml_processor/nokogiri.rb +28 -16
- data/opensrs.gemspec +23 -20
- metadata +76 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 71d1e83d17bb3fbcf14fe9da34120322c4411bfeb37b9f6023806467025e5d5f
|
|
4
|
+
data.tar.gz: 941f1cc4275cf0f64635d6ed5e326a7ebdb9bc6ee98230c495de7e809637d661
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df149b8fcd50164c419c51aa789d4dab1e8409952ec0b4b1f2fcd202948111512931d82a5169635b8690feec9f01d82fba0548b5952691dcf2d3323081b25210
|
|
7
|
+
data.tar.gz: 54e8f4bcbb4538d6215d94dd3bcd797f59dffa7e120a181b2af62d4f38c1cf8fb737d8298e516feda9f7bfc7b100b894714ea33cab4f8fc00458ab95b4b5c330
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# pulled from repo
|
|
2
|
+
name: "Rubocop"
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ master, rubocop ]
|
|
7
|
+
pull_request:
|
|
8
|
+
# The branches below must be a subset of the branches above
|
|
9
|
+
branches: [ master, rubocop ]
|
|
10
|
+
schedule:
|
|
11
|
+
- cron: '37 10 * * 2'
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
rubocop:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v2
|
|
22
|
+
|
|
23
|
+
# If running on a self-hosted runner, check it meets the requirements
|
|
24
|
+
# listed at https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
|
25
|
+
- name: Set up Ruby
|
|
26
|
+
uses: ruby/setup-ruby@v1
|
|
27
|
+
with:
|
|
28
|
+
ruby-version: 2.6
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: bundle install
|
|
32
|
+
|
|
33
|
+
- name: Rubocop run
|
|
34
|
+
run: |
|
|
35
|
+
bash -c "
|
|
36
|
+
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
|
|
37
|
+
[[ $? -ne 2 ]]
|
|
38
|
+
"
|
|
39
|
+
|
|
40
|
+
- name: Upload Sarif output
|
|
41
|
+
uses: github/codeql-action/upload-sarif@v1
|
|
42
|
+
with:
|
|
43
|
+
sarif_file: rubocop.sarif
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
require: rubocop-rspec
|
|
2
|
+
|
|
3
|
+
AllCops:
|
|
4
|
+
TargetRubyVersion: 2.5
|
|
5
|
+
SuggestExtensions: false
|
|
6
|
+
|
|
7
|
+
Style/FrozenStringLiteralComment:
|
|
8
|
+
Enabled: false
|
|
9
|
+
|
|
10
|
+
RSpec/InstanceVariable:
|
|
11
|
+
Enabled: false
|
|
12
|
+
|
|
13
|
+
Metrics/BlockLength:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
RSpec/FilePath:
|
|
17
|
+
Enabled: false
|
|
18
|
+
|
|
19
|
+
Layout/LineLength:
|
|
20
|
+
Enabled: false
|
|
21
|
+
|
|
22
|
+
RSpec/MultipleExpectations:
|
|
23
|
+
Enabled: false
|
|
24
|
+
|
|
25
|
+
RSpec/ExampleLength:
|
|
26
|
+
Enabled: false
|
|
27
|
+
|
|
28
|
+
RSpec/NestedGroups:
|
|
29
|
+
Enabled: false
|
|
30
|
+
|
|
31
|
+
RSpec/MultipleMemoizedHelpers:
|
|
32
|
+
Enabled: false
|
|
33
|
+
|
|
34
|
+
RSpec/MessageSpies:
|
|
35
|
+
Enabled: false
|
|
36
|
+
|
|
37
|
+
RSpec/StubbedMock:
|
|
38
|
+
Enabled: false
|
|
39
|
+
|
|
40
|
+
RSpec/VerifiedDoubles:
|
|
41
|
+
Enabled: false
|
|
42
|
+
|
|
43
|
+
Metrics/MethodLength:
|
|
44
|
+
Enabled: false
|
|
45
|
+
|
|
46
|
+
Metrics/AbcSize:
|
|
47
|
+
Enabled: false
|
|
48
|
+
|
|
49
|
+
Style/ClassVars:
|
|
50
|
+
Enabled: false
|
|
51
|
+
|
|
52
|
+
Gemspec/DateAssignment: # (new in 1.10)
|
|
53
|
+
Enabled: true
|
|
54
|
+
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
|
|
55
|
+
Enabled: true
|
|
56
|
+
Layout/SpaceBeforeBrackets: # (new in 1.7)
|
|
57
|
+
Enabled: true
|
|
58
|
+
Lint/AmbiguousAssignment: # (new in 1.7)
|
|
59
|
+
Enabled: true
|
|
60
|
+
Lint/AmbiguousRange: # (new in 1.19)
|
|
61
|
+
Enabled: true
|
|
62
|
+
Lint/DeprecatedConstants: # (new in 1.8)
|
|
63
|
+
Enabled: true
|
|
64
|
+
Lint/DuplicateBranch: # (new in 1.3)
|
|
65
|
+
Enabled: true
|
|
66
|
+
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
|
|
67
|
+
Enabled: true
|
|
68
|
+
Lint/EmptyBlock: # (new in 1.1)
|
|
69
|
+
Enabled: true
|
|
70
|
+
Lint/EmptyClass: # (new in 1.3)
|
|
71
|
+
Enabled: true
|
|
72
|
+
Lint/EmptyInPattern: # (new in 1.16)
|
|
73
|
+
Enabled: true
|
|
74
|
+
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
|
|
75
|
+
Enabled: true
|
|
76
|
+
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
|
|
77
|
+
Enabled: true
|
|
78
|
+
Lint/NumberedParameterAssignment: # (new in 1.9)
|
|
79
|
+
Enabled: true
|
|
80
|
+
Lint/OrAssignmentToConstant: # (new in 1.9)
|
|
81
|
+
Enabled: true
|
|
82
|
+
Lint/RedundantDirGlobSort: # (new in 1.8)
|
|
83
|
+
Enabled: true
|
|
84
|
+
Lint/SymbolConversion: # (new in 1.9)
|
|
85
|
+
Enabled: true
|
|
86
|
+
Lint/ToEnumArguments: # (new in 1.1)
|
|
87
|
+
Enabled: true
|
|
88
|
+
Lint/TripleQuotes: # (new in 1.9)
|
|
89
|
+
Enabled: true
|
|
90
|
+
Lint/UnexpectedBlockArity: # (new in 1.5)
|
|
91
|
+
Enabled: true
|
|
92
|
+
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
|
|
93
|
+
Enabled: true
|
|
94
|
+
Naming/InclusiveLanguage: # (new in 1.18)
|
|
95
|
+
Enabled: true
|
|
96
|
+
Style/ArgumentsForwarding: # (new in 1.1)
|
|
97
|
+
Enabled: true
|
|
98
|
+
Style/CollectionCompact: # (new in 1.2)
|
|
99
|
+
Enabled: true
|
|
100
|
+
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
|
|
101
|
+
Enabled: true
|
|
102
|
+
Style/EndlessMethod: # (new in 1.8)
|
|
103
|
+
Enabled: true
|
|
104
|
+
Style/HashConversion: # (new in 1.10)
|
|
105
|
+
Enabled: true
|
|
106
|
+
Style/HashExcept: # (new in 1.7)
|
|
107
|
+
Enabled: true
|
|
108
|
+
Style/IfWithBooleanLiteralBranches: # (new in 1.9)
|
|
109
|
+
Enabled: true
|
|
110
|
+
Style/InPatternThen: # (new in 1.16)
|
|
111
|
+
Enabled: true
|
|
112
|
+
Style/MultilineInPatternThen: # (new in 1.16)
|
|
113
|
+
Enabled: true
|
|
114
|
+
Style/NegatedIfElseCondition: # (new in 1.2)
|
|
115
|
+
Enabled: true
|
|
116
|
+
Style/NilLambda: # (new in 1.3)
|
|
117
|
+
Enabled: true
|
|
118
|
+
Style/QuotedSymbols: # (new in 1.16)
|
|
119
|
+
Enabled: true
|
|
120
|
+
Style/RedundantArgument: # (new in 1.4)
|
|
121
|
+
Enabled: true
|
|
122
|
+
Style/RedundantSelfAssignmentBranch: # (new in 1.19)
|
|
123
|
+
Enabled: true
|
|
124
|
+
Style/StringChars: # (new in 1.12)
|
|
125
|
+
Enabled: true
|
|
126
|
+
Style/SwapValues: # (new in 1.1)
|
|
127
|
+
Enabled: true
|
|
128
|
+
RSpec/IdenticalEqualityAssertion: # (new in 2.4)
|
|
129
|
+
Enabled: true
|
|
130
|
+
RSpec/Rails/AvoidSetupHook: # (new in 2.4)
|
|
131
|
+
Enabled: true
|
data/Gemfile.lock
CHANGED
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
opensrs (0.3.
|
|
4
|
+
opensrs (0.3.8)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
activesupport (4.2.
|
|
9
|
+
activesupport (4.2.10)
|
|
10
10
|
i18n (~> 0.7)
|
|
11
|
-
json (~> 1.7, >= 1.7.7)
|
|
12
11
|
minitest (~> 5.1)
|
|
13
12
|
thread_safe (~> 0.3, >= 0.3.4)
|
|
14
13
|
tzinfo (~> 1.1)
|
|
14
|
+
ast (2.4.2)
|
|
15
|
+
code-scanning-rubocop (0.5.0)
|
|
16
|
+
rubocop (~> 1.0)
|
|
15
17
|
coderay (1.1.0)
|
|
18
|
+
concurrent-ruby (1.0.5)
|
|
16
19
|
diff-lcs (1.2.5)
|
|
17
|
-
i18n (0.
|
|
18
|
-
|
|
19
|
-
libxml-ruby (2.
|
|
20
|
+
i18n (0.9.3)
|
|
21
|
+
concurrent-ruby (~> 1.0)
|
|
22
|
+
libxml-ruby (3.2.1)
|
|
20
23
|
method_source (0.8.2)
|
|
21
|
-
|
|
22
|
-
minitest (5.
|
|
23
|
-
nokogiri (1.
|
|
24
|
-
|
|
24
|
+
mini_portile2 (2.5.1)
|
|
25
|
+
minitest (5.11.3)
|
|
26
|
+
nokogiri (1.11.4)
|
|
27
|
+
mini_portile2 (~> 2.5.0)
|
|
28
|
+
racc (~> 1.4)
|
|
29
|
+
parallel (1.20.1)
|
|
30
|
+
parser (3.0.2.0)
|
|
31
|
+
ast (~> 2.4.1)
|
|
25
32
|
pry (0.10.1)
|
|
26
33
|
coderay (~> 1.1.0)
|
|
27
34
|
method_source (~> 0.8.1)
|
|
28
35
|
slop (~> 3.4)
|
|
29
|
-
|
|
36
|
+
racc (1.5.2)
|
|
37
|
+
rainbow (3.0.0)
|
|
38
|
+
rake (13.0.6)
|
|
39
|
+
regexp_parser (2.1.1)
|
|
40
|
+
rexml (3.2.5)
|
|
30
41
|
rspec (3.2.0)
|
|
31
42
|
rspec-core (~> 3.2.0)
|
|
32
43
|
rspec-expectations (~> 3.2.0)
|
|
@@ -40,6 +51,21 @@ GEM
|
|
|
40
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
41
52
|
rspec-support (~> 3.2.0)
|
|
42
53
|
rspec-support (3.2.2)
|
|
54
|
+
rubocop (1.19.0)
|
|
55
|
+
parallel (~> 1.10)
|
|
56
|
+
parser (>= 3.0.0.0)
|
|
57
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
58
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
59
|
+
rexml
|
|
60
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
|
61
|
+
ruby-progressbar (~> 1.7)
|
|
62
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
63
|
+
rubocop-ast (1.10.0)
|
|
64
|
+
parser (>= 3.0.1.1)
|
|
65
|
+
rubocop-rspec (2.4.0)
|
|
66
|
+
rubocop (~> 1.0)
|
|
67
|
+
rubocop-ast (>= 1.1.0)
|
|
68
|
+
ruby-progressbar (1.11.0)
|
|
43
69
|
shoulda (3.5.0)
|
|
44
70
|
shoulda-context (~> 1.0, >= 1.0.1)
|
|
45
71
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
@@ -47,19 +73,27 @@ GEM
|
|
|
47
73
|
shoulda-matchers (2.8.0)
|
|
48
74
|
activesupport (>= 3.0.0)
|
|
49
75
|
slop (3.6.0)
|
|
50
|
-
thread_safe (0.3.
|
|
51
|
-
tzinfo (1.2.
|
|
76
|
+
thread_safe (0.3.6)
|
|
77
|
+
tzinfo (1.2.4)
|
|
52
78
|
thread_safe (~> 0.1)
|
|
79
|
+
unicode-display_width (2.0.0)
|
|
53
80
|
|
|
54
81
|
PLATFORMS
|
|
55
82
|
ruby
|
|
56
83
|
|
|
57
84
|
DEPENDENCIES
|
|
85
|
+
activesupport (~> 4.2.2)
|
|
58
86
|
bundler
|
|
59
|
-
|
|
60
|
-
|
|
87
|
+
code-scanning-rubocop (~> 0.5)
|
|
88
|
+
libxml-ruby (~> 3)
|
|
89
|
+
nokogiri (~> 1.11.4)
|
|
61
90
|
opensrs!
|
|
62
91
|
pry
|
|
63
92
|
rake
|
|
64
93
|
rspec
|
|
94
|
+
rubocop (~> 1)
|
|
95
|
+
rubocop-rspec
|
|
65
96
|
shoulda
|
|
97
|
+
|
|
98
|
+
BUNDLED WITH
|
|
99
|
+
1.17.2
|
data/README.md
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
# OpenSRS
|
|
2
2
|
|
|
3
|
-
[](https://gitter.im/voxxit/opensrs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
4
|
-
|
|
5
|
-
[](https://travis-ci.org/voxxit/opensrs)
|
|
6
|
-
[](https://codeclimate.com/github/voxxit/opensrs)
|
|
7
3
|
[](https://coveralls.io/r/voxxit/opensrs)
|
|
8
4
|
|
|
9
|
-
This
|
|
5
|
+
This unofficial OpenSRS gem provides basic support to connect to and utilize the [OpenSRS API.](http://www.opensrs.com/site/resources/documentation/api) This library has been well-tested in high-performance production
|
|
10
6
|
environments.
|
|
11
7
|
|
|
12
8
|
### Requirements
|
|
13
9
|
|
|
14
|
-
* Ruby **>=
|
|
10
|
+
* Ruby **>= 2.5**
|
|
15
11
|
|
|
16
12
|
### Installation
|
|
17
13
|
|
|
@@ -101,7 +97,6 @@ Responses from OpenSRS are returned in an OpenSRS::Response object, which gives
|
|
|
101
97
|
Method | Description
|
|
102
98
|
---|---
|
|
103
99
|
`response.response` | This gives you the response in a Hash form, which is highly accessible to most other actions in your application.
|
|
104
|
-
`response.response` | This gives you the response in a Hash form, which is highly accessible to most other actions in your application.
|
|
105
100
|
`response.errors` | If there are errors which come back from OpenSRS, they are returned here. If not, it returns nil.
|
|
106
101
|
`response.success?` | Returns true if the response was labeled as successful. If not, it returns false.
|
|
107
102
|
`response.request_xml` | Returns raw request XML.
|
|
@@ -126,9 +121,6 @@ If you have any bugs or feature requests for this gem, feel free to [open an iss
|
|
|
126
121
|
|
|
127
122
|
### Copyright
|
|
128
123
|
|
|
129
|
-
Copyright (c) 2010-
|
|
124
|
+
Copyright (c) 2010-2021 Joshua Delsman.
|
|
130
125
|
|
|
131
126
|
Distributed under the MIT license. See `LICENSE` for details.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[](https://bitdeli.com/free "Bitdeli Badge")
|
data/Rakefile
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | ------------------ |
|
|
7
|
+
| 0.4.x | :white_check_mark: |
|
|
8
|
+
| < 0.4.x | :x: |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
Please encyrpt your message to me at https://keybase.io/encrypt#jdelsman, then send to j@srv.im. Since this is an unsupported open-source project, I will get to it as quickly as I can.
|
data/bin/console
CHANGED
data/lib/opensrs.rb
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require
|
|
4
|
-
require
|
|
1
|
+
require 'opensrs/xml_processor'
|
|
2
|
+
require 'opensrs/server'
|
|
3
|
+
require 'opensrs/response'
|
|
4
|
+
require 'opensrs/sanitizable_string'
|
|
5
|
+
require 'opensrs/version'
|
|
5
6
|
|
|
7
|
+
# OpenSRS
|
|
6
8
|
module OpenSRS
|
|
7
9
|
end
|
data/lib/opensrs/response.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module OpenSRS
|
|
2
|
+
# Response
|
|
2
3
|
class Response
|
|
3
4
|
attr_reader :request_xml, :response_xml
|
|
4
5
|
attr_accessor :response, :success
|
|
@@ -13,19 +14,22 @@ module OpenSRS
|
|
|
13
14
|
# We need to return the error message unless the
|
|
14
15
|
# response is successful.
|
|
15
16
|
def errors
|
|
16
|
-
|
|
17
|
-
msg = @response["response_text"]
|
|
18
|
-
code = @response["response_code"]
|
|
17
|
+
return if success?
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
msg = @response['response_text']
|
|
20
|
+
code = @response['response_code']
|
|
21
|
+
|
|
22
|
+
msg && code ? "#{msg} (Code #{code})" : 'Unknown error'
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
# If 'is_success' is returned, the API is letting us know that they
|
|
25
26
|
# will explicitly tell us whether something has succeeded or not.
|
|
26
|
-
#
|
|
27
|
+
#
|
|
28
|
+
# Otherwise, just assume it failed.
|
|
27
29
|
def success?
|
|
28
|
-
|
|
30
|
+
return false unless @response['is_success']
|
|
31
|
+
|
|
32
|
+
@response['is_success'] == '1'
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'delegate'
|
|
2
|
+
|
|
3
|
+
module OpenSRS
|
|
4
|
+
# SanitizableString
|
|
5
|
+
class SanitizableString < SimpleDelegator
|
|
6
|
+
@enable_sanitization = false
|
|
7
|
+
|
|
8
|
+
class << self
|
|
9
|
+
attr_accessor :enable_sanitization
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize(original_string, sanitized_string)
|
|
13
|
+
super(original_string)
|
|
14
|
+
@sanitized_string = sanitized_string
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def sanitized
|
|
18
|
+
self.class.enable_sanitization ? @sanitized_string : self
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/opensrs/server.rb
CHANGED
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require
|
|
4
|
-
require
|
|
1
|
+
require 'uri'
|
|
2
|
+
require 'net/https'
|
|
3
|
+
require 'digest/md5'
|
|
4
|
+
require 'openssl'
|
|
5
5
|
|
|
6
6
|
module OpenSRS
|
|
7
7
|
class OpenSRSError < StandardError; end
|
|
8
8
|
|
|
9
9
|
class BadResponse < OpenSRSError; end
|
|
10
|
+
|
|
10
11
|
class ConnectionError < OpenSRSError; end
|
|
12
|
+
|
|
11
13
|
class TimeoutError < ConnectionError; end
|
|
12
14
|
|
|
15
|
+
# Server
|
|
13
16
|
class Server
|
|
14
|
-
attr_accessor :server, :username, :password, :key, :timeout, :open_timeout, :logger
|
|
17
|
+
attr_accessor :server, :username, :password, :key, :timeout, :open_timeout, :logger, :proxy
|
|
15
18
|
|
|
16
19
|
def initialize(options = {})
|
|
17
|
-
@server = URI.parse(options[:server] ||
|
|
20
|
+
@server = URI.parse(options[:server] || 'https://rr-n1-tor.opensrs.net:55443/')
|
|
18
21
|
@username = options[:username]
|
|
19
22
|
@password = options[:password]
|
|
20
23
|
@key = options[:key]
|
|
21
24
|
@timeout = options[:timeout]
|
|
22
25
|
@open_timeout = options[:open_timeout]
|
|
23
26
|
@logger = options[:logger]
|
|
27
|
+
@proxy = URI.parse(options[:proxy]) if options[:proxy]
|
|
28
|
+
@sanitize_request = options[:sanitize_request]
|
|
29
|
+
|
|
30
|
+
OpenSRS::SanitizableString.enable_sanitization = @sanitize_request
|
|
24
31
|
end
|
|
25
32
|
|
|
26
33
|
def call(data = {})
|
|
27
|
-
xml = xml_processor.build({ :
|
|
28
|
-
log('Request', xml, data)
|
|
34
|
+
xml = xml_processor.build({ protocol: 'XCP' }.merge!(data))
|
|
35
|
+
log('Request', xml.sanitized, data)
|
|
29
36
|
|
|
30
37
|
begin
|
|
31
38
|
response = http.post(server_path, xml, headers(xml))
|
|
32
39
|
log('Response', response.body, data)
|
|
33
40
|
rescue Net::HTTPBadResponse
|
|
34
|
-
raise OpenSRS::BadResponse,
|
|
41
|
+
raise OpenSRS::BadResponse,
|
|
42
|
+
'Received a bad response from OpenSRS. Please check that your IP address is added to the whitelist, and try again.'
|
|
35
43
|
end
|
|
36
44
|
|
|
37
45
|
parsed_response = xml_processor.parse(response.body)
|
|
38
|
-
|
|
39
|
-
rescue Timeout::Error =>
|
|
40
|
-
raise OpenSRS::TimeoutError,
|
|
41
|
-
rescue Errno::ECONNRESET, Errno::ECONNREFUSED =>
|
|
42
|
-
raise OpenSRS::ConnectionError,
|
|
46
|
+
OpenSRS::Response.new(parsed_response, xml.sanitized, response.body)
|
|
47
|
+
rescue Timeout::Error => e
|
|
48
|
+
raise OpenSRS::TimeoutError, e
|
|
49
|
+
rescue Errno::ECONNRESET, Errno::ECONNREFUSED => e
|
|
50
|
+
raise OpenSRS::ConnectionError, e
|
|
43
51
|
end
|
|
44
52
|
|
|
45
53
|
def xml_processor
|
|
@@ -48,17 +56,17 @@ module OpenSRS
|
|
|
48
56
|
|
|
49
57
|
def self.xml_processor=(name)
|
|
50
58
|
require "opensrs/xml_processor/#{name.to_s.downcase}"
|
|
51
|
-
@@xml_processor = OpenSRS::XmlProcessor.const_get(
|
|
59
|
+
@@xml_processor = OpenSRS::XmlProcessor.const_get(name.to_s.capitalize.to_s)
|
|
52
60
|
end
|
|
53
61
|
|
|
54
62
|
private
|
|
55
63
|
|
|
56
64
|
def headers(request)
|
|
57
65
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
'Content-Length' => request.length.to_s,
|
|
67
|
+
'Content-Type' => 'text/xml',
|
|
68
|
+
'X-Username' => username,
|
|
69
|
+
'X-Signature' => signature(request)
|
|
62
70
|
}
|
|
63
71
|
end
|
|
64
72
|
|
|
@@ -67,8 +75,13 @@ module OpenSRS
|
|
|
67
75
|
end
|
|
68
76
|
|
|
69
77
|
def http
|
|
70
|
-
http =
|
|
71
|
-
|
|
78
|
+
http = if @proxy
|
|
79
|
+
Net::HTTP.new(server.host, server.port, @proxy.host, @proxy.port, @proxy.user, @proxy.password)
|
|
80
|
+
else
|
|
81
|
+
Net::HTTP.new(server.host, server.port)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
http.use_ssl = (server.scheme == 'https')
|
|
72
85
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
73
86
|
http.read_timeout = http.open_timeout = @timeout if @timeout
|
|
74
87
|
http.open_timeout = @open_timeout if @open_timeout
|
data/lib/opensrs/version.rb
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
module OpenSRS
|
|
2
|
+
# XmlProcessor
|
|
2
3
|
class XmlProcessor
|
|
3
|
-
|
|
4
4
|
# Parses the main data block from OpenSRS and discards
|
|
5
5
|
# the rest of the response.
|
|
6
6
|
def self.parse(response)
|
|
7
7
|
data_block = data_block_element(response)
|
|
8
8
|
|
|
9
|
-
raise ArgumentError
|
|
9
|
+
raise ArgumentError, 'No data found in document' unless data_block
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
decode_data(data_block)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
protected
|
|
15
|
-
|
|
16
14
|
# Encodes individual elements, and their child elements, for the root XML document.
|
|
17
15
|
def self.encode_data(data, container = nil)
|
|
18
16
|
case data
|
|
@@ -42,11 +40,16 @@ module OpenSRS
|
|
|
42
40
|
# if hash, item will be array of the key & value
|
|
43
41
|
data.each_with_index do |item, index|
|
|
44
42
|
item_node = new_element(:item, container)
|
|
45
|
-
item_node[
|
|
43
|
+
item_node['key'] = item.is_a?(Array) ? item[0].to_s : index.to_s
|
|
46
44
|
|
|
47
45
|
value = item.is_a?(Array) ? item[1] : item
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
encoded_data = encode_data(value, item_node)
|
|
48
|
+
if encoded_data.is_a?(String)
|
|
49
|
+
item_node.content = encoded_data
|
|
50
|
+
else
|
|
51
|
+
item_node << encoded_data
|
|
52
|
+
end
|
|
50
53
|
element << item_node
|
|
51
54
|
end
|
|
52
55
|
|
|
@@ -58,16 +61,16 @@ module OpenSRS
|
|
|
58
61
|
def self.decode_data(data)
|
|
59
62
|
data.each do |element|
|
|
60
63
|
case element.name
|
|
61
|
-
when
|
|
64
|
+
when 'dt_array'
|
|
62
65
|
return decode_dt_array_data(element)
|
|
63
|
-
when
|
|
66
|
+
when 'dt_assoc'
|
|
64
67
|
return decode_dt_assoc_data(element)
|
|
65
|
-
when
|
|
68
|
+
when 'text', 'item', 'dt_scalar'
|
|
66
69
|
next if element.content.strip.empty?
|
|
70
|
+
|
|
67
71
|
return element.content.strip
|
|
68
72
|
end
|
|
69
73
|
end
|
|
70
74
|
end
|
|
71
|
-
|
|
72
75
|
end
|
|
73
76
|
end
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
begin
|
|
2
2
|
require 'libxml'
|
|
3
3
|
rescue LoadError => e
|
|
4
|
-
|
|
4
|
+
warn 'Cannot find `libxml` gem. Please install it before using it as the XML processor'
|
|
5
5
|
raise e
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
module OpenSRS
|
|
9
9
|
class XmlProcessor
|
|
10
|
+
# Libxml
|
|
10
11
|
class Libxml < OpenSRS::XmlProcessor
|
|
11
12
|
include ::LibXML::XML
|
|
12
13
|
|
|
@@ -14,23 +15,35 @@ module OpenSRS
|
|
|
14
15
|
# go ahead and build the entire XML document to send to OpenSRS.
|
|
15
16
|
def self.build(data)
|
|
16
17
|
xml = Document.new
|
|
17
|
-
xml.root = envelope = Node.new(
|
|
18
|
+
xml.root = envelope = Node.new('OPS_envelope')
|
|
18
19
|
|
|
19
|
-
envelope << header = Node.new(
|
|
20
|
-
envelope << body = Node.new(
|
|
21
|
-
header << Node.new(
|
|
22
|
-
body << data_block = Node.new(
|
|
20
|
+
envelope << header = Node.new('header')
|
|
21
|
+
envelope << body = Node.new('body')
|
|
22
|
+
header << Node.new('version', '0.9')
|
|
23
|
+
body << data_block = Node.new('data_block')
|
|
23
24
|
|
|
24
25
|
data_block << encode_data(data, data_block)
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
OpenSRS::SanitizableString.new(xml.to_s, sanitize(xml).to_s)
|
|
27
28
|
end
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
def self.sanitize(doc)
|
|
31
|
+
# Before changing the iteration through the nodes, read:
|
|
32
|
+
# https://www.rubydoc.info/gems/libxml-ruby/LibXML/XML/Document#find-instance_method
|
|
33
|
+
|
|
34
|
+
username_nodes = doc.find("//item[@key='reg_username']")
|
|
35
|
+
username_nodes.each { |node| node.content = 'FILTERED' }
|
|
36
|
+
|
|
37
|
+
password_nodes = doc.find("//item[@key='reg_password']")
|
|
38
|
+
password_nodes.each { |node| node.content = 'FILTERED' }
|
|
39
|
+
|
|
40
|
+
doc
|
|
41
|
+
end
|
|
42
|
+
private_class_method :sanitize
|
|
30
43
|
|
|
31
44
|
def self.data_block_element(response)
|
|
32
45
|
doc = Parser.string(response).parse
|
|
33
|
-
|
|
46
|
+
doc.find('//OPS_envelope/body/data_block/*')
|
|
34
47
|
end
|
|
35
48
|
|
|
36
49
|
def self.decode_dt_array_data(element)
|
|
@@ -38,10 +51,11 @@ module OpenSRS
|
|
|
38
51
|
|
|
39
52
|
element.children.each do |item|
|
|
40
53
|
next if item.empty?
|
|
41
|
-
|
|
54
|
+
|
|
55
|
+
dt_array[item.attributes['key'].to_i] = decode_data(item)
|
|
42
56
|
end
|
|
43
57
|
|
|
44
|
-
|
|
58
|
+
dt_array
|
|
45
59
|
end
|
|
46
60
|
|
|
47
61
|
def self.decode_dt_assoc_data(element)
|
|
@@ -49,19 +63,19 @@ module OpenSRS
|
|
|
49
63
|
|
|
50
64
|
element.children.each do |item|
|
|
51
65
|
next if item.content.strip.empty?
|
|
52
|
-
|
|
66
|
+
|
|
67
|
+
dt_assoc[item.attributes['key']] = decode_data(item)
|
|
53
68
|
end
|
|
54
69
|
|
|
55
|
-
|
|
70
|
+
dt_assoc
|
|
56
71
|
end
|
|
57
72
|
|
|
58
73
|
# Accepts two parameters but uses only one; to keep the interface same as other xml parser classes
|
|
59
74
|
# Is that a side effect of Template pattern?
|
|
60
75
|
#
|
|
61
|
-
def self.new_element(element_name,
|
|
62
|
-
|
|
76
|
+
def self.new_element(element_name, _container)
|
|
77
|
+
Node.new(element_name.to_s)
|
|
63
78
|
end
|
|
64
|
-
|
|
65
79
|
end
|
|
66
80
|
end
|
|
67
81
|
end
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
begin
|
|
2
2
|
require 'nokogiri'
|
|
3
3
|
rescue LoadError => e
|
|
4
|
-
|
|
4
|
+
warn 'Cannot find `nokogiri` gem. Please install it before using it as the XML processor'
|
|
5
5
|
raise e
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
module OpenSRS
|
|
9
9
|
class XmlProcessor
|
|
10
|
+
# Nokogiri
|
|
10
11
|
class Nokogiri < OpenSRS::XmlProcessor
|
|
11
|
-
|
|
12
12
|
def self.build(data)
|
|
13
13
|
builder = ::Nokogiri::XML::Builder.new
|
|
14
14
|
|
|
15
|
-
envelope = ::Nokogiri::XML::Node.new(
|
|
16
|
-
header = ::Nokogiri::XML::Node.new(
|
|
17
|
-
version = ::Nokogiri::XML::Node.new(
|
|
18
|
-
body = ::Nokogiri::XML::Node.new(
|
|
19
|
-
data_block = ::Nokogiri::XML::Node.new(
|
|
15
|
+
envelope = ::Nokogiri::XML::Node.new('OPS_envelope', builder.doc)
|
|
16
|
+
header = ::Nokogiri::XML::Node.new('header', builder.doc)
|
|
17
|
+
version = ::Nokogiri::XML::Node.new('version', builder.doc)
|
|
18
|
+
body = ::Nokogiri::XML::Node.new('body', builder.doc)
|
|
19
|
+
data_block = ::Nokogiri::XML::Node.new('data_block', builder.doc)
|
|
20
20
|
other_data = encode_data(data, builder.doc)
|
|
21
21
|
version << '0.9'
|
|
22
22
|
header << version
|
|
@@ -25,14 +25,25 @@ module OpenSRS
|
|
|
25
25
|
data_block << other_data
|
|
26
26
|
body << data_block
|
|
27
27
|
envelope << body
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
OpenSRS::SanitizableString.new(builder.to_xml, sanitize(builder.to_xml))
|
|
29
30
|
end
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
def self.sanitize(xml_string)
|
|
33
|
+
doc = ::Nokogiri::XML(xml_string)
|
|
34
|
+
doc.xpath("//item[@key='reg_username']").each do |node|
|
|
35
|
+
node.content = 'FILTERED'
|
|
36
|
+
end
|
|
37
|
+
doc.xpath("//item[@key='reg_password']").each do |node|
|
|
38
|
+
node.content = 'FILTERED'
|
|
39
|
+
end
|
|
40
|
+
doc.to_xml
|
|
41
|
+
end
|
|
42
|
+
private_class_method :sanitize
|
|
32
43
|
|
|
33
44
|
def self.data_block_element(response)
|
|
34
45
|
doc = ::Nokogiri::XML(response)
|
|
35
|
-
|
|
46
|
+
doc.xpath('//OPS_envelope/body/data_block/*')
|
|
36
47
|
end
|
|
37
48
|
|
|
38
49
|
def self.decode_dt_array_data(element)
|
|
@@ -40,10 +51,11 @@ module OpenSRS
|
|
|
40
51
|
|
|
41
52
|
element.children.each do |item|
|
|
42
53
|
next if item.content.strip.empty?
|
|
43
|
-
|
|
54
|
+
|
|
55
|
+
dt_array[item.attributes['key'].value.to_i] = decode_data(item.children)
|
|
44
56
|
end
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
dt_array
|
|
47
59
|
end
|
|
48
60
|
|
|
49
61
|
def self.decode_dt_assoc_data(element)
|
|
@@ -51,16 +63,16 @@ module OpenSRS
|
|
|
51
63
|
|
|
52
64
|
element.children.each do |item|
|
|
53
65
|
next if item.content.strip.empty?
|
|
54
|
-
|
|
66
|
+
|
|
67
|
+
dt_assoc[item.attributes['key'].value] = decode_data(item.children)
|
|
55
68
|
end
|
|
56
69
|
|
|
57
|
-
|
|
70
|
+
dt_assoc
|
|
58
71
|
end
|
|
59
72
|
|
|
60
73
|
def self.new_element(element_name, container)
|
|
61
|
-
|
|
74
|
+
::Nokogiri::XML::Node.new(element_name.to_s, container)
|
|
62
75
|
end
|
|
63
|
-
|
|
64
76
|
end
|
|
65
77
|
end
|
|
66
78
|
end
|
data/opensrs.gemspec
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require
|
|
3
|
+
require 'opensrs/version'
|
|
5
4
|
|
|
6
5
|
Gem::Specification.new do |spec|
|
|
7
|
-
|
|
8
|
-
spec.name = "opensrs"
|
|
6
|
+
spec.name = 'opensrs'
|
|
9
7
|
spec.version = OpenSRS::VERSION
|
|
10
|
-
spec.authors = [
|
|
11
|
-
spec.email = [
|
|
12
|
-
spec.summary =
|
|
13
|
-
spec.description =
|
|
14
|
-
spec.homepage =
|
|
15
|
-
spec.license =
|
|
8
|
+
spec.authors = ['Joshua Delsman']
|
|
9
|
+
spec.email = ['j@srv.im']
|
|
10
|
+
spec.summary = 'OpenSRS API for Ruby'
|
|
11
|
+
spec.description = 'Provides support to utilize the OpenSRS API with Ruby.'
|
|
12
|
+
spec.homepage = 'https://github.com/voxxit/opensrs'
|
|
13
|
+
spec.license = 'MIT'
|
|
14
|
+
spec.required_ruby_version = '~> 2.5'
|
|
16
15
|
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
18
|
-
spec.bindir =
|
|
17
|
+
spec.bindir = 'exe'
|
|
19
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
|
-
spec.require_paths = [
|
|
19
|
+
spec.require_paths = ['lib']
|
|
21
20
|
|
|
22
|
-
spec.add_development_dependency
|
|
23
|
-
spec.add_development_dependency
|
|
24
|
-
spec.add_development_dependency
|
|
25
|
-
spec.add_development_dependency
|
|
26
|
-
spec.add_development_dependency
|
|
27
|
-
spec.add_development_dependency
|
|
28
|
-
spec.add_development_dependency
|
|
21
|
+
spec.add_development_dependency 'activesupport', '~> 4.2.2'
|
|
22
|
+
spec.add_development_dependency 'bundler'
|
|
23
|
+
spec.add_development_dependency 'code-scanning-rubocop', '~> 0.5'
|
|
24
|
+
spec.add_development_dependency 'libxml-ruby', '~> 3'
|
|
25
|
+
spec.add_development_dependency 'nokogiri', '~> 1.11.4'
|
|
26
|
+
spec.add_development_dependency 'pry'
|
|
27
|
+
spec.add_development_dependency 'rake'
|
|
28
|
+
spec.add_development_dependency 'rspec'
|
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 1'
|
|
30
|
+
spec.add_development_dependency 'rubocop-rspec'
|
|
31
|
+
spec.add_development_dependency 'shoulda'
|
|
29
32
|
end
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opensrs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Delsman
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: activesupport
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.2.2
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 4.2.2
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: bundler
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -39,7 +39,49 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: code-scanning-rubocop
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0.5'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0.5'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: libxml-ruby
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '3'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: nokogiri
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 1.11.4
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 1.11.4
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: pry
|
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
|
44
86
|
requirements:
|
|
45
87
|
- - ">="
|
|
@@ -53,7 +95,7 @@ dependencies:
|
|
|
53
95
|
- !ruby/object:Gem::Version
|
|
54
96
|
version: '0'
|
|
55
97
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
98
|
+
name: rake
|
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
|
58
100
|
requirements:
|
|
59
101
|
- - ">="
|
|
@@ -67,7 +109,7 @@ dependencies:
|
|
|
67
109
|
- !ruby/object:Gem::Version
|
|
68
110
|
version: '0'
|
|
69
111
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
112
|
+
name: rspec
|
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
|
72
114
|
requirements:
|
|
73
115
|
- - ">="
|
|
@@ -81,7 +123,21 @@ dependencies:
|
|
|
81
123
|
- !ruby/object:Gem::Version
|
|
82
124
|
version: '0'
|
|
83
125
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
126
|
+
name: rubocop
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '1'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '1'
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: rubocop-rspec
|
|
85
141
|
requirement: !ruby/object:Gem::Requirement
|
|
86
142
|
requirements:
|
|
87
143
|
- - ">="
|
|
@@ -95,7 +151,7 @@ dependencies:
|
|
|
95
151
|
- !ruby/object:Gem::Version
|
|
96
152
|
version: '0'
|
|
97
153
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
154
|
+
name: shoulda
|
|
99
155
|
requirement: !ruby/object:Gem::Requirement
|
|
100
156
|
requirements:
|
|
101
157
|
- - ">="
|
|
@@ -116,17 +172,21 @@ extensions: []
|
|
|
116
172
|
extra_rdoc_files: []
|
|
117
173
|
files:
|
|
118
174
|
- ".document"
|
|
175
|
+
- ".github/workflows/rubocop-analysis.yml"
|
|
119
176
|
- ".gitignore"
|
|
120
177
|
- ".rspec"
|
|
178
|
+
- ".rubocop.yml"
|
|
121
179
|
- Gemfile
|
|
122
180
|
- Gemfile.lock
|
|
123
181
|
- LICENSE.txt
|
|
124
182
|
- README.md
|
|
125
183
|
- Rakefile
|
|
184
|
+
- SECURITY.md
|
|
126
185
|
- bin/console
|
|
127
186
|
- bin/setup
|
|
128
187
|
- lib/opensrs.rb
|
|
129
188
|
- lib/opensrs/response.rb
|
|
189
|
+
- lib/opensrs/sanitizable_string.rb
|
|
130
190
|
- lib/opensrs/server.rb
|
|
131
191
|
- lib/opensrs/version.rb
|
|
132
192
|
- lib/opensrs/xml_processor.rb
|
|
@@ -137,25 +197,23 @@ homepage: https://github.com/voxxit/opensrs
|
|
|
137
197
|
licenses:
|
|
138
198
|
- MIT
|
|
139
199
|
metadata: {}
|
|
140
|
-
post_install_message:
|
|
200
|
+
post_install_message:
|
|
141
201
|
rdoc_options: []
|
|
142
202
|
require_paths:
|
|
143
203
|
- lib
|
|
144
204
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
205
|
requirements:
|
|
146
|
-
- - "
|
|
206
|
+
- - "~>"
|
|
147
207
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: '
|
|
208
|
+
version: '2.5'
|
|
149
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
210
|
requirements:
|
|
151
211
|
- - ">="
|
|
152
212
|
- !ruby/object:Gem::Version
|
|
153
213
|
version: '0'
|
|
154
214
|
requirements: []
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
signing_key:
|
|
215
|
+
rubygems_version: 3.0.3.1
|
|
216
|
+
signing_key:
|
|
158
217
|
specification_version: 4
|
|
159
218
|
summary: OpenSRS API for Ruby
|
|
160
219
|
test_files: []
|
|
161
|
-
has_rdoc:
|