andrewfun 0.0.7 → 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/andrewfun.rb +24 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4549d5a8b6ab111f0dc1ecfab151d30e29fd4686f7459a6df306262dabd80f1a
4
- data.tar.gz: 87b1a56428b168af562bbb4cc137fd4a08f6d0fd909bf228221b400a569358de
3
+ metadata.gz: 1a3f2e10ab44dc4288c96e6ede0f6425a8306f85b30e64043e95eb0784afbf5f
4
+ data.tar.gz: 1b3d33fb1b1c6f6eb886086fcfc40af7d3db10bcb167b78545870464370ae9a0
5
5
  SHA512:
6
- metadata.gz: d17bb1eaa95647d58f96b7d78f276da1e8b62334b7c8f14acdf116af9e7aa1bc32da956c4fb74fa4d63cc307eb0a869ee7969497ba973d23bc63551a0684fee2
7
- data.tar.gz: 2f3c538483a76a03d2d1f1e558e4b3614009dffa784c6643e50ac134acd137fe22e5ef100f02dae6b2623e10ce47dd84e4d55a41a297f50b21478f95112d7eaf
6
+ metadata.gz: 654a1977a9ef336fc32c2b0df735a33901a91dabdc797d99db0031bc2de54fa9fd5fbc786e6d3b33e06cf0d388686d293e65a6ac997c33788b6bd0e132bd493a
7
+ data.tar.gz: 2b9727d32dbdd2eaa9f2dce5751047a9bcf0d174cc2d983916d6cf376dc82227692f0125b5fb1f8a3d382c69e3490b983c2c6b2db798a5fd6f197e865a87303d
data/lib/andrewfun.rb CHANGED
@@ -20,11 +20,35 @@ class Andrewfun
20
20
  end
21
21
  possibletoken = request.headers["HTTP_TOKEN"].split("Bearer ")
22
22
  token = request.headers["HTTP_TOKEN"] || possibletoken
23
+ headers = {
24
+ "method" => request.method,
25
+ "ip" => ip,
26
+ "token" => token,
27
+ "api" => request.original_url
28
+ }
29
+
30
+ if devicetoken != nil
31
+ headers["device_token"] = devicetoken
32
+ end
33
+
34
+ if otp != nil
35
+ headers["otp"] = otp
36
+ end
37
+
38
+ if humantoken != nil
39
+ headers["humantoken"] = humantoken
40
+ end
41
+
42
+
23
43
  puts token
24
44
  puts devicetoken
25
45
  puts humantoken
26
46
  puts otp
27
47
  puts ip
48
+ puts headers
49
+ authorizedMessage = HTTParty.get(url, :headers => headers)
50
+ authorizationResult = JSON.parse(authorizedMessage.body)
51
+ return authorizationResult
28
52
  end
29
53
 
30
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andrewfun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrew van beek