moesif_rack 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -12
  3. data/test/moesif_rack_test.rb +11 -8
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a597bcfb7083d6a0ac126dab64dee86b5dcb31ffcf0e018809768d4bd7e06ea3
4
- data.tar.gz: cec0a5a1cb82abcb45314173b021534d02ab0a82d4111238a63e171343c7e4d4
3
+ metadata.gz: 78140d9557e785d6def875ef2ff36d1966fc322f0b50f54840e9489bafa1f03d
4
+ data.tar.gz: f3b9000be0288be9f9bc786a1072cdaf09a15bbbc7e99720f39479098a468ff3
5
5
  SHA512:
6
- metadata.gz: 68de312a781cc558dd91a64db9be8510522b0d0241bd723989d2067c63882b0a5d1faecbb256dd843e122f475937cbf64b697ff85b496448aca460f1a6156fd3
7
- data.tar.gz: 84aa2e7c2d95ba1474e6aeb71d72434d9401b52f372e59914eaaccfba96fde4268498f1cceb7393ab5a05b26d43944d1a75c8fa4e2138b1d6e40cd2e260b26f3
6
+ metadata.gz: 87afa9da20ecade3ea36a3dd9791f2d7d68245db9838f287eacd5905c2230ed0736237bd320a934186c84760fa658575d05eac9538d5b37903e99207e59defcc
7
+ data.tar.gz: 17752a036f01c4b26949a71a6856d29d5e89beb3e818859c22df8a20a01eeaae291d19a7b52805cd93d55a4bf246ce832c98cdaef4e4e317a97ae1b7abf858d5
data/README.md CHANGED
@@ -6,7 +6,9 @@
6
6
  [![Software License][ico-license]][link-license]
7
7
  [![Source Code][ico-source]][link-source]
8
8
 
9
- Rack Middleware that logs _incoming_ API calls to Moesif's AI-powered API analytics service.
9
+ Rack Middleware that logs API calls and sends
10
+ to [Moesif](https://www.moesif.com) for API analytics and log analysis.
11
+
10
12
  Supports Ruby on Rails apps and other Ruby frameworks built on Rack.
11
13
 
12
14
  [Source Code on GitHub](https://github.com/moesif/moesif-rack)
@@ -20,7 +22,7 @@ gem install moesif_rack
20
22
  and if you have a `Gemfile` in your project, please add this line to
21
23
 
22
24
  ```
23
- gem 'moesif_rack', '~> 1.3.2'
25
+ gem 'moesif_rack', '~> 1.3.4'
24
26
 
25
27
  ```
26
28
 
@@ -30,11 +32,17 @@ gem 'moesif_rack', '~> 1.3.2'
30
32
 
31
33
  ```ruby
32
34
  moesif_options = {
33
- 'application_id' => 'Your application Id'
35
+ 'application_id' => 'Your Moesif Application Id',
36
+ 'log_body' => true,
34
37
  }
35
38
  ```
36
39
 
37
- You can find your Application Id from [_Moesif Dashboard_](https://www.moesif.com/) -> _Top Right Menu_ -> _App Setup_
40
+ Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
41
+ After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.
42
+
43
+ You can always find your Moesif Application Id at any time by logging
44
+ into the [_Moesif Portal_](https://www.moesif.com/), click on the top right menu,
45
+ and then clicking _Installation_.
38
46
 
39
47
  ### Add to middleware
40
48
 
@@ -106,7 +114,7 @@ moesif_options['identify_user'] = Proc.new { |env, headers, body|
106
114
 
107
115
  #snip
108
116
 
109
- 'the_user_id'
117
+ 'my_user_id'
110
118
  }
111
119
 
112
120
  ```
@@ -122,7 +130,7 @@ moesif_options['identify_company'] = Proc.new { |env, headers, body|
122
130
 
123
131
  #snip
124
132
 
125
- 'the_company_id'
133
+ 'my_company_id'
126
134
  }
127
135
 
128
136
  ```
@@ -327,7 +335,8 @@ metadata = JSON.parse('{'\
327
335
  '"custom": "testdata"'\
328
336
  '}')
329
337
 
330
- user_model = { "user_id" => "testrubyapiuser",
338
+ user_model = { "user_id" => "12345",
339
+ "company_id" => "67890",
331
340
  "modified_time" => Time.now.utc.iso8601,
332
341
  "metadata" => metadata }
333
342
 
@@ -347,11 +356,13 @@ metadata = JSON.parse('{'\
347
356
 
348
357
  user_models = []
349
358
 
350
- user_model_A = { "user_id" => "testrubyapiuser",
359
+ user_model_A = { "user_id" => "12345",
360
+ "company_id" => "67890",
351
361
  "modified_time" => Time.now.utc.iso8601,
352
362
  "metadata" => metadata }
353
363
 
354
- user_model_B = { "user_id" => "testrubyapiuser1",
364
+ user_model_B = { "user_id" => "1234",
365
+ "company_id" => "6789",
355
366
  "modified_time" => Time.now.utc.iso8601,
356
367
  "metadata" => metadata }
357
368
 
@@ -372,7 +383,7 @@ metadata = JSON.parse('{'\
372
383
  '"custom": "testdata"'\
373
384
  '}')
374
385
 
375
- company_model = { "company_id" => "testrubyapicompany",
386
+ company_model = { "company_id" => "12345",
376
387
  "company_domain" => "acmeinc.com",
377
388
  "metadata" => metadata }
378
389
 
@@ -392,11 +403,11 @@ metadata = JSON.parse('{'\
392
403
 
393
404
  company_models = []
394
405
 
395
- company_model_A = { "company_id" => "testrubyapicompany",
406
+ company_model_A = { "company_id" => "12345",
396
407
  "company_domain" => "nowhere.com",
397
408
  "metadata" => metadata }
398
409
 
399
- company_model_B = { "company_id" => "testrubyapicompany1",
410
+ company_model_B = { "company_id" => "67890",
400
411
  "company_domain" => "acmeinc.com",
401
412
  "metadata" => metadata }
402
413
 
@@ -6,7 +6,7 @@ require_relative '../lib/moesif_rack'
6
6
  class MoesifRackTest < Test::Unit::TestCase
7
7
  def setup
8
8
  @app = ->(env) { [200, { "Content-Type" => "application/json" }, ["{ \"key\": \"value\"}"]]}
9
- @options = { 'application_id' => 'Your Application Id',
9
+ @options = { 'application_id' => 'Your Moesif Application Id',
10
10
  'debug' => true,
11
11
  'disable_transaction_id' => true,
12
12
  'capture_outoing_requests' => true,
@@ -26,7 +26,7 @@ class MoesifRackTest < Test::Unit::TestCase
26
26
  'my_user_id'
27
27
  },
28
28
  'identify_company' => Proc.new{|request, response|
29
- '12345'
29
+ 'my_company_id'
30
30
  },
31
31
  'identify_user_outgoing' => Proc.new{|request, response|
32
32
  'outgoing_user_id'
@@ -67,7 +67,8 @@ class MoesifRackTest < Test::Unit::TestCase
67
67
  '"custom": "testdata"'\
68
68
  '}')
69
69
 
70
- user_model = { "user_id" => "testrubyapiuser",
70
+ user_model = { "user_id" => "12345",
71
+ "company_id" => "67890",
71
72
  "modified_time" => Time.now.utc.iso8601,
72
73
  "metadata" => metadata }
73
74
 
@@ -84,11 +85,13 @@ class MoesifRackTest < Test::Unit::TestCase
84
85
 
85
86
  user_models = []
86
87
 
87
- user_model_A = { "user_id" => "testrubyapiuser",
88
+ user_model_A = { "user_id" => "12345",
89
+ "company_id" => "67890",
88
90
  "modified_time" => Time.now.utc.iso8601,
89
91
  "metadata" => metadata }
90
92
 
91
- user_model_B = { "user_id" => "testrubyapiuser1",
93
+ user_model_B = { "user_id" => "1234",
94
+ "company_id" => "6789",
92
95
  "modified_time" => Time.now.utc.iso8601,
93
96
  "metadata" => metadata }
94
97
 
@@ -113,7 +116,7 @@ class MoesifRackTest < Test::Unit::TestCase
113
116
  '"custom": "testdata"'\
114
117
  '}')
115
118
 
116
- company_model = { "company_id" => "testrubyapicompany",
119
+ company_model = { "company_id" => "12345",
117
120
  "company_domain" => "acmeinc.com",
118
121
  "metadata" => metadata }
119
122
 
@@ -130,11 +133,11 @@ class MoesifRackTest < Test::Unit::TestCase
130
133
 
131
134
  company_models = []
132
135
 
133
- company_model_A = { "company_id" => "testrubyapicompany",
136
+ company_model_A = { "company_id" => "12345",
134
137
  "company_domain" => "nowhere.com",
135
138
  "metadata" => metadata }
136
139
 
137
- company_model_B = { "company_id" => "testrubyapicompany1",
140
+ company_model_B = { "company_id" => "1234",
138
141
  "company_domain" => "acmeinc.com",
139
142
  "metadata" => metadata }
140
143
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moesif_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moesif, Inc
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-06-26 00:00:00.000000000 Z
12
+ date: 2019-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.2.7
34
+ version: 1.2.8
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.2.7
41
+ version: 1.2.8
42
42
  description: Collection/Data Ingestion SDK for Rack (also Rails) Middleware / RoR
43
43
  email: xing@moesif.com
44
44
  executables: []