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 +4 -4
- data/lib/spid/sinatra.rb +1 -1
- data/lib/spid/sinatra/helpers.rb +37 -0
- data/lib/spid/sinatra/version.rb +1 -1
- data/spid-sinatra.gemspec +2 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5909c238b789eb5d70d7266cd366a5312f634e2bed6a4d5de4d02d9eca6b8aa9
|
4
|
+
data.tar.gz: ecbf60a0e4fbdbfcdad4a1dbb3d08942d238405da2504de72dc4db3f84ddcfd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a354d276e73ff60d42c5360151a4ce3944d3ba1b00f4ca7f487a0bbc61a5ef9b71f3b466ca0b5de9fcd873f6820e4c2211094570114ec740070b0ce0a3febd
|
7
|
+
data.tar.gz: f2b0656a41ef162f4d9d6fed090be56b61f613702c628adc41acb6691267eac11d07bb0905f8cca79e624e89ecd81c8268b9bc7cd562250e15a5e737f534a3f6
|
data/lib/spid/sinatra.rb
CHANGED
@@ -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
|
data/lib/spid/sinatra/version.rb
CHANGED
data/spid-sinatra.gemspec
CHANGED
@@ -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 "
|
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.
|
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-
|
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.
|
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.
|
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
|