diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ba731a419b1c7e67445e1e3427649123c0b3edf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +<a name="0.1.0"></a> +### 0.1.0 (2017-01-15) + + +#### Features + +* use latest rbsso with checks for expiry and service_id ([ae91d93](/../../commit/ae91d93)) +* initial Omniauth Strategy ([925f544](/../../commit/925f544)) + + + diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b5c9d779cb07c7dd8f7f277cb1bdb1085d50cc31 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,5 @@ +Omniauth Strategy to use autistici / inventati sso. + +Used like other omniauth strategies. Requires a key to validate signatures and a service_id to identify the service itself. + +The constructor takes the service_id and the verification key as parameters. In comparison with other services they replace the id and the secret provided by the IDP. diff --git a/omniauth-sso.gemspec b/omniauth-sso.gemspec index 4f323b6708f7aaba466b07cc55f9183743731b6c..4701f8413bacb91a829e251dc494010fd868f557 100644 --- a/omniauth-sso.gemspec +++ b/omniauth-sso.gemspec @@ -11,7 +11,7 @@ Omniauth strategy for "ai's sso"(https://git.autistici.org/ai/sso) based on rbss s.homepage = 'https://0xacab.org/riseup/omniauth-sso' s.add_runtime_dependency 'omniauth', '~> 1.3' - s.add_runtime_dependency 'rbsso', '~> 0.2.2' + s.add_runtime_dependency 'rbsso', '~> 0.3.0' s.add_development_dependency 'rake', '>= 10', '< 13' s.add_development_dependency 'minitest', '~>5.0' diff --git a/test/omniauth/strategies/sso_test.rb b/test/omniauth/strategies/sso_test.rb index 04e5783ef7e80d0cf3a90153c55782c6c0804d34..f84c66cf9e9028de08a37ea1a7f3983ed8d0056f 100644 --- a/test/omniauth/strategies/sso_test.rb +++ b/test/omniauth/strategies/sso_test.rb @@ -49,7 +49,7 @@ class OmniAuth::Strategies::SSOTest < Minitest::Test def test_wrong_service assert_raises RuntimeError do - post '/auth/sso/callback', t: server.ticket(user, 'other_service', domain) + post '/auth/sso/callback', t: ticket_for_other_service end assert_nil auth_hash end @@ -64,6 +64,10 @@ class OmniAuth::Strategies::SSOTest < Minitest::Test end end + def ticket_for_other_service + server.ticket user: user, service: 'other_service', domain: domain + end + # We modify the content of the ticket so the signature becomes invalid. # It still should have the right length and be Base64 compatible. def invalid_ticket @@ -77,7 +81,7 @@ class OmniAuth::Strategies::SSOTest < Minitest::Test end def ticket - server.ticket(user, service, domain) + server.ticket(user: user, service: service, domain: domain) end def server; RbSSO::Server.new seed; end