nokogiri-xmlsec-instructure 0.10.1 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72eea7707ea8c4d24e0cb82afc804752be0313d810554ca54f4ea9e4a3f857e9
4
- data.tar.gz: 4641d782e76a25aa3f251ff160f04d66198a1c2c3a4020f625dc29f7bbe5e365
3
+ metadata.gz: 3d80bf299c2e7900122535982dfde8b7b6ab67ea53528b0b055c3758b9b9753f
4
+ data.tar.gz: 379cbbff6fc67ac23cf9d604d15aea36f79e58418b034dcf5e5b45db3c86a739
5
5
  SHA512:
6
- metadata.gz: f116055729f4a0bddbee6432c99e9f505aad12a45452121d4fb14414de8eaf613009db60d28d55a7e7c8b7c5678e67e7d3a297741186f4e9eabcf4d08b88385c
7
- data.tar.gz: d73b7b9d8ff63621b3162b4d83dfcf8ffd52b253d589fc863ef44d47847801e23ad8a386b4459a933431c5eaef0e377051089e8c4af06cde05522e3d390f4ae3
6
+ metadata.gz: e87ccfb10dfc8d9afe6964c58f4a56179fde5faa0ab007fb8bb5b62a038d6bc609d7f96efc09fbc394d3e51af568f3134133d87d5a843d6a456fe949dca464c2
7
+ data.tar.gz: 705acc4113dc8380a29c3ef001a19eceda6a128e9c08441a3ebd9f135452f5d0a22419d8cfdd64f2002841132687f10f84af09fe998d19f701aeff5d4860e21a
@@ -0,0 +1,40 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby-version: [3.0, 2.7]
18
+ gemfile: ['gemfiles/nokogiri_13.10.gemfile', 'gemfiles/nokogiri_12.5.gemfile']
19
+
20
+ steps:
21
+ - name: Install libxmlsec
22
+ run: |
23
+ sudo apt-get update
24
+ sudo apt-get install -y libxmlsec1-dev
25
+ - uses: actions/checkout@v3
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true
31
+ env:
32
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
33
+ - name: Install dependencies
34
+ run: bundle install
35
+ env:
36
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
37
+ - name: Run tests
38
+ run: bundle exec rake
39
+ env:
40
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  spec/old
21
21
  *.so
22
22
  *.sw[opn]
23
+ *.gemfile.lock
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.0.4
data/Appraisals ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "nokogiri-13.10" do
4
+ gem "nokogiri", "1.13.10"
5
+ end
6
+
7
+ appraise "nokogiri-12.5" do
8
+ gem "nokogiri", "1.12.5"
9
+ end
@@ -1,4 +1,5 @@
1
1
  require 'mkmf'
2
+ require 'nokogiri'
2
3
 
3
4
  def barf message = 'dependencies not met'
4
5
  raise message
@@ -10,18 +11,12 @@ pkg_config('xmlsec1')
10
11
  $CFLAGS << " " + `xmlsec1-config --cflags`.strip
11
12
  $CFLAGS << " -fvisibility=hidden"
12
13
 
13
- if $CFLAGS =~ /\-DXMLSEC_CRYPTO=\\\\\\"openssl\\\\\\"/
14
- puts "Changing escaping: #{$CFLAGS}"
15
- $CFLAGS['-DXMLSEC_CRYPTO=\\\\\\"openssl\\\\\\"'] =
16
- '-DXMLSEC_CRYPTO=\\"openssl\\"'
17
- end
18
-
19
- if $CFLAGS =~ /\-DXMLSEC_CRYPTO="openssl"/
20
- puts "Ensure we escaping: #{$CFLAGS}"
21
- $CFLAGS['-DXMLSEC_CRYPTO="openssl"'] =
22
- '-DXMLSEC_CRYPTO=\\"openssl\\"'
23
- end
14
+ $CFLAGS << Dir[Gem.loaded_specs['nokogiri'].full_gem_path + "/ext/*"].map { |dir| " -I#{dir}"}.join("")
24
15
 
25
- puts "Clfags: #{$CFLAGS}"
16
+ puts "Cflags: #{$CFLAGS}"
26
17
  $libs = `xmlsec1-config --libs`.strip
18
+
19
+ # We reference symbols out of nokogiri but don't link directly against it
20
+ $LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
21
+
27
22
  create_makefile('nokogiri_ext_xmlsec')
@@ -47,7 +47,7 @@ void Init_nokogiri_ext_xmlsec() {
47
47
  }
48
48
  // load crypto
49
49
  #ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING
50
- if(xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) {
50
+ if(xmlSecCryptoDLLoadLibrary(NULL) < 0) {
51
51
  rb_raise(rb_eRuntimeError,
52
52
  "Error: unable to load default xmlsec-crypto library. Make sure"
53
53
  "that you have it installed and check shared libraries path\n"
@@ -1,11 +1,6 @@
1
1
  #include "xmlsecrb.h"
2
2
  #include "util.h"
3
3
 
4
- // technically we should include nokogiri.h, but we don't know
5
- // how to find it. we _know_ this function will exist at runtime
6
- // though, so just declare it here
7
- void noko_xml_document_pin_node(xmlNodePtr);
8
-
9
4
  VALUE decrypt_with_key(VALUE self, VALUE rb_key_name, VALUE rb_key) {
10
5
  VALUE rb_exception_result = Qnil;
11
6
  const char* exception_message = NULL;
@@ -21,7 +16,7 @@ VALUE decrypt_with_key(VALUE self, VALUE rb_key_name, VALUE rb_key) {
21
16
 
22
17
  Check_Type(rb_key, T_STRING);
23
18
  Check_Type(rb_key_name, T_STRING);
24
- Data_Get_Struct(self, xmlNode, node);
19
+ Noko_Node_Get_Struct(self, xmlNode, node);
25
20
  key = RSTRING_PTR(rb_key);
26
21
  keyLength = RSTRING_LEN(rb_key);
27
22
  keyName = StringValueCStr(rb_key_name);
@@ -53,7 +53,7 @@ VALUE encrypt_with_key(VALUE self, VALUE rb_rsa_key_name, VALUE rb_rsa_key,
53
53
  goto done;
54
54
  }
55
55
 
56
- Data_Get_Struct(self, xmlNode, node);
56
+ Noko_Node_Get_Struct(self, xmlNode, node);
57
57
  doc = node->doc;
58
58
 
59
59
  // create encryption template to encrypt XML file and replace
@@ -1,9 +1,6 @@
1
1
  #include "xmlsecrb.h"
2
2
  #include "util.h"
3
3
 
4
- // declaration from Nokogiri proper
5
- VALUE noko_xml_node_wrap(VALUE klass, xmlNodePtr node) ;
6
-
7
4
  VALUE set_id_attribute(VALUE self, VALUE rb_attr_name) {
8
5
  VALUE rb_exception_result = Qnil;
9
6
  const char* exception_message = NULL;
@@ -17,7 +14,7 @@ VALUE set_id_attribute(VALUE self, VALUE rb_attr_name) {
17
14
 
18
15
  resetXmlSecError();
19
16
 
20
- Data_Get_Struct(self, xmlNode, node);
17
+ Noko_Node_Get_Struct(self, xmlNode, node);
21
18
  Check_Type(rb_attr_name, T_STRING);
22
19
  idName = StringValueCStr(rb_attr_name);
23
20
 
@@ -86,7 +83,7 @@ VALUE get_id(VALUE self, VALUE rb_id)
86
83
  xmlDocPtr doc;
87
84
 
88
85
  Check_Type(rb_id, T_STRING);
89
- Data_Get_Struct(self, xmlDoc, doc);
86
+ Noko_Node_Get_Struct(self, xmlDoc, doc);
90
87
  prop = xmlGetID(doc, (const xmlChar *)StringValueCStr(rb_id));
91
88
  if (prop) {
92
89
  return noko_xml_node_wrap(Qnil, (xmlNodePtr)prop);
@@ -90,7 +90,7 @@ VALUE sign(VALUE self, VALUE rb_opts) {
90
90
  goto done;
91
91
  }
92
92
 
93
- Data_Get_Struct(self, xmlNode, envelopeNode);
93
+ Noko_Node_Get_Struct(self, xmlNode, envelopeNode);
94
94
  doc = envelopeNode->doc;
95
95
  // create signature template for enveloped signature.
96
96
  signNode = xmlSecTmplSignatureCreate(doc, xmlSecTransformExclC14NId,
@@ -146,7 +146,7 @@ VALUE verify_with(VALUE self, VALUE rb_opts) {
146
146
  resetXmlSecError();
147
147
 
148
148
  Check_Type(rb_opts, T_HASH);
149
- Data_Get_Struct(self, xmlNode, node);
149
+ Noko_Node_Get_Struct(self, xmlNode, node);
150
150
 
151
151
  // verify start node
152
152
  if(!xmlSecCheckNodeName(node, xmlSecNodeSignature, xmlSecDSigNs)) {
@@ -20,6 +20,12 @@
20
20
  #include <xmlsec/crypto.h>
21
21
  #include <xmlsec/errors.h>
22
22
 
23
+ #include <nokogiri.h>
24
+ // Lifted from modern nokogiri.h
25
+ #ifndef Noko_Node_Get_Struct
26
+ #define Noko_Node_Get_Struct(obj,type,sval) ((sval) = (type*)DATA_PTR(obj))
27
+ #endif
28
+
23
29
  // TODO(awong): Support non-gcc and non-clang compilers.
24
30
  #define EXTENSION_EXPORT __attribute__((visibility("default")))
25
31
 
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "nokogiri", "1.12.5"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "nokogiri", "1.13.10"
6
+
7
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module Xmlsec
2
- VERSION = '0.10.1'
2
+ VERSION = '0.10.3'
3
3
  end
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_dependency 'nokogiri', '>= 1.11.2'
32
32
 
33
+ spec.add_development_dependency "appraisal"
33
34
  spec.add_development_dependency "bundler", "~> 2.1"
34
35
  spec.add_development_dependency "byebug"
35
36
  spec.add_development_dependency "rake"
@@ -32,7 +32,8 @@ eymfHtzOeY86WyvfsjZmaz2XnIo9dzZsK71yMEKkgvXQnnYy9pK0NaYcG0B0hcii
32
32
  gSVEWpEpCSo560x0mSuLnJYdQQzZ/L6xvxZ1AgMBAAEwDQYJKoZIhvcNAQEFBQAD
33
33
  gYEATyK/RlfpohUVimgFkycTF2hyusjctseXoZDCctgg/STMsL8iA0P9YB6k91GC
34
34
  kWpwevuiwarD1MfSUV6goPINFkIBvfK+5R9lpHaTqqs615z8T9R5VJgaLcFe3tWd
35
- 7oq3V2q5Nl6MrZfXj2N07qe6/9zfdauxYO26vAEKCvIkbMo=</X509Certificate>
35
+ 7oq3V2q5Nl6MrZfXj2N07qe6/9zfdauxYO26vAEKCvIkbMo=
36
+ </X509Certificate>
36
37
  </X509Data>
37
38
  </KeyInfo>
38
39
  </Signature></Envelope>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri-xmlsec-instructure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert J. Wong
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-08 00:00:00.000000000 Z
12
+ date: 2025-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 1.11.2
28
+ - !ruby/object:Gem::Dependency
29
+ name: appraisal
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: bundler
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -140,9 +154,11 @@ extensions:
140
154
  - ext/nokogiri_ext_xmlsec/extconf.rb
141
155
  extra_rdoc_files: []
142
156
  files:
157
+ - ".github/workflows/push.yml"
143
158
  - ".gitignore"
144
159
  - ".rspec"
145
- - ".travis.yml"
160
+ - ".tool-versions"
161
+ - Appraisals
146
162
  - Gemfile
147
163
  - Guardfile
148
164
  - LICENSE.txt
@@ -163,6 +179,8 @@ files:
163
179
  - ext/nokogiri_ext_xmlsec/util.c
164
180
  - ext/nokogiri_ext_xmlsec/util.h
165
181
  - ext/nokogiri_ext_xmlsec/xmlsecrb.h
182
+ - gemfiles/nokogiri_12.5.gemfile
183
+ - gemfiles/nokogiri_13.10.gemfile
166
184
  - lib/nokogiri-xmlsec.rb
167
185
  - lib/xmlsec.rb
168
186
  - lib/xmlsec/version.rb
@@ -201,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
219
  - !ruby/object:Gem::Version
202
220
  version: '0'
203
221
  requirements: []
204
- rubygems_version: 3.2.15
222
+ rubygems_version: 3.5.11
205
223
  signing_key:
206
224
  specification_version: 4
207
225
  summary: Wrapper around http://www.aleksey.com/xmlsec to support XML encryption, decryption,
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- before_install:
2
- - sudo apt-get update -qq
3
- - sudo apt-get install -y libxmlsec1-dev