xmlenc 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 8dc37fb9c2a756e30492c8713cadbbd5757db889
4
- data.tar.gz: 2217523b1fca27126ee8eb4cee15d95343c3c27f
3
+ metadata.gz: f1cd8be205f4d884ef3f5e43dc22d200ec6980be
4
+ data.tar.gz: 19155cd49f925eeed4c443a77023e766175a6c5d
5
5
  SHA512:
6
- metadata.gz: 5e3395a8f9d927b54334c5ce9fc981e54956708fff72f5b6ce05cfd0ed46b481eef7753bbd0e12ab56e74828ce8b55d3084e11206abe015c211fdee81fcdb4e7
7
- data.tar.gz: 84b10748b719e2f0a844d83249cfe4da5cbb59304daeb523e27bfa8a5035c698dcea445a946e26d76d5f442937f5ac4678fc06e729de785bac9791230750f36b
6
+ metadata.gz: ffe48439bb5b226859055c8cf469382213e71a314a2f0aa0b1e242ad986517b0e8ca5ee40808dd0a70fdfbb04508649b9057cc26f626fe79f36897e79145fc60
7
+ data.tar.gz: a361d62f33feeb06db5765a5c319a61f7163116396b6f8c03df6ddec68af692f7d3f828a76d784df84ea1da387ee8773b2540cee0ecded33c6ee2ecb71415ca6
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0
5
+ - 2.1
6
+ - 2.2
7
+ - jruby-19mode
8
+ matrix:
9
+ allow_failures:
10
+ - rvm: jruby-19mode
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ [![Build Status](https://travis-ci.org/digidentity/xmlenc.svg)](https://travis-ci.org/digidentity/xmlenc)
2
+ [![Coverage Status](https://coveralls.io/repos/digidentity/xmlenc/badge.svg?branch=master&service=github)](https://coveralls.io/github/digidentity/xmlenc?branch=master)
3
+ [![Code Climate](https://codeclimate.com/github/digidentity/xmlenc/badges/gpa.svg)](https://codeclimate.com/github/digidentity/xmlenc)
4
+
1
5
  # Xmlenc
2
6
 
3
7
  This gem is a (partial) implementation of the XMLEncryption specification (http://www.w3.org/TR/xmlenc-core/)
data/Rakefile CHANGED
@@ -1 +1,16 @@
1
- require "bundler/gem_tasks"
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ require "rspec/core/rake_task"
9
+
10
+ RSpec::Core::RakeTask.new(:core) do |spec|
11
+ spec.rspec_opts = ['--backtrace']
12
+ end
13
+
14
+ task :default => [:core]
15
+
16
+ Bundler::GemHelper.install_tasks
@@ -5,6 +5,9 @@ module Xmlenc
5
5
 
6
6
  tag "RetrievalMethod"
7
7
 
8
+ register_namespace 'ds', Xmlenc::NAMESPACES[:ds]
9
+ namespace 'ds'
10
+
8
11
  attribute :type, String, :tag => "Type"
9
12
  attribute :uri, String, :tag => "URI"
10
13
 
@@ -1,3 +1,3 @@
1
1
  module Xmlenc
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -4,6 +4,7 @@
4
4
  <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
5
5
  <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
6
6
  <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
7
+ <ds:RetrievalMethod URI="#_EK"/>
7
8
  <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#">
8
9
  <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
9
10
  <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
@@ -7,7 +7,7 @@ describe Xmlenc::Builder::KeyInfo do
7
7
 
8
8
  describe "optional fields" do
9
9
  subject { described_class.new }
10
-
10
+
11
11
  [:key_name, :retrieval_method, :encrypted_key].each do |field|
12
12
  it "should have the #{field} field" do
13
13
  expect(subject).to respond_to field
@@ -2,8 +2,13 @@ require "spec_helper"
2
2
 
3
3
  describe Xmlenc::Builder::RetrievalMethod do
4
4
 
5
- let(:xml) { File.read File.join("spec", "fixtures", "encrypted_document.xml") }
6
- subject { described_class.parse(xml) }
5
+ it 'has a tag' do
6
+ expect(described_class.tag_name).to eq 'RetrievalMethod'
7
+ end
8
+
9
+ it 'has a namespace' do
10
+ expect(described_class.namespace).to eq 'ds'
11
+ end
7
12
 
8
13
  describe "optional fields" do
9
14
  subject { described_class.new }
@@ -19,4 +24,18 @@ describe Xmlenc::Builder::RetrievalMethod do
19
24
  end
20
25
  end
21
26
  end
27
+
28
+ describe '#parse' do
29
+ let(:xml) { File.read File.join('spec', 'fixtures', 'encrypted_document.xml') }
30
+ subject { described_class.parse(xml, :single => true) }
31
+
32
+ it 'should parse' do
33
+ expect(subject).to be_a described_class
34
+ end
35
+
36
+ it 'should parse the URI' do
37
+ expect(subject.uri).to eq '#_EK'
38
+ end
39
+ end
40
+
22
41
  end
data/spec/spec_helper.rb CHANGED
@@ -5,6 +5,9 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
 
8
+ require 'coveralls'
9
+ Coveralls.wear!
10
+
8
11
  require 'xmlenc'
9
12
  require 'rspec/rails/extensions'
10
13
 
data/xmlenc.gemspec CHANGED
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "bundler", "~> 1.3"
33
33
  spec.add_development_dependency "rspec-rails", "~> 2.14"
34
34
  spec.add_development_dependency "rake"
35
+ spec.add_development_dependency "coveralls"
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlenc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: A (partial)implementation of the XMLENC specificiation
112
126
  email:
113
127
  - bclaassen@digidentity.eu
@@ -117,6 +131,7 @@ extra_rdoc_files: []
117
131
  files:
118
132
  - ".gitignore"
119
133
  - ".rspec"
134
+ - ".travis.yml"
120
135
  - Gemfile
121
136
  - LICENSE.txt
122
137
  - README.md