omniauth-highlevel 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 +4 -4
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/omniauth/strategies/highlevel.rb +33 -13
- data/lib/omniauth-highlevel/version.rb +5 -0
- data/lib/omniauth-highlevel.rb +2 -2
- metadata +9 -23
- data/.standard.yml +0 -3
- data/CHANGELOG.md +0 -5
- data/LICENSE.txt +0 -21
- data/README.md +0 -1
- data/Rakefile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d80e6c9f55ff7ad3bdab69fd961af0ccc74fcc99e1c6ea14ae6d0784b8df0fb0
|
4
|
+
data.tar.gz: 94f9d52f3717981ad947254402ae96cdc07cee46655a872125d99860493fcae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8f77ec73fa3cef0eee8e23b0bd9ff9176603c673ddd3286f82edaaa08420cf03946ad53e983ec321c3902e2686781c886d6444eb5da39b07cf6c9627c40fc5
|
7
|
+
data.tar.gz: d52cae239103d0f900a2939a3afd6c7420bd350b4a1cf5414af6ee266464ef53bd7c92bbbdc7e3894e339d1b83fcac153061eb722e8ec25585e79de94b0cbf00
|
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "omniauth/highlevel"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
require "irb"
|
11
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -1,35 +1,55 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'omniauth-oauth2'
|
4
|
+
|
3
5
|
module OmniAuth
|
4
6
|
module Strategies
|
5
7
|
class Highlevel < OmniAuth::Strategies::OAuth2
|
6
|
-
option :name,
|
8
|
+
option :name, 'highlevel'
|
9
|
+
option :user_type, 'Company'
|
7
10
|
|
8
11
|
option :client_options, {
|
9
|
-
site:
|
10
|
-
authorize_url:
|
11
|
-
token_url:
|
12
|
+
site: 'https://services.leadconnectorhq.com',
|
13
|
+
authorize_url: 'https://marketplace.gohighlevel.com/oauth/chooselocation',
|
14
|
+
token_url: 'https://services.leadconnectorhq.com/oauth/token'
|
12
15
|
}
|
13
16
|
|
14
17
|
option :authorize_params, {
|
15
|
-
scope:
|
18
|
+
scope: 'locations.readonly users.readonly opportunities.readonly opportunities.write contacts.readonly contacts.write calendars.readonly calendars.write calendars/events.readonly calendars/events.write workflows.readonly'
|
16
19
|
}
|
17
20
|
|
18
21
|
option :token_options, {
|
19
22
|
method: :post
|
20
23
|
}
|
21
24
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
uid { raw_info['user_id'] }
|
26
|
+
|
27
|
+
credentials do
|
28
|
+
hash = { 'token' => access_token.token }
|
29
|
+
hash['refresh_token'] = access_token.refresh_token if access_token.expires? && access_token.refresh_token
|
30
|
+
hash['expires_at'] = access_token.expires_at if access_token.expires?
|
31
|
+
hash['expires'] = access_token.expires?
|
32
|
+
hash['companyId'] = raw_info['companyId']
|
33
|
+
hash
|
34
|
+
end
|
25
35
|
|
26
|
-
|
36
|
+
info do
|
37
|
+
info = raw_info || {}
|
38
|
+
info = deep_symbolize(info)
|
39
|
+
info
|
40
|
+
end
|
41
|
+
|
42
|
+
def raw_info
|
43
|
+
@raw_info ||= access_token.params
|
44
|
+
end
|
27
45
|
|
28
46
|
def token_params
|
29
|
-
super.merge(
|
30
|
-
|
31
|
-
|
32
|
-
|
47
|
+
super.merge(
|
48
|
+
{
|
49
|
+
client_id: client.id,
|
50
|
+
client_secret: client.secret
|
51
|
+
}
|
52
|
+
)
|
33
53
|
end
|
34
54
|
end
|
35
55
|
end
|
data/lib/omniauth-highlevel.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-highlevel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Troy Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: omniauth
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: omniauth-oauth2
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -41,16 +27,16 @@ dependencies:
|
|
41
27
|
description:
|
42
28
|
email:
|
43
29
|
- troy@troytc.com
|
44
|
-
executables:
|
30
|
+
executables:
|
31
|
+
- console
|
32
|
+
- setup
|
45
33
|
extensions: []
|
46
34
|
extra_rdoc_files: []
|
47
35
|
files:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
- LICENSE.txt
|
51
|
-
- README.md
|
52
|
-
- Rakefile
|
36
|
+
- bin/console
|
37
|
+
- bin/setup
|
53
38
|
- lib/omniauth-highlevel.rb
|
39
|
+
- lib/omniauth-highlevel/version.rb
|
54
40
|
- lib/omniauth/strategies/highlevel.rb
|
55
41
|
homepage: https://github.com/troytc/omniauth-highlevel
|
56
42
|
licenses:
|
@@ -64,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
50
|
requirements:
|
65
51
|
- - ">="
|
66
52
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
53
|
+
version: '0'
|
68
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
55
|
requirements:
|
70
56
|
- - ">="
|
data/.standard.yml
DELETED
data/CHANGELOG.md
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2024 Troy Clark
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Omniauth::Highlevel
|