decidim-ub 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f839c74adb775088f771a5619cd51544314f3db4ca280bb42cfdd72e86a92d9
4
- data.tar.gz: bafc15e519cb3b97323cf44db6b456dbccf18fe8aba1a49288982602f8e61c12
3
+ metadata.gz: a7a6641e87be62bae1a4e3e5966fdc8f2cfa1a2d562b65afca781e0b858d30e8
4
+ data.tar.gz: 55acc9758bd959e61c64c7978adde379880c6e9754eb911b5e34c4a08599e254
5
5
  SHA512:
6
- metadata.gz: 7581f4b66653fa93ac2105b5dd6b0dffb30954a327ef5927b1e9bd0aa3ee8dd144d91f7f888dfafe8f73c87801e6f3af627c8daea9d70a67f3f10c0f402d6e04
7
- data.tar.gz: 3725deea1ed1bd2077bebfbd869cf04ff55397d52d28795ad2ea6de8f6bb815f7641c1324b47b7dcee65a8e4e1b8481e079846c214183c07d86f7599bdaa2caa
6
+ metadata.gz: 8c6310ad728cb3a04148091acdcddf2e9c609bb92908d26b4afa2a9375ab431b826f46fb68bca9dcb197dce90e038041ac6b753c9df1a90c0798a03b6583eeb9
7
+ data.tar.gz: 9d36892dc92947731683452a26d4d67a6eb1cd758872bd596e3b50a58023c72e712f41026f5c3dc4fb78ce017ab9a1e8e476ac839fb9badd10b8595f8d2b51af
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Decidim::Ub
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/decidim-ub.svg)](https://badge.fury.io/rb/decidim-ub)
3
4
  [![[CI] Lint](https://github.com/Platoniq/decidim-module-ub/actions/workflows/lint.yml/badge.svg)](https://github.com/Platoniq/decidim-module-ub/actions/workflows/lint.yml)
4
5
  [![[CI] Test](https://github.com/Platoniq/decidim-module-ub/actions/workflows/test.yml/badge.svg)](https://github.com/Platoniq/decidim-module-ub/actions/workflows/test.yml)
5
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/c975a347c58389448503/maintainability)](https://codeclimate.com/github/Platoniq/decidim-module-ub/maintainability)
@@ -12,7 +13,7 @@ A Decidim module to sync users from Universitat de Barcelona who connect to the
12
13
  Add this line to your application's Gemfile:
13
14
 
14
15
  ```ruby
15
- gem "decidim-ub", git: "https://github.com/Platoniq/decidim-module-ub"
16
+ gem "decidim-ub"
16
17
  ```
17
18
 
18
19
  And then execute:
@@ -36,6 +37,22 @@ You need to configure some environment variables for the OAuth client:
36
37
  | UB_TOKEN_URL | The path for the token URL | `/token` | |
37
38
  | UB_ICON | The path for the icon shown in the button | `media/images/my_icon.svg` | `media/images/ub_logo.svg` |
38
39
 
40
+ If you set the variables you don't see the OAuth button in the organization, you will need to create an initializer to configure this module. Just create a file in `config/initializers/decidim_ub.rb` with the content below:
41
+
42
+ ```ruby
43
+ Decidim::Ub.configure do |config|
44
+ config.omniauth = {
45
+ enabled: ENV["UB_CLIENT_ID"].present?,
46
+ icon_path: ENV.fetch("UB_ICON", "media/images/ub_logo.svg"),
47
+ client_id: ENV["UB_CLIENT_ID"].presence,
48
+ client_secret: ENV["UB_CLIENT_SECRET"].presence,
49
+ site: ENV["UB_SITE"].presence,
50
+ authorize_url: ENV["UB_AUTHORIZE_URL"].presence,
51
+ token_url: ENV["UB_TOKEN_URL"].presence
52
+ }
53
+ end
54
+ ```
55
+
39
56
  ## Contributing
40
57
 
41
58
  Contributions are welcome !
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Ub
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
  DECIDIM_VERSION = "~> 0.28.0"
8
8
  COMPAT_DECIDIM_VERSION = [">= 0.28.0", "< 0.29"].freeze
9
9
  end
@@ -30,7 +30,7 @@ module OmniAuth
30
30
  def raw_info
31
31
  @raw_info ||= begin
32
32
  connection = Faraday.new(url: options.client_options[:site], ssl: { verify: true }) do |conn|
33
- conn.headers["Authorization"] = "#{access_token.response.parsed.token_type} #{access_token.token}"
33
+ conn.headers["Authorization"] = access_token.options[:header_format].gsub("%s", access_token.token)
34
34
  end
35
35
  response = connection.get("/api/adas/oauth2/tokendata")
36
36
  raise Error, "Unable to fetch the user information" unless response.success?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-ub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Bolívar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core