rails_sso 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 782495ec305d90adef98e3990f1ba1ba09d2a450
4
- data.tar.gz: 65b3341310c6ea3e2989d4d3ec12a8936151e61b
3
+ metadata.gz: 293476ec400ac5ebb791ab9f9cbcd2295d01e615
4
+ data.tar.gz: 6e7b5864d01cca76d4c9fc042b582fc06f5e75f0
5
5
  SHA512:
6
- metadata.gz: 99506380167cb44724cbb6b67f246e308af63f22f690b1e47382758c76147320c403f28588b844c6524efac1c01359f8b3b1a22c5eb4848eb16e24b460fde67e
7
- data.tar.gz: 7bafcc06f6eff27c425cd505dfdfdf2493fbf9f8faecc35d37ffa41ef0d7f9419214c84bf0cf22dd8249689874bda9319da26171781cf80d3fa6862365609ed1
6
+ metadata.gz: f1745b2047f5ec91329f88d8a65a0b8ca16b6e0bfbf607fbb74260e6fe1433fc257cc803f7bab2fdc6f7ee5ed06674132c2bcde3c8cb3ea79b1696503552688e
7
+ data.tar.gz: 83798cf03f473f3425733f420d123f768d2212f6ff59e9ad2be3f34c321e1e3c14315ae9c023ca1177d6405ddedbf10eb12c1fb5dd3feadb542df3d5421cec75
@@ -17,7 +17,7 @@ module RailsSso
17
17
  end
18
18
 
19
19
  def authenticate_user!
20
- redirect_to sign_in_path unless user_signed_in?
20
+ redirect_to sso.sign_in_path unless user_signed_in?
21
21
  end
22
22
 
23
23
  def access_token
@@ -1,3 +1,3 @@
1
1
  module RailsSso
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -2015,3 +2015,359 @@ RailsSsoTest: test_truth
2015
2015
  RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2016
2016
  --------------------------------------------------------------------------------------------
2017
2017
   (0.1ms) rollback transaction
2018
+  (0.1ms) begin transaction
2019
+ --------------------------------------------------------------------------------------------
2020
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2021
+ --------------------------------------------------------------------------------------------
2022
+  (0.1ms) rollback transaction
2023
+  (0.1ms) begin transaction
2024
+ --------------------------------------------------------------------------------------------
2025
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2026
+ --------------------------------------------------------------------------------------------
2027
+  (0.1ms) rollback transaction
2028
+  (0.1ms) begin transaction
2029
+ ------------------------------------------------------------------------------------------------
2030
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2031
+ ------------------------------------------------------------------------------------------------
2032
+  (0.0ms) rollback transaction
2033
+  (0.1ms) begin transaction
2034
+ --------------------------------------------
2035
+ SsoRoutesTest: test_should_route_to_sign_out
2036
+ --------------------------------------------
2037
+  (0.0ms) rollback transaction
2038
+  (0.1ms) begin transaction
2039
+ ------------------------------------------------------------------------------------------------
2040
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2041
+ ------------------------------------------------------------------------------------------------
2042
+ Processing by RailsSso::SessionsController#create as HTML
2043
+ Parameters: {"provider"=>"developer"}
2044
+ Redirected to http://test.host/
2045
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2046
+  (0.1ms) rollback transaction
2047
+  (0.0ms) begin transaction
2048
+ -------------------------------------------------------------------------------------------------------
2049
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2050
+ -------------------------------------------------------------------------------------------------------
2051
+ Processing by RailsSso::SessionsController#destroy as HTML
2052
+ Redirected to http://test.host/
2053
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2054
+  (0.1ms) rollback transaction
2055
+  (0.1ms) begin transaction
2056
+ ------------------------
2057
+ RailsSsoTest: test_truth
2058
+ ------------------------
2059
+  (0.0ms) rollback transaction
2060
+  (0.1ms) begin transaction
2061
+ --------------------------------------------------------------------------------------------
2062
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2063
+ --------------------------------------------------------------------------------------------
2064
+  (0.1ms) rollback transaction
2065
+  (0.1ms) begin transaction
2066
+ -------------------------------------------------------------------------------------------------------
2067
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2068
+ -------------------------------------------------------------------------------------------------------
2069
+ Processing by RailsSso::SessionsController#destroy as HTML
2070
+ Redirected to http://test.host/
2071
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2072
+  (0.1ms) rollback transaction
2073
+  (0.1ms) begin transaction
2074
+ ------------------------------------------------------------------------------------------------
2075
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2076
+ ------------------------------------------------------------------------------------------------
2077
+ Processing by RailsSso::SessionsController#create as HTML
2078
+ Parameters: {"provider"=>"developer"}
2079
+ Redirected to http://test.host/
2080
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2081
+  (0.1ms) rollback transaction
2082
+  (0.1ms) begin transaction
2083
+ ------------------------
2084
+ RailsSsoTest: test_truth
2085
+ ------------------------
2086
+  (0.1ms) rollback transaction
2087
+  (0.1ms) begin transaction
2088
+ --------------------------------------------
2089
+ SsoRoutesTest: test_should_route_to_sign_out
2090
+ --------------------------------------------
2091
+  (0.1ms) rollback transaction
2092
+  (0.1ms) begin transaction
2093
+ ------------------------------------------------------------------------------------------------
2094
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2095
+ ------------------------------------------------------------------------------------------------
2096
+  (0.1ms) rollback transaction
2097
+  (0.1ms) begin transaction
2098
+ --------------------------------------------------------------------------------------------
2099
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2100
+ --------------------------------------------------------------------------------------------
2101
+  (0.0ms) rollback transaction
2102
+  (0.1ms) begin transaction
2103
+ --------------------------------------------
2104
+ SsoRoutesTest: test_should_route_to_sign_out
2105
+ --------------------------------------------
2106
+  (0.1ms) rollback transaction
2107
+  (0.1ms) begin transaction
2108
+ ------------------------------------------------------------------------------------------------
2109
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2110
+ ------------------------------------------------------------------------------------------------
2111
+  (0.1ms) rollback transaction
2112
+  (0.1ms) begin transaction
2113
+ --------------------------------------------------------------------------------------------
2114
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2115
+ --------------------------------------------------------------------------------------------
2116
+  (0.1ms) rollback transaction
2117
+  (0.1ms) begin transaction
2118
+ -------------------------------------------------------------------------------------------------------
2119
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2120
+ -------------------------------------------------------------------------------------------------------
2121
+ Processing by RailsSso::SessionsController#destroy as HTML
2122
+ Redirected to http://test.host/
2123
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
2124
+  (0.1ms) rollback transaction
2125
+  (0.1ms) begin transaction
2126
+ ------------------------------------------------------------------------------------------------
2127
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2128
+ ------------------------------------------------------------------------------------------------
2129
+ Processing by RailsSso::SessionsController#create as HTML
2130
+ Parameters: {"provider"=>"developer"}
2131
+ Redirected to http://test.host/
2132
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2133
+  (0.1ms) rollback transaction
2134
+  (0.1ms) begin transaction
2135
+ ------------------------
2136
+ RailsSsoTest: test_truth
2137
+ ------------------------
2138
+  (0.0ms) rollback transaction
2139
+  (0.1ms) begin transaction
2140
+ --------------------------------------------------------------------------------------------
2141
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2142
+ --------------------------------------------------------------------------------------------
2143
+  (0.1ms) rollback transaction
2144
+  (0.1ms) begin transaction
2145
+ --------------------------------------------------------------------------------------------
2146
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2147
+ --------------------------------------------------------------------------------------------
2148
+  (0.1ms) rollback transaction
2149
+  (0.1ms) begin transaction
2150
+ ------------------------------------------------------------------------------------------------
2151
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2152
+ ------------------------------------------------------------------------------------------------
2153
+ Processing by RailsSso::SessionsController#create as HTML
2154
+ Parameters: {"provider"=>"developer"}
2155
+ Redirected to http://test.host/
2156
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2157
+  (0.1ms) rollback transaction
2158
+  (0.1ms) begin transaction
2159
+ -------------------------------------------------------------------------------------------------------
2160
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2161
+ -------------------------------------------------------------------------------------------------------
2162
+ Processing by RailsSso::SessionsController#destroy as HTML
2163
+ Redirected to http://test.host/
2164
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2165
+  (0.1ms) rollback transaction
2166
+  (0.1ms) begin transaction
2167
+ --------------------------------------------
2168
+ SsoRoutesTest: test_should_route_to_sign_out
2169
+ --------------------------------------------
2170
+  (0.1ms) rollback transaction
2171
+  (0.1ms) begin transaction
2172
+ ------------------------
2173
+ RailsSsoTest: test_truth
2174
+ ------------------------
2175
+  (0.0ms) rollback transaction
2176
+  (0.1ms) begin transaction
2177
+ --------------------------------------------------------------------------------------------
2178
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2179
+ --------------------------------------------------------------------------------------------
2180
+  (0.0ms) rollback transaction
2181
+  (0.1ms) begin transaction
2182
+ ------------------------------------------------------------------------------------------------
2183
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2184
+ ------------------------------------------------------------------------------------------------
2185
+  (0.0ms) rollback transaction
2186
+  (0.1ms) begin transaction
2187
+ --------------------------------------------------------------------------------------------
2188
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2189
+ --------------------------------------------------------------------------------------------
2190
+  (0.1ms) rollback transaction
2191
+  (0.1ms) begin transaction
2192
+ ------------------------------------------------------------------------------------------------
2193
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2194
+ ------------------------------------------------------------------------------------------------
2195
+  (0.1ms) rollback transaction
2196
+  (0.1ms) begin transaction
2197
+ --------------------------------------------------------------------------------------------
2198
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2199
+ --------------------------------------------------------------------------------------------
2200
+  (0.1ms) rollback transaction
2201
+  (0.1ms) begin transaction
2202
+ ------------------------------------------------------------------------------------------------
2203
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2204
+ ------------------------------------------------------------------------------------------------
2205
+ Processing by RailsSso::SessionsController#create as HTML
2206
+ Parameters: {"provider"=>"developer"}
2207
+ Redirected to http://test.host/
2208
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2209
+  (0.1ms) rollback transaction
2210
+  (0.0ms) begin transaction
2211
+ -------------------------------------------------------------------------------------------------------
2212
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2213
+ -------------------------------------------------------------------------------------------------------
2214
+ Processing by RailsSso::SessionsController#destroy as HTML
2215
+ Redirected to http://test.host/
2216
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2217
+  (0.1ms) rollback transaction
2218
+  (0.1ms) begin transaction
2219
+ --------------------------------------------
2220
+ SsoRoutesTest: test_should_route_to_sign_out
2221
+ --------------------------------------------
2222
+  (0.1ms) rollback transaction
2223
+  (0.1ms) begin transaction
2224
+ ------------------------
2225
+ RailsSsoTest: test_truth
2226
+ ------------------------
2227
+  (0.0ms) rollback transaction
2228
+  (0.1ms) begin transaction
2229
+ ------------------------------------------------------------------------------------------------
2230
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2231
+ ------------------------------------------------------------------------------------------------
2232
+  (0.1ms) rollback transaction
2233
+  (0.1ms) begin transaction
2234
+ --------------------------------------------------------------------------------------------
2235
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2236
+ --------------------------------------------------------------------------------------------
2237
+  (0.2ms) rollback transaction
2238
+  (0.1ms) begin transaction
2239
+ --------------------------------------------------------------------------------------------
2240
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2241
+ --------------------------------------------------------------------------------------------
2242
+  (0.1ms) rollback transaction
2243
+  (0.1ms) begin transaction
2244
+ --------------------------------------------------
2245
+ SsoRoutesTest: test_should_route_/example/callback
2246
+ --------------------------------------------------
2247
+  (0.1ms) rollback transaction
2248
+  (0.1ms) begin transaction
2249
+ ------------------------------------------
2250
+ SsoRoutesTest: test_should_route_/sign_out
2251
+ ------------------------------------------
2252
+  (0.1ms) rollback transaction
2253
+  (0.1ms) begin transaction
2254
+ ------------------------------------------------------------------------------------------------
2255
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2256
+ ------------------------------------------------------------------------------------------------
2257
+ Processing by RailsSso::SessionsController#create as HTML
2258
+ Parameters: {"provider"=>"developer"}
2259
+ Redirected to http://test.host/
2260
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
2261
+  (0.1ms) rollback transaction
2262
+  (0.1ms) begin transaction
2263
+ -------------------------------------------------------------------------------------------------------
2264
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2265
+ -------------------------------------------------------------------------------------------------------
2266
+ Processing by RailsSso::SessionsController#destroy as HTML
2267
+ Redirected to http://test.host/
2268
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2269
+  (0.1ms) rollback transaction
2270
+  (0.1ms) begin transaction
2271
+ ------------------------
2272
+ RailsSsoTest: test_truth
2273
+ ------------------------
2274
+  (0.1ms) rollback transaction
2275
+  (0.1ms) begin transaction
2276
+ ------------------------
2277
+ RailsSsoTest: test_truth
2278
+ ------------------------
2279
+  (0.1ms) rollback transaction
2280
+  (0.1ms) begin transaction
2281
+ ----------------------------------------------------
2282
+ SsoRoutesTest: test_should_route_/:provider/callback
2283
+ ----------------------------------------------------
2284
+  (0.1ms) rollback transaction
2285
+  (0.1ms) begin transaction
2286
+ ------------------------------------------
2287
+ SsoRoutesTest: test_should_route_/sign_out
2288
+ ------------------------------------------
2289
+  (0.1ms) rollback transaction
2290
+  (0.2ms) begin transaction
2291
+ -------------------------------------------------------------------------------------------------------
2292
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2293
+ -------------------------------------------------------------------------------------------------------
2294
+ Processing by RailsSso::SessionsController#destroy as HTML
2295
+ Redirected to http://test.host/
2296
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2297
+  (0.1ms) rollback transaction
2298
+  (0.1ms) begin transaction
2299
+ ------------------------------------------------------------------------------------------------
2300
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2301
+ ------------------------------------------------------------------------------------------------
2302
+ Processing by RailsSso::SessionsController#create as HTML
2303
+ Parameters: {"provider"=>"developer"}
2304
+ Redirected to http://test.host/
2305
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2306
+  (0.1ms) rollback transaction
2307
+  (0.1ms) begin transaction
2308
+ ------------------------------------------------------------------------------------------------
2309
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2310
+ ------------------------------------------------------------------------------------------------
2311
+  (0.1ms) rollback transaction
2312
+  (0.0ms) begin transaction
2313
+ --------------------------------------------------------------------------------------------
2314
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2315
+ --------------------------------------------------------------------------------------------
2316
+  (0.0ms) rollback transaction
2317
+  (0.1ms) begin transaction
2318
+ --------------------------------------------------------------------------------------------
2319
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2320
+ --------------------------------------------------------------------------------------------
2321
+  (0.1ms) rollback transaction
2322
+  (0.2ms) begin transaction
2323
+ ------------------------------------------
2324
+ SsoRoutesTest: test_should_route_/sign_out
2325
+ ------------------------------------------
2326
+  (0.1ms) rollback transaction
2327
+  (0.1ms) begin transaction
2328
+ ----------------------------------------------------
2329
+ SsoRoutesTest: test_should_route_/:provider/callback
2330
+ ----------------------------------------------------
2331
+  (0.1ms) rollback transaction
2332
+  (0.0ms) begin transaction
2333
+ ----------------------------------
2334
+ SsoRoutesTest: test_should_route_/
2335
+ ----------------------------------
2336
+  (0.0ms) rollback transaction
2337
+  (0.1ms) begin transaction
2338
+ ------------------------------------------------------------------------------------------------
2339
+ RailsSso::UpdateUserTest: test_call_should_create_user_if_not_exists_in_repository_and_return_it
2340
+ ------------------------------------------------------------------------------------------------
2341
+  (0.1ms) rollback transaction
2342
+  (0.0ms) begin transaction
2343
+ --------------------------------------------------------------------------------------------
2344
+ RailsSso::UpdateUserTest: test_call_should_update_user_if_exists_in_repository_and_return_it
2345
+ --------------------------------------------------------------------------------------------
2346
+  (0.0ms) rollback transaction
2347
+  (0.1ms) begin transaction
2348
+ --------------------------------------------------------------------------------------------
2349
+ RailsSso::FetchUserTest: test_call_should_fetch_user_with_access_token_and_yield_parsed_data
2350
+ --------------------------------------------------------------------------------------------
2351
+  (0.1ms) rollback transaction
2352
+  (0.0ms) begin transaction
2353
+ ------------------------------------------------------------------------------------------------
2354
+ RailsSso::SessionsControllerTest: test_create_should_save_access_token_and_redirect_to_root_path
2355
+ ------------------------------------------------------------------------------------------------
2356
+ Processing by RailsSso::SessionsController#create as HTML
2357
+ Parameters: {"provider"=>"developer"}
2358
+ Redirected to http://test.host/
2359
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2360
+  (0.1ms) rollback transaction
2361
+  (0.0ms) begin transaction
2362
+ -------------------------------------------------------------------------------------------------------
2363
+ RailsSso::SessionsControllerTest: test_destroy_should_invalidate_access_token_and_redirect_to_root_path
2364
+ -------------------------------------------------------------------------------------------------------
2365
+ Processing by RailsSso::SessionsController#destroy as HTML
2366
+ Redirected to http://test.host/
2367
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
2368
+  (0.1ms) rollback transaction
2369
+  (0.1ms) begin transaction
2370
+ ------------------------
2371
+ RailsSsoTest: test_truth
2372
+ ------------------------
2373
+  (0.0ms) rollback transaction
@@ -0,0 +1,25 @@
1
+ require 'test_helper'
2
+
3
+ class SsoRoutesTest < ActionController::TestCase
4
+ def setup
5
+ @routes = RailsSso::Engine.routes
6
+ end
7
+
8
+ test 'should route /sign_out' do
9
+ assert_routing({
10
+ method: 'delete',
11
+ path: '/sign_out'
12
+ }, {
13
+ controller: 'rails_sso/sessions',
14
+ action: 'destroy'
15
+ })
16
+ end
17
+
18
+ test 'should route /:provider/callback' do
19
+ assert_routing('/example/callback', {
20
+ controller: 'rails_sso/sessions',
21
+ action: 'create',
22
+ provider: 'example'
23
+ })
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Dudulski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -154,6 +154,7 @@ files:
154
154
  - test/dummy/public/500.html
155
155
  - test/dummy/public/favicon.ico
156
156
  - test/rails_sso_test.rb
157
+ - test/routes/sso_routes_test.rb
157
158
  - test/services/rails_sso/fetch_user_test.rb
158
159
  - test/services/rails_sso/update_user_test.rb
159
160
  - test/test_helper.rb
@@ -224,3 +225,4 @@ test_files:
224
225
  - test/dummy/app/assets/stylesheets/application.css
225
226
  - test/dummy/log/test.log
226
227
  - test/dummy/Rakefile
228
+ - test/routes/sso_routes_test.rb