authparty-connect 0.0.0 → 0.0.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/lib/authparty-connect.rb +4 -2
- data/lib/authparty-connect/connection.rb +21 -6
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe68cebdb4607096fd96558f129d09b114fdb04b
|
4
|
+
data.tar.gz: 485e44fa113414031ad9d82be1bc5a8af990b038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3d960fcd57a04039a2a11d06b53c6887e2198ada8423610565cf6b2dfe7b1d43c6abd4b46f7e7a885931c58fb65968c03df3b65cc762272b7c9852fc9fc37b5
|
7
|
+
data.tar.gz: a1cffd41b75ca0582bbec725f5cf74302a356acf16a2667fa776ee08c33f81d6e7e79df8955b1be620e0d98adcde9ace20812a4b4003951bed936adea6481569
|
data/lib/authparty-connect.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
class AuthpartyConnect
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
# Initiate the Connection Object
|
4
|
+
def self.initialize(api_key, api_secret, host)
|
5
|
+
@@connection = Connection.new(api_key, api_secret, host)
|
4
6
|
end
|
5
7
|
|
6
8
|
require 'authparty-connect/connection.rb'
|
@@ -1,14 +1,29 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'json'
|
3
|
+
|
1
4
|
class AuthpartyConnect::Connection
|
2
5
|
def initialize(api_key, api_secret, host)
|
3
|
-
@
|
6
|
+
@base_api_url = 'http://' + host.to_s + '/api/v1/'
|
7
|
+
@credentials = {:api_key => api_key.to_s, :api_secret => api_secret.to_s}
|
8
|
+
end
|
9
|
+
|
10
|
+
def list_providers
|
11
|
+
puts HTTParty.get(@base_api_url + 'providers')
|
12
|
+
end
|
13
|
+
|
14
|
+
# Get Login Path (For Official Authparty Login Pages)
|
15
|
+
def login_path
|
16
|
+
puts HTTParty.get(@base_api_url + 'providers/authorize_url?api_key=' + @credentials[:api_key])
|
4
17
|
end
|
5
18
|
|
6
|
-
|
7
|
-
|
8
|
-
|
19
|
+
# Acquire QR-code
|
20
|
+
def authorize_qrcode
|
21
|
+
@qrcode = HTTParty.get(@base_api_url + 'providers/authorize_qrcode?api_key=' + @credentials[:api_key] + '&callback_url=' + @base_api_url + 'providers/authorize_login')
|
22
|
+
return @qrcode
|
9
23
|
end
|
10
24
|
|
11
|
-
|
12
|
-
|
25
|
+
protected
|
26
|
+
def response_code(response)
|
27
|
+
return response.code
|
13
28
|
end
|
14
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authparty-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Reichardt
|
@@ -9,7 +9,35 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-11-14 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.14.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.14.0
|
13
41
|
description:
|
14
42
|
email: matthewjames3@protonmail.com
|
15
43
|
executables: []
|
@@ -38,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
66
|
version: '0'
|
39
67
|
requirements: []
|
40
68
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.6.
|
69
|
+
rubygems_version: 2.6.8
|
42
70
|
signing_key:
|
43
71
|
specification_version: 4
|
44
72
|
summary: Easily add blockchain-based authorization and identity management to your
|