decidim-idcat_mobil 0.0.2 → 0.0.8

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
  SHA256:
3
- metadata.gz: 96b80e3ed698a840c6f060e5abcc21fe4a856dbc8099e270a5f7b5e4b3726593
4
- data.tar.gz: 326481fa62991658077b9c51a26210bf8f583957d60a2299b40ac5a2345b459b
3
+ metadata.gz: b454f522c4a256257b735d79838827f46a0fcb45680f9b301ce34c4d0eb7b074
4
+ data.tar.gz: 3702f791f1cfe0060a760376d599fe1b9368525417c62a0b3893997e7f758115
5
5
  SHA512:
6
- metadata.gz: 53146063ec24b7d71e86ee2af0b6b50e7217e7c361d6e5ee24d698d010aab25bb41197c7ffe01fbb53742ca994e098fdcf7150c3c71d77abcb19ce8ef0fd0f62
7
- data.tar.gz: 99638279e26178fe5a0b96cefd9834e587b601c2a1aa182e8a52a868f379467756ef1be5b579c465efc90d1d818bfa79613394253bf56acde9ac42244c1f2f17
6
+ metadata.gz: 9c556c71df830c6b73073c41ff23eec3876f32b69349fe979f098148de5d3c2841ce71faf6bc7012fca9c281ea5b80f40fe842b23dabd535eb14853f1caacdfb
7
+ data.tar.gz: e1c8b71e6bf9881fe9d26f3634aef1dce42bef4f734940ab6432ba606196c786d05517aac251e456b2b32c8eb8152bddeab538f640ffc372778dbe7fe426672a
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Decidim::IdcatMobil
2
2
 
3
- User registration, login and verification through IdCat mòbil, an authentication method that uses OAuth 2.0 protocol.
3
+ User registration and login through IdCat Mòbil, an authentication method that uses OAuth 2.0 protocol.
4
4
  _IdCat mòbil_ is an identity validator from VÀLid (Validador d'Identitats del Consorci AOC).
5
5
 
6
+ User verification via IdCat Mòbil was started but is incomplete.
7
+
6
8
  ## Installation
7
9
 
8
10
  Add this line to your application's Gemfile:
@@ -19,23 +21,28 @@ bundle install
19
21
 
20
22
  ## Usage
21
23
 
22
- To use it you have to first configure the omniauth-idcat_mobil and then this gem as a verification handler.
24
+ To use it you have to first configure the omniauth-idcat_mobil.
23
25
 
24
26
  ### omniauth-idcat_mobil configuration
25
27
  `IdCat mòbil` will be available as a configurable OAuth2 strategy.
26
- Check how to configure the strategy in [Decidim's related documentation](). The summary is that you have to edit your `config/secrets.rb` and simply enable the strategy:
28
+ Check how to configure the strategy in [Decidim's related documentation](https://github.com/decidim/decidim/blob/develop/docs/services/social_providers.md). The summary is that you have to edit your `config/secrets.rb` and simply enable the strategy:
27
29
 
28
30
  ```yaml
29
31
  omniauth:
30
32
  idcat_mobil:
31
33
  enabled: true
34
+ icon_path: decidim/idcat_mobil/icon.svg
32
35
  ```
33
36
 
34
- Omniauth's configuration is setted in `config/initializers/omniauth_idcat_mobil.rb`. Nothing has to be modified there but it expects `IDCAT_MOBIL_CLIENT_ID`, `IDCAT_MOBIL_CLIENT_SECRET` and `IDCAT_MOBIL_SITE_URL` environment variables to be setted.
37
+ Remember to set `IDCAT_MOBIL_CLIENT_ID`, `IDCAT_MOBIL_CLIENT_SECRET` and `IDCAT_MOBIL_SITE_URL` environment variables.
35
38
 
36
39
 
37
40
  Refer to `omniauth-idcat_mobil` gem for further documentation.
38
41
 
42
+ ## TODO
43
+
44
+ - User Verification development has to be finished.
45
+
39
46
  ## Contributing
40
47
 
41
48
  See [Decidim](https://github.com/decidim/decidim).
@@ -45,15 +52,18 @@ See [Decidim](https://github.com/decidim/decidim).
45
52
  Create a dummy app in your application (if not present):
46
53
 
47
54
  ```bash
48
- bin/rails decidim:generate_external_test_app
55
+ bundle exec rake decidim:generate_external_test_app
49
56
  ```
50
57
 
51
58
  And run tests:
52
59
 
53
60
  ```bash
54
- rspec spec
61
+ bundle exec rspec spec/
55
62
  ```
56
63
 
57
64
  ## License
58
65
 
59
- This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.
66
+
67
+ The Department d'Exteriors of [Generalitat de Catalunya](http://gencat.cat) makes this gem available as open source under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE.
68
+
69
+ Authored by [CodiTramuntana](http://coditramuntana.com).
@@ -1 +1,8 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 35"><path d="M17.5 35A17.5 17.5 0 1 1 35 17.5 17.52 17.52 0 0 1 17.5 35zm0-33.06A15.56 15.56 0 1 0 33.06 17.5 15.57 15.57 0 0 0 17.5 1.94zm9.5 13.7H8a1 1 0 0 1 0-1.94h19a1 1 0 0 1 0 1.94zm0 3.68H8a1 1 0 0 1 0-1.94h19a1 1 0 0 1 0 1.94zM22.26 23H8a1 1 0 0 1 0-1.94h14.26a1 1 0 0 1 0 1.94z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="44" height="56" viewBox="0 0 44 56">
2
+ <g fill="#FFF" fill-rule="evenodd">
3
+ <path fill-rule="nonzero" d="M11.53 6.73L2.07 6.73 2.07.09 11.53.09 11.53 6.73zM2.07 9.4L11.53 9.4 11.53 34.19 2.07 34.19 2.07 9.4zM42.71 34.19L33.59 34.19 33.59 31.47 33.5 31.47C32.3 33.04 30.87 34.81 26.24 34.81 19.24 34.81 15.82 27.89 15.82 21.68 15.82 15.85 18.07 8.78 26.38 8.78 29.05573 8.70308662 31.5954717 9.95797374 33.16 12.13L33.26 12.13 33.26.13 42.71.13 42.71 34.19zM29.44 15.66C26.04 15.66 25.28 18.86 25.28 21.77 25.28 24.68 26.04 27.93 29.44 27.93 32.84 27.93 33.59 24.73 33.59 21.77 33.59 18.81 32.83 15.66 29.44 15.66z"/>
4
+ <path d="M10.94,46.13 C10.8353818,44.8627645 9.77151075,43.8904562 8.5,43.9 C6.31,43.9 5.61,46.02 5.61,48.06 C5.61,50.1 6.31,52.22 8.5,52.22 C10.07,52.22 10.68,51.12 10.96,49.69 L15.55,49.69 C15.55,52.75 13.06,56 8.62,56 C3.72,56 0.94,52.54 0.94,48.06 C0.94,43.28 3.94,40.12 8.62,40.12 C12.79,40.12 15.08,42.32 15.48,46.12 L10.94,46.13 Z"/>
5
+ <path fill-rule="nonzero" d="M21.7,40.48 L26.27,40.48 L31.79,55.64 L27,55.64 L26.36,53.47 L21.49,53.47 L20.81,55.64 L16.12,55.64 L21.7,40.48 Z M25.38,50.22 L24,45.55 L22.53,50.22 L25.38,50.22 Z"/>
6
+ <polygon points="34.93 44.36 30.68 44.36 30.68 40.48 43.85 40.48 43.85 44.36 39.6 44.36 39.6 55.64 34.93 55.64"/>
7
+ </g>
8
+ </svg>
@@ -1,11 +1,18 @@
1
1
  OmniAuth.config.logger= Rails.logger
2
2
 
3
- Devise.setup do |config|
4
- config.omniauth :idcat_mobil,
5
- ENV["IDCAT_MOBIL_CLIENT_ID"],
6
- ENV["IDCAT_MOBIL_CLIENT_SECRET"],
7
- ENV["IDCAT_MOBIL_SITE_URL"],
8
- scope: :autenticacio_usuari
9
- end
10
-
11
- Decidim::User.omniauth_providers << :idcat_mobil
3
+ if Rails.application.secrets.dig(:omniauth, :idcat_mobil).present?
4
+ Rails.application.config.middleware.use OmniAuth::Builder do
5
+ provider(
6
+ :idcat_mobil,
7
+ setup: ->(env) {
8
+ request = Rack::Request.new(env)
9
+ organization = Decidim::Organization.find_by(host: request.host)
10
+ provider_config = organization.enabled_omniauth_providers[:idcat_mobil]
11
+ env["omniauth.strategy"].options[:client_id] = provider_config[:client_id] || ENV["IDCAT_MOBIL_CLIENT_ID"]
12
+ env["omniauth.strategy"].options[:client_secret] = provider_config[:client_secret] || ENV["IDCAT_MOBIL_CLIENT_SECRET"]
13
+ env["omniauth.strategy"].options[:site] = provider_config[:site_url] || ENV["IDCAT_MOBIL_SITE_URL"]
14
+ },
15
+ scope: :autenticacio_usuari
16
+ )
17
+ end
18
+ end
@@ -16,17 +16,17 @@ module Decidim
16
16
  # root to: "idcat_mobil#index"
17
17
  end
18
18
 
19
- #
20
- # Force `Decidim::CurrentOrganization` to be executed before `Warden::Manager` to avoid path generation problems.
21
- # NOTE: Remove this initializer when in Decidim 0.16.0 where it has been fixed.
22
- #
23
- initializer "decidim.middleware" do |app|
24
- # as `app.config.middleware` is just a proxy made available for configuration purposes
25
- # and acts as a command recorder that executes deletes always at the end
26
- # we can not remove and re-insert, but only duplicate `Decidim::CurrentOrganization`.
27
- # app.config.middleware.delete Decidim::CurrentOrganization
28
- app.config.middleware.insert_before Warden::Manager, Decidim::CurrentOrganization
29
- end
19
+ # #
20
+ # # Force `Decidim::CurrentOrganization` to be executed before `Warden::Manager` to avoid path generation problems.
21
+ # # NOTE: Remove this initializer when in Decidim 0.16.0 where it has been fixed.
22
+ # #
23
+ # initializer "decidim.middleware" do |app|
24
+ # # as `app.config.middleware` is just a proxy made available for configuration purposes
25
+ # # and acts as a command recorder that executes deletes always at the end
26
+ # # we can not remove and re-insert, but only duplicate `Decidim::CurrentOrganization`.
27
+ # # app.config.middleware.delete Decidim::CurrentOrganization
28
+ # app.config.middleware.insert_before Warden::Manager, Decidim::CurrentOrganization
29
+ # end
30
30
 
31
31
  # initializer "decidim_idcat_mobil.assets" do |app|
32
32
  # app.config.assets.precompile += %w[decidim_idcat_mobil_manifest.js decidim_idcat_mobil_manifest.css]
@@ -4,7 +4,7 @@ module Decidim
4
4
  module IdcatMobil
5
5
  def self.version
6
6
  # See CHANGELOG.md to see what changed
7
- "0.0.2"
7
+ "0.0.8"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-idcat_mobil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Valls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-01 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-idcat_mobil
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.1
19
+ version: 0.2.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.1
26
+ version: 0.2.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.13.1
33
+ version: 0.20.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.13.1
40
+ version: 0.20.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.13.1
47
+ version: 0.20.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.13.1
54
+ version: 0.20.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-dev
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.13.1
61
+ version: 0.20.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.13.1
68
+ version: 0.20.0
69
69
  description: User registration, login and verification though VÀLid's IdCat mòbil..
70
70
  email:
71
71
  - oliver.vh@coditramuntana.com
@@ -113,15 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: 2.3.1
116
+ version: 2.7.2
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.7.6
123
+ rubygems_version: 3.1.4
125
124
  signing_key:
126
125
  specification_version: 4
127
126
  summary: A decidim idcat_mobil module