saml-kit 0.3.2 → 0.3.3

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
- SHA1:
3
- metadata.gz: a31d9e6b238e73228d1d269234b34cea16bcfea3
4
- data.tar.gz: 94390f23ed750aa43918c13d911f08c1d6e2ac11
2
+ SHA256:
3
+ metadata.gz: 2f508b63e1c4a756a1cf1bba2838d7d6f1eccab89fadfd9340e8feea7fbc3bbe
4
+ data.tar.gz: 4bc17eefc4e5f161fbd742feda0799a71aba8c47798afcdfb87836cad87d2250
5
5
  SHA512:
6
- metadata.gz: a8c232f1150b087d53a57179ecd3c10d9fc18fb9903a641f22bc4370f25bc25b9f5a719a8ddd9d8447dc08d5a2af58c93d0a1adfa75b5c7b1ec7a0811df8edcd
7
- data.tar.gz: cb261c42f841378781acab2638794c9278aa3a9d18ad4dc83d44facdd3c4f83247912b1c671edc3fa635eb757e682b8007358d22325ea1e23d251f228d800788
6
+ metadata.gz: 508ac70227d5b7ba61c0739be68c06c157414bff7f2e94efd5c1b15555a49ed3a55ca7c8d4ba3cf609a114c646bdaebccf6d046cf8fc087b67e3cf9961463297
7
+ data.tar.gz: 957464028e1fcd692ee6da5ad2977554b279d22a4eec09c6ab1f24f8bfc8d8de877b1aa7c3b7177d762de861c4c3b0390f418658acb817bdb745e5e4941a6e8d
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/saml-kit.svg)](https://rubygems.org/gems/saml-kit)
4
4
  [![Code Climate](https://codeclimate.com/github/saml-kit/saml-kit.svg)](https://codeclimate.com/github/saml-kit/saml-kit)
5
5
  [![Build Status](https://travis-ci.org/saml-kit/saml-kit.svg)](https://travis-ci.org/saml-kit/saml-kit)
6
+ [![Security](https://hakiri.io/github/saml-kit/saml-kit/master.svg)](https://hakiri.io/github/saml-kit/saml-kit/master)
6
7
 
7
8
  Saml::Kit is a library with the purpose of creating and consuming SAML
8
9
  documents. It supports the HTTP Post and HTTP Redirect bindings. It can
@@ -3,7 +3,7 @@ require 'saml/kit'
3
3
 
4
4
  puts "Enter Passphrase:"
5
5
  passphrase = STDIN.read.strip
6
- certificate, private_key = ::Xml::Kit::SelfSignedCertificate.new(passphrase).create
6
+ certificate, private_key = ::Xml::Kit::SelfSignedCertificate.new.create(passphrase: passphrase)
7
7
 
8
8
  puts "** BEGIN File Format **"
9
9
  print certificate
data/lib/saml/kit.rb CHANGED
@@ -7,6 +7,7 @@ require "active_support/core_ext/hash/indifferent_access"
7
7
  require "active_support/core_ext/numeric/time"
8
8
  require "active_support/deprecation"
9
9
  require "active_support/duration"
10
+ require "forwardable"
10
11
  require "logger"
11
12
  require "net/http"
12
13
  require "nokogiri"
@@ -65,5 +66,10 @@ module Saml
65
66
  @deprecation.deprecation_warning(message)
66
67
  end
67
68
  end
69
+
70
+ # @deprecated Use {#::Xml::Kit::Id} instead of this.
71
+ Id = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::Id', '::Xml::Kit::Id')
72
+ # @deprecated Use {#::Xml::Kit::Fingerprint} instead of this.
73
+ Fingerprint = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::Fingerprint', '::Xml::Kit::Fingerprint')
68
74
  end
69
75
  end
@@ -14,6 +14,10 @@ module Saml
14
14
  @configuration = configuration
15
15
  end
16
16
 
17
+ def issuer
18
+ assertion.fetch('Issuer')
19
+ end
20
+
17
21
  def name_id
18
22
  assertion.fetch('Subject', {}).fetch('NameID', nil)
19
23
  end
@@ -61,7 +61,7 @@ module Saml
61
61
  # @param use [Symbol] the type of key pair, `:signing` or `:encryption`
62
62
  # @param passphrase [String] the private key passphrase to use.
63
63
  def generate_key_pair_for(use:, passphrase: SecureRandom.uuid)
64
- certificate, private_key = ::Xml::Kit::SelfSignedCertificate.new(passphrase).create
64
+ certificate, private_key = ::Xml::Kit::SelfSignedCertificate.new.create(passphrase: passphrase)
65
65
  add_key_pair(certificate, private_key, passphrase: passphrase, use: use)
66
66
  end
67
67
 
@@ -19,6 +19,9 @@ module Saml
19
19
  UNSPECIFIED_NAMEID = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
20
20
  URI = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
21
21
  VERSION_MISMATCH_ERROR = "urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"
22
+
23
+ # @deprecated Use {#::Xml::Kit::Namespace::XMLDSIG} instead of this.
24
+ XMLDSIG = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::Namespaces::XMLDSIG', '::Xml::Kit::Namespaces::XMLDSIG')
22
25
  end
23
26
  end
24
27
  end
@@ -1,5 +1,5 @@
1
1
  module Saml
2
2
  module Kit
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
data/saml-kit.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency "activemodel", ">= 4.2.0"
27
27
  spec.add_dependency "nokogiri", "~> 1.8"
28
- spec.add_dependency "xml-kit", ">= 0.1.1"
28
+ spec.add_dependency "xml-kit", "~> 0.1"
29
29
  spec.add_development_dependency "bundler", "~> 1.15"
30
30
  spec.add_development_dependency "ffaker", "~> 2.7"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-30 00:00:00.000000000 Z
11
+ date: 2018-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: xml-kit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.1
47
+ version: '0.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.1
54
+ version: '0.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  requirements: []
252
252
  rubyforge_project:
253
- rubygems_version: 2.6.14
253
+ rubygems_version: 2.7.3
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: A simple toolkit for working with SAML.