doorkeeper_sso 0.0.3 → 0.0.4

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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +13 -12
  3. data/app/controllers/application_controller.rb +3 -0
  4. data/app/controllers/doorkeeper/authorizations_controller.rb +18 -0
  5. data/app/controllers/doorkeeper/tokens_controller.rb +39 -0
  6. data/app/controllers/sso/sessions_controller.rb +29 -0
  7. data/app/middleware/sso/access_token_marker.rb +103 -0
  8. data/app/middleware/sso/authorization_grant_marker.rb +87 -0
  9. data/app/middleware/sso/passport_verification.rb +25 -0
  10. data/app/models/sso/session.rb +137 -0
  11. data/app/views/layouts/doorkeeper/admin.html.erb +34 -0
  12. data/app/views/layouts/doorkeeper/application.html.erb +23 -0
  13. data/config/routes.rb +1 -0
  14. data/db/migrate/20150414102248_create_sso_sessions.rb +29 -0
  15. data/lib/doorkeeper_sso.rb +4 -1
  16. data/lib/sso/engine.rb +0 -12
  17. data/lib/sso/logging.rb +58 -0
  18. data/lib/sso/version.rb +1 -1
  19. data/lib/sso.rb +4 -0
  20. data/spec/controllers/sso/sessions_controller_spec.rb +65 -0
  21. data/spec/fabricators/api_application_fabricator.rb +16 -0
  22. data/spec/fabricators/doorkeeper_access_grant_fabricator.rb +4 -0
  23. data/spec/fabricators/doorkeeper_access_token_fabricator.rb +5 -0
  24. data/spec/fabricators/doorkeeper_application_fabricator.rb +5 -0
  25. data/spec/fabricators/sso_session_fabricator.rb +6 -0
  26. data/spec/fabricators/user_fabricator.rb +35 -0
  27. data/spec/models/sso/session_spec.rb +183 -0
  28. data/spec/rails_helper.rb +21 -6
  29. data/spec/support/devise.rb +28 -0
  30. data/spec/test_app/Rakefile +0 -4
  31. data/spec/test_app/app/models/user.rb +39 -0
  32. data/spec/test_app/config/database.yml +5 -20
  33. data/spec/test_app/config/initializers/devise.rb +259 -0
  34. data/spec/test_app/config/initializers/doorkeeper.rb +111 -0
  35. data/spec/test_app/config/routes.rb +5 -1
  36. data/spec/test_app/db/schema.rb +78 -0
  37. metadata +86 -67
  38. data/app/controllers/sso/application_controller.rb +0 -4
  39. data/spec/test_app/README.rdoc +0 -28
  40. data/spec/test_app/app/assets/javascripts/application.js +0 -13
  41. data/spec/test_app/app/assets/stylesheets/application.css +0 -15
  42. data/spec/test_app/app/controllers/application_controller.rb +0 -5
  43. data/spec/test_app/app/helpers/application_helper.rb +0 -2
  44. data/spec/test_app/app/views/layouts/application.html.erb +0 -14
  45. data/spec/test_app/bin/bundle +0 -3
  46. data/spec/test_app/bin/rails +0 -4
  47. data/spec/test_app/bin/rake +0 -4
  48. data/spec/test_app/bin/setup +0 -29
  49. data/spec/test_app/config/application.rb +0 -32
  50. data/spec/test_app/config/boot.rb +0 -5
  51. data/spec/test_app/config/environment.rb +0 -5
  52. data/spec/test_app/config/environments/development.rb +0 -41
  53. data/spec/test_app/config/environments/production.rb +0 -79
  54. data/spec/test_app/config/environments/test.rb +0 -42
  55. data/spec/test_app/config/initializers/assets.rb +0 -11
  56. data/spec/test_app/config/initializers/backtrace_silencers.rb +0 -7
  57. data/spec/test_app/config/initializers/cookies_serializer.rb +0 -3
  58. data/spec/test_app/config/initializers/filter_parameter_logging.rb +0 -4
  59. data/spec/test_app/config/initializers/inflections.rb +0 -16
  60. data/spec/test_app/config/initializers/mime_types.rb +0 -4
  61. data/spec/test_app/config/initializers/session_store.rb +0 -3
  62. data/spec/test_app/config/initializers/wrap_parameters.rb +0 -14
  63. data/spec/test_app/config/locales/en.yml +0 -23
  64. data/spec/test_app/config/secrets.yml +0 -22
  65. data/spec/test_app/config.ru +0 -4
  66. data/spec/test_app/public/404.html +0 -67
  67. data/spec/test_app/public/422.html +0 -67
  68. data/spec/test_app/public/500.html +0 -66
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 96d97d8256151b2e024eab578d6c88f95335b2920c083822e9e13180039b8f5f5e9b09b6cfd42200aa91e42ba3586d652bbc30f6f8e84521a113b509035decb0
15
-
16
- test:
17
- secret_key_base: e35bfee66bb6deca060a8af1e42bd6028adc460d996f0483a3715b2fbd8c471576570733d21905c5103999f1a731f2a9f922f76879a5be2b1f38b52bf0060c9a
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>