nokogiri-xmlsec-instructure 0.10.1 → 0.10.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: 72eea7707ea8c4d24e0cb82afc804752be0313d810554ca54f4ea9e4a3f857e9
4
- data.tar.gz: 4641d782e76a25aa3f251ff160f04d66198a1c2c3a4020f625dc29f7bbe5e365
3
+ metadata.gz: 81d08ea19b4230b07f26533b8dc8d556a889e207a2a6194575231c5cf0aae318
4
+ data.tar.gz: '09595d365865a363d7395dec3289976fb852bf8dad138e497b40d1138f486083'
5
5
  SHA512:
6
- metadata.gz: f116055729f4a0bddbee6432c99e9f505aad12a45452121d4fb14414de8eaf613009db60d28d55a7e7c8b7c5678e67e7d3a297741186f4e9eabcf4d08b88385c
7
- data.tar.gz: d73b7b9d8ff63621b3162b4d83dfcf8ffd52b253d589fc863ef44d47847801e23ad8a386b4459a933431c5eaef0e377051089e8c4af06cde05522e3d390f4ae3
6
+ metadata.gz: 0bf88cdf158f4766183b1e82bdcd4d68411caa0542773f5327a1d2cf74f04c3e7444a446d8bb3088cac4be596d2a61ffcdec85ca781a8078d00a7690c0c773a0
7
+ data.tar.gz: '02939e5f9cce8e6cc15f49befa60956ea9b72a0a461d7ee0c886233ca21795083e946a8140a83e1c5c317a7e3006d3bc1ab1bd689e414be0795bb5540691d6a4'
@@ -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
@@ -22,6 +23,12 @@ puts "Ensure we escaping: #{$CFLAGS}"
22
23
  '-DXMLSEC_CRYPTO=\\"openssl\\"'
23
24
  end
24
25
 
26
+ $CFLAGS << Dir[Gem.loaded_specs['nokogiri'].full_gem_path + "/ext/*"].map { |dir| " -I#{dir}"}.join("")
27
+
25
28
  puts "Clfags: #{$CFLAGS}"
26
29
  $libs = `xmlsec1-config --libs`.strip
30
+
31
+ # We reference symbols out of nokogiri but don't link directly against it
32
+ $LDFLAGS << ' -Wl,-undefined,dynamic_lookup'
33
+
27
34
  create_makefile('nokogiri_ext_xmlsec')
@@ -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.2'
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"
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.2
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: 2022-12-13 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.2.33
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