omniauth-intercom 0.1.8 → 0.1.10

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
- SHA1:
3
- metadata.gz: 659167fc6bcb8c1529ee51e0cf10e5b66f931297
4
- data.tar.gz: e04263a6148fc1fa07e4ca01bda1111cdb8938b8
2
+ SHA256:
3
+ metadata.gz: 16099f1903a57ba8cd032e9eb423ce91f36b9008a504e0bbfac081c2083d49a9
4
+ data.tar.gz: 7f78c86c40c436fe8275077f57e9bf1d4b90e7afc464cdd0fc1429e76d8a7465
5
5
  SHA512:
6
- metadata.gz: e64d197a2f6ada0addefa9caaa9fa88db9bdd669966dc913e7dc51aafaa7d626aa03149755e4e80d295abb3e0333184ed90fb287565df1d95ec534e4896ba6e4
7
- data.tar.gz: 2f6c7c107a1feae158a23a598302b8909be53b723ff8f2e6b46b0754b2e52c24e97eb170ae21104e35678817151edeed9d08f40d70a38aa36ad089281b964f1e
6
+ metadata.gz: 87d578451f2808ae17cc2dc21c2217e4ebac73b6eb254d7d649cb119bbd0ab4b3ccc979ab4b963d75d82e9594f640b131b0d230c211be0fb0db7f9e4c7508858
7
+ data.tar.gz: 072ff8e963d495ee18c3ffdde133f0ebe833cee7d45c226c311214303bceed48fff35202c847de758f839c90f10e129f2124d1887236147b0f0a20b61fd645b5
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: false
11
+
12
+ matrix:
13
+ ruby-version:
14
+ - 2.3
15
+ - 2.4
16
+ - 2.5
17
+ - 2.6
18
+ - 2.7
19
+ - "3.0"
20
+ - 3.1
21
+ - 3.2
22
+ - 3.3
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby-version }}
29
+ bundler-cache: true
30
+ - run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -50,4 +50,15 @@ Features:
50
50
  ## 0.1.8 (2017-03-07)
51
51
 
52
52
  Features:
53
- - update config to intercom.com domain
53
+ - update config to intercom.com domain
54
+
55
+ ## 0.1.9 (2017-03-07)
56
+
57
+ Features:
58
+ - fix site config
59
+
60
+ ## 0.1.10 (2024-08-16)
61
+
62
+ Features:
63
+
64
+ - Fix compatibility with Faraday 2.0
data/README.md CHANGED
@@ -9,13 +9,16 @@ Supports the OAuth 2.0 server-side and client-side flows. Read the [Intercom OAu
9
9
  Add to your `Gemfile`:
10
10
 
11
11
  ```ruby
12
- gem 'omniauth-intercom', '~> 0.1.8'
12
+ gem 'omniauth-intercom', '~> 0.1.9'
13
13
  ```
14
14
 
15
15
  Then `bundle install`.
16
16
 
17
17
  ## Usage
18
18
 
19
+ **Important** For this to work you need to select the `read_single_admin` permissions in your OAuth application to use this middleware.
20
+ **Important** You will also need to ensure your `redirect_url` is set to `/auth/intercom/callback`
21
+
19
22
  `OmniAuth::Strategies::Intercom` is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.
20
23
 
21
24
  Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
@@ -28,8 +31,8 @@ end
28
31
  To start the authentication process with Intercom you simply need to access `/auth/intercom` route.
29
32
  You can start the authentication process directly with the signup page by accessing `/auth/intercom?signup=1`
30
33
 
31
- **Important** You need the `read_single_admin` permissions to use this middleware.
32
- **Important** Your `redirect_url` should be `/auth/intercom/callback`
34
+ **Important** Reminder: As noted earlier you need the `read_single_admin` permissions to use this middleware.
35
+ **Important** Reminder: As noted earlier your `redirect_url` should be `/auth/intercom/callback`
33
36
 
34
37
  By default Intercom strategy rejects users with unverified email addresses. `info` and `raw_info` in `request.env['omniauth.auth']` will not be populated in that case.
35
38
  To disable this check add `verify_email: false` to your config:
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Intercom
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.10"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require 'omniauth-oauth2'
2
- require 'uri'
2
+ require 'base64'
3
3
 
4
4
  module OmniAuth
5
5
  module Strategies
@@ -7,6 +7,7 @@ module OmniAuth
7
7
  option :name, 'intercom'
8
8
 
9
9
  option :client_options, {
10
+ :site => 'https://api.intercom.io',
10
11
  :authorize_url => 'https://app.intercom.com/oauth',
11
12
  :token_url => 'https://api.intercom.io/auth/eagle/token'
12
13
  }
@@ -52,11 +53,15 @@ module OmniAuth
52
53
  protected
53
54
 
54
55
  def accept_headers
55
- access_token.client.connection.headers['Authorization'] = access_token.client.connection.basic_auth(access_token.token, '')
56
+ access_token.client.connection.headers['Authorization'] = "Basic #{basic_auth_credentials}"
56
57
  access_token.client.connection.headers['Accept'] = "application/vnd.intercom.3+json"
57
58
  access_token.client.connection.headers['User-Agent'] = "omniauth-intercom/#{::OmniAuth::Intercom::VERSION}"
58
59
  end
59
60
 
61
+ def basic_auth_credentials
62
+ Base64.encode64("#{access_token.token}:").delete("\n")
63
+ end
64
+
60
65
  def prepopulate_signup_fields_form
61
66
  options.client_options[:authorize_url] += '/signup'
62
67
  signup_hash = signup_fields_hash
@@ -17,9 +17,10 @@ Gem::Specification.new do |spec|
17
17
  spec.bindir = "exe"
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
+
20
21
  spec.add_runtime_dependency 'omniauth-oauth2', '>= 1.2'
22
+ spec.add_runtime_dependency 'base64'
21
23
 
22
- spec.add_development_dependency "bundler", "~> 1.12"
23
24
  spec.add_development_dependency "rake", "~> 10.0"
24
25
  spec.add_development_dependency "rspec", "~> 3.0"
25
26
  spec.add_development_dependency "rack", "~> 1.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Antoine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2024-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: base64
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.12'
34
- type: :development
33
+ version: '0'
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: '1.12'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,16 +80,16 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.6'
83
- description:
83
+ description:
84
84
  email:
85
85
  - kevin.antoine@intercom.io
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/workflows/ci.yml"
90
91
  - ".gitignore"
91
92
  - ".rspec"
92
- - ".travis.yml"
93
93
  - CHANGELOG.md
94
94
  - Gemfile
95
95
  - LICENSE.txt
@@ -107,7 +107,7 @@ homepage: https://github.com/intercom/omniauth-intercom
107
107
  licenses:
108
108
  - MIT
109
109
  metadata: {}
110
- post_install_message:
110
+ post_install_message:
111
111
  rdoc_options: []
112
112
  require_paths:
113
113
  - lib
@@ -122,9 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.5.1
127
- signing_key:
125
+ rubygems_version: 3.5.11
126
+ signing_key:
128
127
  specification_version: 4
129
128
  summary: Intercom OAuth2 Strategy for OmniAuth
130
129
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.1.7
5
- before_install: gem install bundler -v 1.12.1