nulogy_sso 2.0.0 → 2.1.0

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
  SHA256:
3
- metadata.gz: 025625d2b1b251f2687e574aeebf1739c94ae6a672580f05164ba7e558ba5fdf
4
- data.tar.gz: a987372dba2b6fd08ca877118e024e3e7a10eb16f34cac995d8f493c837dbaaa
3
+ metadata.gz: 69f2d8d8d3961eda841243e4917e1eb949f7f74aaec33194259c71c1e375ea56
4
+ data.tar.gz: 69e4c5772e16d1de0fb76ce1671afbff34ad7d33393efe9a20ee0bc61f8836bd
5
5
  SHA512:
6
- metadata.gz: 3481d3605b625db5259b08a210932fac512cf45c7d4a4751c8d41e5229044c44711e53eb083693cd4b8c424579c0609c816eba8299fd07acacef82ab90e786fd
7
- data.tar.gz: 54008fdb8cfb1fcfa350cd51f00865f09603517feeb33952fc7032f9f90a63b3aa20c73da19e5703fe7132a155d0dedc705927609a8820cf221755762d98cacb
6
+ metadata.gz: 4ada958d23847f83ab21f4ff343fa84724f2267efba2fcca44ad607f45d2c2d4c2f78a33c9d57a97f273d0fedb1016fb608eab7c8e2eecdcc5962b205698ad2a
7
+ data.tar.gz: 887784bcda44d30797156a19307511ebe92012b58c56892752ff7870a1fb4f61a36feb08cd2d20022210ed7e57cd2bdededb2576089021c32bf5ea7d404c430c
data/README.md CHANGED
@@ -47,7 +47,7 @@ development:
47
47
  <<: *default
48
48
  base_uri: <%= ENV.fetch("SSO_BASE_URI", "https://auth-dev.nulogy.net") %>
49
49
  cookie_prefix: <%= ENV.fetch("SSO_COOKIE_PREFIX", "dev") %>
50
- login_uri: <%= ENV.fetch("SSO_LOGIN_URI", "http://localhost:3000/sso/validate_authentication_code") %>
50
+ login_uri: <%= ENV.fetch("SSO_LOGIN_URI", "http://localhost:3000/sso/verify_authentication_code") %>
51
51
  redirect_uri: <%= ENV.fetch("SSO_REDIRECT_URI", "http://localhost:3000") %>
52
52
 
53
53
  test:
@@ -7,9 +7,8 @@ module NulogySSO
7
7
 
8
8
  # This provides a simple mock implementation of Auth0 endpoints, via mockserver
9
9
  class Auth0Mock
10
- def initialize(redirect_path:, engine_path: "/nulogy_sso")
10
+ def initialize(engine_path: "/nulogy_sso")
11
11
  @jwt_test_helper = NulogySSO::TestUtilities::JwtTestHelper.new
12
- @redirect_path = redirect_path
13
12
  @engine_path = engine_path
14
13
  end
15
14
 
@@ -25,7 +24,7 @@ module NulogySSO
25
24
  )
26
25
  end
27
26
 
28
- def setup(email:, status_code: 200)
27
+ def setup(email:, redirect_path:, status_code: 200)
29
28
  mockserver_reset
30
29
 
31
30
  redirect_query_params = {
@@ -69,7 +68,7 @@ module NulogySSO
69
68
 
70
69
  private
71
70
 
72
- attr_reader :jwt_test_helper, :redirect_path, :engine_path
71
+ attr_reader :jwt_test_helper, :engine_path
73
72
 
74
73
  def mockserver_expectation(body)
75
74
  uri = URI(mockserver_url("expectation"))
@@ -1,3 +1,3 @@
1
1
  module NulogySSO
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -5053,3 +5053,147 @@ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 282)
5053
5053
   (0.4ms) rollback transaction
5054
5054
   (0.1ms) begin transaction
5055
5055
   (0.1ms) rollback transaction
5056
+  (3.6ms) SELECT sqlite_version(*)
5057
+  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "schema_sha1"]]
5058
+  (0.1ms) SELECT sqlite_version(*)
5059
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
5060
+  (0.1ms) begin transaction
5061
+  (0.1ms) SAVEPOINT active_record_1
5062
+ User Create (1.5ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:10.976866"], ["updated_at", "2019-10-07 15:37:10.976866"]]
5063
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5064
+ Started GET "/api_endpoint" for 192.168.0.12 at 2019-10-07 11:37:14 -0400
5065
+ Processing by ApiController#api_endpoint as HTML
5066
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5067
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5068
+ Completed 302 Found in 100ms (ActiveRecord: 0.0ms | Allocations: 5326)
5069
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:14 -0400
5070
+ Processing by NulogySSO::AuthenticationController#login as HTML
5071
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fapi_endpoint&response_type=code&scope=openid+email
5072
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 516)
5073
+  (0.6ms) rollback transaction
5074
+  (0.1ms) begin transaction
5075
+  (0.1ms) SAVEPOINT active_record_1
5076
+ User Create (0.3ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:16.002418"], ["updated_at", "2019-10-07 15:37:16.002418"]]
5077
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5078
+ Started GET "/api_endpoint" for 192.168.0.12 at 2019-10-07 11:37:16 -0400
5079
+ Processing by ApiController#api_endpoint as HTML
5080
+ User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@nulogy.com"], ["LIMIT", 1]]
5081
+ Completed 200 OK in 6ms (Views: 0.4ms | ActiveRecord: 1.0ms | Allocations: 823)
5082
+  (0.5ms) rollback transaction
5083
+  (0.1ms) begin transaction
5084
+  (0.1ms) SAVEPOINT active_record_1
5085
+ User Create (0.3ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:16.688548"], ["updated_at", "2019-10-07 15:37:16.688548"]]
5086
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5087
+ Started GET "/api_endpoint" for 192.168.0.12 at 2019-10-07 11:37:16 -0400
5088
+ Processing by ApiController#api_endpoint as HTML
5089
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5090
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5091
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 314)
5092
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:16 -0400
5093
+ Processing by NulogySSO::AuthenticationController#login as HTML
5094
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fapi_endpoint&response_type=code&scope=openid+email
5095
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 285)
5096
+  (0.7ms) rollback transaction
5097
+  (0.1ms) begin transaction
5098
+  (0.1ms) SAVEPOINT active_record_1
5099
+ User Create (0.7ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:17.587853"], ["updated_at", "2019-10-07 15:37:17.587853"]]
5100
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5101
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:17 -0400
5102
+ Processing by ApplicationController#hello_world as HTML
5103
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5104
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5105
+ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 369)
5106
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:17 -0400
5107
+ Processing by NulogySSO::AuthenticationController#login as HTML
5108
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fhello_world&response_type=code&scope=openid+email
5109
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 278)
5110
+ Started GET "/nulogy_sso/verify_authentication_code?code=FAKE_CODE&origin=http%3A%2F%2F192.168.0.12%3A53078%2Fhello_world" for 192.168.0.12 at 2019-10-07 11:37:17 -0400
5111
+ Processing by NulogySSO::AuthenticationController#verify_authentication_code as HTML
5112
+ Parameters: {"code"=>"FAKE_CODE", "origin"=>"http://192.168.0.12:53078/hello_world"}
5113
+ Rendering text template
5114
+ Rendered text template (Duration: 0.0ms | Allocations: 3)
5115
+ Completed 200 OK in 99ms (Views: 16.0ms | ActiveRecord: 0.0ms | Allocations: 4452)
5116
+  (0.5ms) rollback transaction
5117
+  (0.1ms) begin transaction
5118
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:18 -0400
5119
+ Processing by ApplicationController#hello_world as HTML
5120
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5121
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5122
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 321)
5123
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:18 -0400
5124
+ Processing by NulogySSO::AuthenticationController#login as HTML
5125
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fhello_world&response_type=code&scope=openid+email
5126
+ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 285)
5127
+ Started GET "/nulogy_sso/verify_authentication_code?code=FAKE_CODE&origin=http%3A%2F%2F192.168.0.12%3A53078%2Fhello_world" for 192.168.0.12 at 2019-10-07 11:37:18 -0400
5128
+ Processing by NulogySSO::AuthenticationController#verify_authentication_code as HTML
5129
+ Parameters: {"code"=>"FAKE_CODE", "origin"=>"http://192.168.0.12:53078/hello_world"}
5130
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@nulogy.com"], ["LIMIT", 1]]
5131
+ Rendering text template
5132
+ Rendered text template (Duration: 0.0ms | Allocations: 1)
5133
+ Completed 200 OK in 27ms (Views: 0.6ms | ActiveRecord: 0.3ms | Allocations: 2508)
5134
+  (0.1ms) rollback transaction
5135
+  (0.0ms) begin transaction
5136
+  (0.1ms) SAVEPOINT active_record_1
5137
+ User Create (0.6ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:18.987298"], ["updated_at", "2019-10-07 15:37:18.987298"]]
5138
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5139
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:19 -0400
5140
+ Processing by ApplicationController#hello_world as HTML
5141
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5142
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5143
+ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 321)
5144
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:19 -0400
5145
+ Processing by NulogySSO::AuthenticationController#login as HTML
5146
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fhello_world&response_type=code&scope=openid+email
5147
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 282)
5148
+ Started GET "/nulogy_sso/verify_authentication_code?code=FAKE_CODE&origin=http%3A%2F%2F192.168.0.12%3A53078%2Fhello_world" for 192.168.0.12 at 2019-10-07 11:37:19 -0400
5149
+ Processing by NulogySSO::AuthenticationController#verify_authentication_code as HTML
5150
+ Parameters: {"code"=>"FAKE_CODE", "origin"=>"http://192.168.0.12:53078/hello_world"}
5151
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@nulogy.com"], ["LIMIT", 1]]
5152
+ Redirected to http://192.168.0.12:53078/hello_world
5153
+ Completed 302 Found in 26ms (ActiveRecord: 0.3ms | Allocations: 2651)
5154
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:19 -0400
5155
+ Processing by ApplicationController#hello_world as HTML
5156
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@nulogy.com"], ["LIMIT", 1]]
5157
+ Rendering text template
5158
+ Rendered text template (Duration: 0.0ms | Allocations: 1)
5159
+ Completed 200 OK in 2ms (Views: 0.6ms | ActiveRecord: 0.1ms | Allocations: 853)
5160
+  (0.7ms) rollback transaction
5161
+  (0.1ms) begin transaction
5162
+  (0.8ms) SAVEPOINT active_record_1
5163
+ User Create (0.7ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:19.430543"], ["updated_at", "2019-10-07 15:37:19.430543"]]
5164
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5165
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:19 -0400
5166
+ Processing by ApplicationController#hello_world as HTML
5167
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@nulogy.com"], ["LIMIT", 1]]
5168
+ Rendering text template
5169
+ Rendered text template (Duration: 0.1ms | Allocations: 1)
5170
+ Completed 200 OK in 4ms (Views: 1.1ms | ActiveRecord: 0.2ms | Allocations: 598)
5171
+  (0.6ms) rollback transaction
5172
+  (0.1ms) begin transaction
5173
+  (0.1ms) SAVEPOINT active_record_1
5174
+ User Create (0.3ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:20.007786"], ["updated_at", "2019-10-07 15:37:20.007786"]]
5175
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5176
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:20 -0400
5177
+ Processing by ApplicationController#hello_world as HTML
5178
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5179
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5180
+ Completed 302 Found in 2ms (ActiveRecord: 0.0ms | Allocations: 503)
5181
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:20 -0400
5182
+ Processing by NulogySSO::AuthenticationController#login as HTML
5183
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fhello_world&response_type=code&scope=openid+email
5184
+ Completed 302 Found in 3ms (ActiveRecord: 0.0ms | Allocations: 456)
5185
+  (0.6ms) rollback transaction
5186
+  (0.1ms) begin transaction
5187
+  (0.1ms) SAVEPOINT active_record_1
5188
+ User Create (0.5ms) INSERT INTO "users" ("email", "created_at", "updated_at") VALUES (?, ?, ?) [["email", "test@nulogy.com"], ["created_at", "2019-10-07 15:37:20.652538"], ["updated_at", "2019-10-07 15:37:20.652538"]]
5189
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5190
+ Started GET "/hello_world" for 192.168.0.12 at 2019-10-07 11:37:20 -0400
5191
+ Processing by ApplicationController#hello_world as HTML
5192
+ Redirected to http://192.168.0.12:53078/nulogy_sso/login
5193
+ Filter chain halted as :authenticate_sso_user rendered or redirected
5194
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 321)
5195
+ Started GET "/nulogy_sso/login" for 192.168.0.12 at 2019-10-07 11:37:20 -0400
5196
+ Processing by NulogySSO::AuthenticationController#login as HTML
5197
+ Redirected to http://localhost:1080/authorize?audience=mock_audience&client_id=mock_client_id&redirect_uri=mock_login_uri%3Forigin%3Dhttp%3A%2F%2F192.168.0.12%3A53078%2Fhello_world&response_type=code&scope=openid+email
5198
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 279)
5199
+  (0.7ms) rollback transaction
data/spec/examples.txt CHANGED
@@ -1,11 +1,14 @@
1
1
  example_id | status | run_time |
2
2
  --------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:1] | passed | 0.90051 seconds |
4
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:2] | passed | 0.82604 seconds |
5
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:3] | passed | 5.47 seconds |
6
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:1] | passed | 1.08 seconds |
7
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:2] | passed | 1.22 seconds |
8
- ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:3] | passed | 1.1 seconds |
3
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:1] | passed | 0.60296 seconds |
4
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:2] | passed | 0.62418 seconds |
5
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:1:3] | passed | 0.84145 seconds |
6
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:1] | passed | 0.5774 seconds |
7
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:2] | passed | 0.64436 seconds |
8
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:2:3] | passed | 0.67076 seconds |
9
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:3:1] | passed | 0.68573 seconds |
10
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:3:2] | passed | 5.04 seconds |
11
+ ./spec/features/nulogy_sso/sso_login_spec.rb[1:3:3] | passed | 0.66973 seconds |
9
12
  ./spec/integration/services/nulogy_sso/authenticator_spec.rb[1:1:1] | passed | 0.0752 seconds |
10
13
  ./spec/integration/services/nulogy_sso/authenticator_spec.rb[1:1:2:1] | passed | 0.12336 seconds |
11
14
  ./spec/integration/services/nulogy_sso/authenticator_spec.rb[1:1:2:2] | passed | 0.0204 seconds |
@@ -5,12 +5,12 @@ require "feature_spec_helper"
5
5
  module NulogySSO
6
6
  RSpec.describe "the SSO login process", type: :feature, js: true do
7
7
  let(:email) { "test@nulogy.com" }
8
- let(:auth0_mock) { TestUtilities::Auth0Mock.new(redirect_path: "/hello_world") }
8
+ let(:auth0_mock) { TestUtilities::Auth0Mock.new }
9
9
  let(:jwt_test_helper) { TestUtilities::JwtTestHelper.new }
10
10
 
11
11
  describe "login flow" do
12
12
  it "can successfully login" do
13
- auth0_mock.setup(email: email)
13
+ auth0_mock.setup(email: email, redirect_path: "/hello_world")
14
14
  create_user
15
15
 
16
16
  visit "/hello_world"
@@ -19,7 +19,7 @@ module NulogySSO
19
19
  end
20
20
 
21
21
  it "shows an error page when the user can authorize with Auth0 but not exist in the app" do
22
- auth0_mock.setup(email: email)
22
+ auth0_mock.setup(email: email, redirect_path: "/hello_world")
23
23
 
24
24
  visit "/hello_world"
25
25
 
@@ -27,7 +27,7 @@ module NulogySSO
27
27
  end
28
28
 
29
29
  it "shows an error page when Auth0 throws an error" do
30
- auth0_mock.setup(email: email, status_code: 403)
30
+ auth0_mock.setup(email: email, redirect_path: "/hello_world", status_code: 403)
31
31
  create_user
32
32
 
33
33
  visit "/hello_world"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nulogy_sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nulogy Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-04 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: auth0