workarea-facebook_login 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +15 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.github/workflows/ci.yml +56 -0
  7. data/.gitignore +13 -0
  8. data/.jshintrc +31 -0
  9. data/.rubocop.yml +2 -0
  10. data/CHANGELOG.md +74 -0
  11. data/Gemfile +11 -0
  12. data/README.md +13 -0
  13. data/Rakefile +42 -0
  14. data/app/controllers/workarea/storefront/users/facebook_logins_controller.rb +46 -0
  15. data/app/models/workarea/user.decorator +41 -0
  16. data/app/views/workarea/storefront/users/_facebook_login.html.haml +6 -0
  17. data/bin/rails +18 -0
  18. data/config/initializers/appends.rb +4 -0
  19. data/config/initializers/omniauth.rb +1 -0
  20. data/config/locales/en.yml +14 -0
  21. data/config/routes.rb +5 -0
  22. data/lib/workarea/facebook_login.rb +36 -0
  23. data/lib/workarea/facebook_login/engine.rb +8 -0
  24. data/lib/workarea/facebook_login/version.rb +5 -0
  25. data/test/dummy/Rakefile +6 -0
  26. data/test/dummy/bin/bundle +3 -0
  27. data/test/dummy/bin/rails +4 -0
  28. data/test/dummy/bin/rake +4 -0
  29. data/test/dummy/bin/setup +34 -0
  30. data/test/dummy/bin/update +29 -0
  31. data/test/dummy/config.ru +5 -0
  32. data/test/dummy/config/application.rb +21 -0
  33. data/test/dummy/config/boot.rb +5 -0
  34. data/test/dummy/config/cable.yml +9 -0
  35. data/test/dummy/config/environment.rb +5 -0
  36. data/test/dummy/config/environments/development.rb +54 -0
  37. data/test/dummy/config/environments/production.rb +86 -0
  38. data/test/dummy/config/environments/test.rb +44 -0
  39. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  40. data/test/dummy/config/initializers/assets.rb +11 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  43. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  44. data/test/dummy/config/initializers/inflections.rb +16 -0
  45. data/test/dummy/config/initializers/mime_types.rb +4 -0
  46. data/test/dummy/config/initializers/workarea.rb +4 -0
  47. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  48. data/test/dummy/config/locales/en.yml +23 -0
  49. data/test/dummy/config/puma.rb +47 -0
  50. data/test/dummy/config/routes.rb +5 -0
  51. data/test/dummy/config/secrets.yml +22 -0
  52. data/test/dummy/config/spring.rb +6 -0
  53. data/test/dummy/db/seeds.rb +2 -0
  54. data/test/dummy/lib/assets/.keep +0 -0
  55. data/test/dummy/log/.keep +0 -0
  56. data/test/dummy/public/404.html +67 -0
  57. data/test/dummy/public/422.html +67 -0
  58. data/test/dummy/public/500.html +66 -0
  59. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  60. data/test/dummy/public/apple-touch-icon.png +0 -0
  61. data/test/dummy/public/favicon.ico +1 -0
  62. data/test/integration/workarea/storefront/users/facebook_logins_integration_test.rb +63 -0
  63. data/test/support/facebook_login_support.rb +50 -0
  64. data/test/system/workarea/storefront/facebook_login_system_test.rb +20 -0
  65. data/test/test_helper.rb +13 -0
  66. data/workarea-facebook_login.gemspec +21 -0
  67. metadata +155 -0
@@ -0,0 +1,50 @@
1
+ module Workarea
2
+ module Testing
3
+ module FacebookLoginSupport
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ setup do
8
+ # OmniAuth uses RACK_ENV to determine whether it should raise out
9
+ # errors.
10
+ # https://github.com/omniauth/omniauth/blob/master/lib/omniauth/failure_endpoint.rb#L20
11
+ #
12
+ # RACK_ENV can be inconsistent (doesn't always match RAILS_ENV).
13
+ # Sometimes it'll end up as `development` in tests causing what look
14
+ # like random failures because this is part of the default value of
15
+ # `OmniAuth.config.failure_raise_out_environments`.
16
+ #
17
+ # Clearing these out ensures OmniAuth doesn't raise regardless of
18
+ # RACK_ENV. This is helpful when want to test failure scenarios.
19
+ #
20
+ # Note that the errors will still log to STDOUT, but OmniAuth won't
21
+ # actually raise the error causing the test to fail.
22
+ #
23
+ @_omni_auth_failure_raise_out_environments = OmniAuth.config.failure_raise_out_environments
24
+ OmniAuth.config.failure_raise_out_environments = []
25
+ end
26
+
27
+ teardown do
28
+ OmniAuth.config.failure_raise_out_environments = @_omni_auth_failure_raise_out_environments
29
+ end
30
+ end
31
+
32
+ def with_omniauth_testing(successful = true, &blck)
33
+ OmniAuth.config.test_mode = true
34
+ OmniAuth.config.add_mock(:facebook,
35
+ uid: "1234",
36
+ info: { email: "epigeon@weblinc.com" },
37
+ credentials: {
38
+ token: "1234",
39
+ expires_at: Time.now.to_i
40
+ }
41
+ )
42
+
43
+ blck.call
44
+ ensure
45
+ OmniAuth.config.test_mode = false
46
+ OmniAuth.config.mock_auth[:facebook] = nil
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,20 @@
1
+ require "test_helper"
2
+
3
+ module Workarea
4
+ class Storefront::FacebookLoginsSystemTest < Workarea::SystemTest
5
+ include Testing::FacebookLoginSupport
6
+
7
+ def test_logging_in
8
+ with_omniauth_testing do
9
+ visit storefront.login_path
10
+
11
+ click_link t("workarea.storefront.facebook_login.connect_with_facebook")
12
+
13
+ assert(
14
+ page.has_current_path?(storefront.users_account_path),
15
+ "Expected page to have current path #{storefront.users_account_path}"
16
+ )
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ require "simplecov"
2
+
3
+ SimpleCov.start "rails" do
4
+ add_filter "lib/workarea/facebook/version.rb"
5
+ end
6
+
7
+ ENV["RAILS_ENV"] = "test"
8
+
9
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
10
+ require "rails/test_help"
11
+ require "workarea/test_help"
12
+
13
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,21 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require "workarea/facebook_login/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "workarea-facebook_login"
7
+ s.version = Workarea::FacebookLogin::VERSION
8
+ s.authors = ["Eric Pigeon"]
9
+ s.email = ["epigeon@workarea.com"]
10
+ s.homepage = "https://stash.tools.weblinc.com/projects/WP/repos/workarea-facebook-login/browse"
11
+ s.summary = "Facebook Login plugin for the Workarea ecommerce platform"
12
+ s.description = "Plugin for sign in with Facebook on the Workarea ecommerce platform."
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+
16
+ s.required_ruby_version = ">= 2.0.0"
17
+
18
+ s.add_dependency "omniauth-facebook", "~> 5.0"
19
+ s.add_dependency "omniauth-rails_csrf_protection", "~> 0.1"
20
+ s.add_dependency "workarea", "~> 3.x", ">= 3.5.0"
21
+ end
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-facebook_login
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Eric Pigeon
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-facebook
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-rails_csrf_protection
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: workarea
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.x
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 3.5.0
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: 3.x
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 3.5.0
61
+ description: Plugin for sign in with Facebook on the Workarea ecommerce platform.
62
+ email:
63
+ - epigeon@workarea.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - ".editorconfig"
69
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
70
+ - ".github/ISSUE_TEMPLATE/documentation-request.md"
71
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
72
+ - ".github/workflows/ci.yml"
73
+ - ".gitignore"
74
+ - ".jshintrc"
75
+ - ".rubocop.yml"
76
+ - CHANGELOG.md
77
+ - Gemfile
78
+ - README.md
79
+ - Rakefile
80
+ - app/controllers/workarea/storefront/users/facebook_logins_controller.rb
81
+ - app/models/workarea/user.decorator
82
+ - app/views/workarea/storefront/users/_facebook_login.html.haml
83
+ - bin/rails
84
+ - config/initializers/appends.rb
85
+ - config/initializers/omniauth.rb
86
+ - config/locales/en.yml
87
+ - config/routes.rb
88
+ - lib/workarea/facebook_login.rb
89
+ - lib/workarea/facebook_login/engine.rb
90
+ - lib/workarea/facebook_login/version.rb
91
+ - test/dummy/Rakefile
92
+ - test/dummy/bin/bundle
93
+ - test/dummy/bin/rails
94
+ - test/dummy/bin/rake
95
+ - test/dummy/bin/setup
96
+ - test/dummy/bin/update
97
+ - test/dummy/config.ru
98
+ - test/dummy/config/application.rb
99
+ - test/dummy/config/boot.rb
100
+ - test/dummy/config/cable.yml
101
+ - test/dummy/config/environment.rb
102
+ - test/dummy/config/environments/development.rb
103
+ - test/dummy/config/environments/production.rb
104
+ - test/dummy/config/environments/test.rb
105
+ - test/dummy/config/initializers/application_controller_renderer.rb
106
+ - test/dummy/config/initializers/assets.rb
107
+ - test/dummy/config/initializers/backtrace_silencers.rb
108
+ - test/dummy/config/initializers/cookies_serializer.rb
109
+ - test/dummy/config/initializers/filter_parameter_logging.rb
110
+ - test/dummy/config/initializers/inflections.rb
111
+ - test/dummy/config/initializers/mime_types.rb
112
+ - test/dummy/config/initializers/workarea.rb
113
+ - test/dummy/config/initializers/wrap_parameters.rb
114
+ - test/dummy/config/locales/en.yml
115
+ - test/dummy/config/puma.rb
116
+ - test/dummy/config/routes.rb
117
+ - test/dummy/config/secrets.yml
118
+ - test/dummy/config/spring.rb
119
+ - test/dummy/db/seeds.rb
120
+ - test/dummy/lib/assets/.keep
121
+ - test/dummy/log/.keep
122
+ - test/dummy/public/404.html
123
+ - test/dummy/public/422.html
124
+ - test/dummy/public/500.html
125
+ - test/dummy/public/apple-touch-icon-precomposed.png
126
+ - test/dummy/public/apple-touch-icon.png
127
+ - test/dummy/public/favicon.ico
128
+ - test/integration/workarea/storefront/users/facebook_logins_integration_test.rb
129
+ - test/support/facebook_login_support.rb
130
+ - test/system/workarea/storefront/facebook_login_system_test.rb
131
+ - test/test_helper.rb
132
+ - workarea-facebook_login.gemspec
133
+ homepage: https://stash.tools.weblinc.com/projects/WP/repos/workarea-facebook-login/browse
134
+ licenses: []
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options: []
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 2.0.0
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubygems_version: 3.0.6
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: Facebook Login plugin for the Workarea ecommerce platform
155
+ test_files: []