zooppa_api_v3 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/zooppa_api_v3.rb +13 -2
- data/zooppa_api_v3.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93e1e0dbedd4bb87f26db3d1c4323a72ef40dc79
|
4
|
+
data.tar.gz: 3d618247d3484c4b045008a969671e8a46b9fde4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0a5e1ff81e3965670f49e6c8e0b76b7eef9d85cb14ebf61df7deb4c8dcd64f6127d7bddca7dccf9b2da64e57cc5e7af222fa78fcfad66392aea8c7c160faa65
|
7
|
+
data.tar.gz: 8dea41292eda03544f1c3fa01ccf4d9c381356c9a19cf1d2c1cb7141c1bf84dca9574136f48c0eeb2065d5b4ae07f0693b0e1a84b3dd5084cd0ec50f5ba60ce8
|
data/README.md
CHANGED
@@ -48,7 +48,15 @@ Possible configuration options:
|
|
48
48
|
|
49
49
|
###Authentication:
|
50
50
|
|
51
|
-
|
51
|
+
Both authentication return an access token.
|
52
|
+
|
53
|
+
Authenticate a user:
|
54
|
+
|
55
|
+
`ZOOPPA_API.authenticate_user('email@email.com', 'pass')`
|
56
|
+
|
57
|
+
Authenticate a client app:
|
58
|
+
|
59
|
+
`ZOOPPA_API.authenticate_application`
|
52
60
|
|
53
61
|
If authentication was successful, it returns the access token (encrypted if encrypt is set to true) or returns JSON with an error key and message.
|
54
62
|
|
data/lib/zooppa_api_v3.rb
CHANGED
@@ -5,7 +5,6 @@ require 'active_support/core_ext'
|
|
5
5
|
require 'oauth2'
|
6
6
|
require 'encryptor'
|
7
7
|
|
8
|
-
|
9
8
|
class ZooppaApiV3
|
10
9
|
|
11
10
|
# Initializes the Rest Request
|
@@ -178,7 +177,19 @@ class ZooppaApiV3
|
|
178
177
|
end
|
179
178
|
end
|
180
179
|
|
181
|
-
def
|
180
|
+
def authenticate_application
|
181
|
+
client = OAuth2::Client.new(
|
182
|
+
@app_id,
|
183
|
+
@app_secret,
|
184
|
+
site: @api_host
|
185
|
+
)
|
186
|
+
token = client.client_credentials.get_token.token
|
187
|
+
@encrypt ? encrypt_token(token) : token
|
188
|
+
rescue => e
|
189
|
+
parse_error_message(e)
|
190
|
+
end
|
191
|
+
|
192
|
+
def authenticate_user(email, password)
|
182
193
|
client = OAuth2::Client.new(
|
183
194
|
@app_id,
|
184
195
|
@app_secret,
|
data/zooppa_api_v3.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "zooppa_api_v3"
|
8
|
-
spec.version = '0.0.
|
8
|
+
spec.version = '0.0.5'
|
9
9
|
spec.authors = ["Ulrich Soeffing"]
|
10
10
|
spec.email = ["ulrich_soeffing@gmx.de"]
|
11
11
|
spec.description = "Wrapper for the Zooppa api v3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zooppa_api_v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ulrich Soeffing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|