groovestack-auth 0.1.1 → 0.1.2
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 +4 -4
- data/Gemfile.lock +3 -0
- data/config/initializers/core_config.rb +5 -5
- data/config/initializers/graphql_devise.rb +1 -1
- data/groovestack-auth.gemspec +2 -1
- data/lib/groovestack/auth/omniauth_callbacks_controller.rb +1 -1
- data/lib/groovestack/auth/railtie.rb +0 -8
- data/lib/groovestack/auth/version.rb +1 -1
- metadata +27 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d55e1534f363ae608acb764eaa95c7ceb0a964fa1d1964ae16886073a7b7bdea
|
4
|
+
data.tar.gz: fc391b6a965a59a915767c388a6fd5a983dd406d645fffc7709418f0431870b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94fa6bc15d8e1e52931130f37b303bbaac701e94b083b1fffa62c6441ee6bfc899ff05ba1f4bad461253573f91e24d41730468bb241158f0bb4cd058159207bc
|
7
|
+
data.tar.gz: fc9b032a60b9425baf77bb9879e986a805049bdeb33a316fac897e2f897cf5035e331f1c3a3bf1abe54948466d53bc298f93ac28e19ef7f7019a0f800b1d1227
|
data/Gemfile.lock
CHANGED
@@ -3,6 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
groovestack-auth (0.1.1)
|
5
5
|
groovestack-base (>= 0.1.7)
|
6
|
+
groovestack-config (>= 0.1.1)
|
6
7
|
jsonb_accessor (~> 1.4)
|
7
8
|
omniauth-apple
|
8
9
|
omniauth-google-oauth2
|
@@ -67,6 +68,8 @@ GEM
|
|
67
68
|
pg (~> 1.0)
|
68
69
|
pg_lock (~> 1.0)
|
69
70
|
puma (~> 5.0)
|
71
|
+
groovestack-config (0.1.1)
|
72
|
+
groovestack-base (~> 0.1.5)
|
70
73
|
hashie (5.0.0)
|
71
74
|
i18n (1.14.7)
|
72
75
|
concurrent-ruby (~> 1.0)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
ActiveSupport.on_load(:after_initialize) do # rubocop:disable Metrics/BlockLength
|
4
|
-
if defined?(
|
5
|
-
|
6
|
-
|
4
|
+
if defined?(Groovestack::Config)
|
5
|
+
Groovestack::Config::App.dynamic_config << { key: :has_admins, build: proc { User.admins.count.positive? } }
|
6
|
+
Groovestack::Config::App.dynamic_config << { key: :user_roles, build: proc { User::ROLES } }
|
7
7
|
|
8
|
-
|
8
|
+
Groovestack::Config::App.dynamic_config << {
|
9
9
|
key: :oauth_providers,
|
10
10
|
build: proc do
|
11
11
|
{
|
@@ -24,7 +24,7 @@ ActiveSupport.on_load(:after_initialize) do # rubocop:disable Metrics/BlockLengt
|
|
24
24
|
end
|
25
25
|
}
|
26
26
|
|
27
|
-
|
27
|
+
Groovestack::Config::App.dynamic_config << {
|
28
28
|
key: :auth_providers,
|
29
29
|
build: proc do
|
30
30
|
{
|
@@ -46,7 +46,7 @@ if defined?(GraphqlDevise)
|
|
46
46
|
def build_resource(attrs)
|
47
47
|
# NOTE: remove provider from attrs b/c use identity model
|
48
48
|
attrs.delete(:provider)
|
49
|
-
attrs[:roles] = [Users::Roles::Role::ADMIN] unless
|
49
|
+
attrs[:roles] = [Users::Roles::Role::ADMIN] unless Groovestack::Config::App.generate_config[:has_admins]
|
50
50
|
resource_class.new(attrs)
|
51
51
|
end
|
52
52
|
end
|
data/groovestack-auth.gemspec
CHANGED
@@ -30,7 +30,8 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ['lib']
|
32
32
|
|
33
|
-
spec.add_dependency 'groovestack-base', '>= 0.1.7'
|
33
|
+
spec.add_dependency 'groovestack-base', '~> 0.1', '>= 0.1.7'
|
34
|
+
spec.add_dependency 'groovestack-config', '~> 0.1', '>= 0.1.1'
|
34
35
|
spec.add_dependency 'jsonb_accessor', '~>1.4'
|
35
36
|
|
36
37
|
# spec.add_development_dependency 'graphql_devise'
|
@@ -68,7 +68,7 @@ module Groovestack
|
|
68
68
|
current_user: c_user,
|
69
69
|
user_attrs: {
|
70
70
|
defaults: {
|
71
|
-
roles:
|
71
|
+
roles: Groovestack::Config::App.generate_config[:has_admins] ? [] : [Users::Roles::Role::ADMIN]
|
72
72
|
},
|
73
73
|
priority: {
|
74
74
|
language: language
|
@@ -10,14 +10,6 @@ if defined?(Rails)
|
|
10
10
|
|
11
11
|
def dx_validations
|
12
12
|
[
|
13
|
-
{
|
14
|
-
eval: proc { raise unless defined?(::Groovestack::Base) },
|
15
|
-
message: "Error: 'core-base' gem is required, add it your your gemfile"
|
16
|
-
},
|
17
|
-
{
|
18
|
-
eval: proc { raise unless defined?(::Core::Config) },
|
19
|
-
message: "Error: 'core-config' gem is required, add it your your gemfile"
|
20
|
-
},
|
21
13
|
{
|
22
14
|
eval: proc {
|
23
15
|
raise if ::Groovestack::Auth.enabled_providers_sans_configuration.present?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groovestack-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Schridde
|
@@ -14,6 +14,9 @@ dependencies:
|
|
14
14
|
name: groovestack-base
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.1'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 0.1.7
|
@@ -21,9 +24,32 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.1'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 0.1.7
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: groovestack-config
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.1.1
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.1.1
|
27
53
|
- !ruby/object:Gem::Dependency
|
28
54
|
name: jsonb_accessor
|
29
55
|
requirement: !ruby/object:Gem::Requirement
|