spid-sinatra 0.2.1 → 0.3.0

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: afc91406957504280c8a62984b162fe5765cdf236033a319f3d37a0034c0c9fe
4
- data.tar.gz: 65d8ab8f57a1ffe316cc32ed8176335ea0eb232fd9d5f3208478362ef6d0b851
3
+ metadata.gz: 5909c238b789eb5d70d7266cd366a5312f634e2bed6a4d5de4d02d9eca6b8aa9
4
+ data.tar.gz: ecbf60a0e4fbdbfcdad4a1dbb3d08942d238405da2504de72dc4db3f84ddcfd7
5
5
  SHA512:
6
- metadata.gz: 7306bccd7b5781ee1dd3b72800e58cd72b04f9347e5713f1829f12e75e8dab79672432b4947874321a1f754d788b4885ed0a431e99b426831aeeba7bb5361803
7
- data.tar.gz: 13a9563b6291e451d0221ecbed36adcbf14c3d183aefdee243768a6f4149f9c8877c742dcba9d3463e41317cca8c9b35df6e023bc43d306470d610aa9b6547f1
6
+ metadata.gz: d8a354d276e73ff60d42c5360151a4ce3944d3ba1b00f4ca7f487a0bbc61a5ef9b71f3b466ca0b5de9fcd873f6820e4c2211094570114ec740070b0ce0a3febd
7
+ data.tar.gz: f2b0656a41ef162f4d9d6fed090be56b61f613702c628adc41acb6691267eac11d07bb0905f8cca79e624e89ecd81c8268b9bc7cd562250e15a5e737f534a3f6
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "spid"
4
+ require "spid/sinatra/helpers"
4
5
  require "spid/sinatra/version"
5
6
 
6
7
  module Spid
7
8
  module Sinatra # :nodoc:
8
- # Your code goes here...
9
9
  end
10
10
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sinatra"
4
+ require "sinatra/base"
5
+
6
+ module Spid
7
+ module Sinatra # :nodoc:
8
+ module Helpers # :nodoc:
9
+ def spid_login_path(
10
+ idp_name:,
11
+ authn_context: nil,
12
+ attribute_service_index: nil
13
+ )
14
+ base_path = Spid.configuration.login_path
15
+ query = "idp_name=#{idp_name}"
16
+ unless authn_context.nil?
17
+ query = "#{query}&authn_context=#{authn_context}"
18
+ end
19
+
20
+ unless attribute_service_index.nil?
21
+ query = "#{query}&attribute_service_index=#{attribute_service_index}"
22
+ end
23
+ "#{base_path}?#{query}"
24
+ end
25
+
26
+ def spid_logout_path(idp_name:)
27
+ base_path = Spid.configuration.logout_path
28
+ query = [
29
+ "idp_name=#{idp_name}"
30
+ ].join("&")
31
+ "#{base_path}?#{query}"
32
+ end
33
+ end
34
+
35
+ ::Sinatra.helpers Helpers
36
+ end
37
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Spid
4
4
  module Sinatra
5
- VERSION = "0.2.1"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
@@ -24,7 +24,8 @@ Gem::Specification.new do |spec|
24
24
  }
25
25
  spec.required_ruby_version = ">= 2.3.0"
26
26
 
27
- spec.add_runtime_dependency "spid", ">= 0.16.0"
27
+ spec.add_runtime_dependency "sinatra", ">= 0"
28
+ spec.add_runtime_dependency "spid", ">= 0.17.0"
28
29
 
29
30
  spec.add_development_dependency "bundler", "~> 1.16"
30
31
  spec.add_development_dependency "bundler-audit", "~> 0"
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spid-sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Librera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-05 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sinatra
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: spid
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: 0.16.0
33
+ version: 0.17.0
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: 0.16.0
40
+ version: 0.17.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +157,7 @@ files:
143
157
  - bin/console
144
158
  - bin/setup
145
159
  - lib/spid/sinatra.rb
160
+ - lib/spid/sinatra/helpers.rb
146
161
  - lib/spid/sinatra/version.rb
147
162
  - spid-sinatra.gemspec
148
163
  homepage: https://github.com/cantierecreativo/spid-sinatra