Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README, bump versions #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,5 @@ fabric.properties
# modules.xml
# .idea/misc.xml
# *.ipr
**/Pipfile
**/Pipfile.lock
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ app.wsgi_app = MoesifMiddleware(app.wsgi_app, moesif_settings)
```

Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.
After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.

You can always find your Moesif Application Id at any time by logging
You can always find your Moesif Application Id at any time by logging
into the [_Moesif Portal_](https://www.moesif.com/), click on the top right menu,
and then clicking _API Keys_.

Expand Down Expand Up @@ -110,7 +110,7 @@ Please read the documentation for your specific framework on how to add middlewa
The app is the original WSGI app instance, and the environ is a [WSGI environ](http://wsgi.readthedocs.io/en/latest/definitions.html).
Also, Moesif adds the following to the environ variable
```
environ['moesif.request_body'] - A json object or base64 encoded string if couldn't parse the request body as json
environ['moesif.request_body'] - A json object or base64 encoded string if couldn't parse the request body as json
environ["moesif.response_body_chunks"] - A response body chunks
environ["moesif.response_headers"] - A dict representing the response headers
```
Expand Down Expand Up @@ -156,7 +156,7 @@ to associate this event with custom metadata. For example, you may want to save
(optional) __int__, default 100, Maximum batch size when sending events to Moesif when reading from the queue

#### __`EVENT_BATCH_TIMEOUT`__
(optional) __int__, default 2, Maximum time in seconds to wait before sending a batch of events to Moesif when reading from the queue
(optional) __int__, default 1, Maximum time in seconds to wait before sending a batch of events to Moesif when reading from the queue

#### __`AUTHORIZATION_HEADER_NAME`__
(optional) _string_, A request header field name used to identify the User in Moesif. Default value is `authorization`. Also, supports a comma separated string. We will check headers in order like `"X-Api-Key,Authorization"`.
Expand All @@ -167,7 +167,7 @@ to associate this event with custom metadata. For example, you may want to save
#### __`BASE_URI`__
(optional) _string_, A local proxy hostname when sending traffic via secure proxy. Please set this field when using secure proxy. For more details, refer [secure proxy documentation.](https://www.moesif.com/docs/platform/secure-proxy/#2-configure-moesif-sdk)

### Options specific to outgoing API calls
### Options specific to outgoing API calls

The options below are applicable to outgoing API calls (calls you initiate using the Python [Requests](http://docs.python-requests.org/en/master/) lib to third parties like Stripe or to your own services.

Expand All @@ -176,11 +176,11 @@ For options that use the request and response as input arguments, these use the
If you are not using WSGI, you can import the [moesifpythonrequest](https://github.com/Moesif/moesifpythonrequest) directly.

#### __`CAPTURE_OUTGOING_REQUESTS`__
_boolean_, Default False. Set to True to capture all outgoing API calls. False will disable this functionality.
_boolean_, Default False. Set to True to capture all outgoing API calls. False will disable this functionality.

##### __`GET_METADATA_OUTGOING`__
(optional) _(req, res) => dictionary_, a function that enables you to return custom metadata associated with the logged API calls.
Takes in the [Requests](http://docs.python-requests.org/en/master/api/) request and response object as arguments. You should implement a function that
(optional) _(req, res) => dictionary_, a function that enables you to return custom metadata associated with the logged API calls.
Takes in the [Requests](http://docs.python-requests.org/en/master/api/) request and response object as arguments. You should implement a function that
returns a dictionary containing your custom metadata. (must be able to be encoded into JSON). For example, you may want to save a VM instance_id, a trace_id, or a resource_id with the request.

##### __`SKIP_OUTGOING`__
Expand Down Expand Up @@ -269,7 +269,7 @@ user = {
'company_id': '67890', # If set, associate user with a company object
'campaign': {
'utm_source': 'google',
'utm_medium': 'cpc',
'utm_medium': 'cpc',
'utm_campaign': 'adwords',
'utm_term': 'api+tooling',
'utm_content': 'landing'
Expand All @@ -291,7 +291,7 @@ update_user = api_client.update_user(user)
```

### Update Users in Batch
Similar to update_user, but used to update a list of users in one batch.
Similar to update_user, but used to update a list of users in one batch.
Only the `user_id` field is required.
For details, visit the [Python API Reference](https://www.moesif.com/docs/api?python#update-users-in-batch).

Expand Down Expand Up @@ -349,10 +349,10 @@ api_client = MoesifAPIClient("Your Moesif Application Id").api
# metadata can be any custom object
company = {
'company_id': '67890',
'company_domain': 'acmeinc.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'company_domain': 'acmeinc.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'campaign': {
'utm_source': 'google',
'utm_medium': 'cpc',
'utm_medium': 'cpc',
'utm_campaign': 'adwords',
'utm_term': 'api+tooling',
'utm_content': 'landing'
Expand All @@ -373,7 +373,7 @@ update_company = api_client.update_company(company)
```

### Update Companies in Batch
Similar to update_company, but used to update a list of companies in one batch.
Similar to update_company, but used to update a list of companies in one batch.
Only the `company_id` field is required.
For details, visit the [Python API Reference](https://www.moesif.com/docs/api?python#update-companies-in-batch).

Expand All @@ -382,7 +382,7 @@ api_client = MoesifAPIClient("Your Moesif Application Id").api

companyA = {
'company_id': '67890',
'company_domain': 'acmeinc.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'company_domain': 'acmeinc.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'metadata': {
'org_name': 'Acme, Inc',
'plan_name': 'Free',
Expand All @@ -397,7 +397,7 @@ companyA = {

companyB = {
'company_id': '09876',
'company_domain': 'contoso.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'company_domain': 'contoso.com', # If domain is set, Moesif will enrich your profiles with publicly available info
'metadata': {
'org_name': 'Contoso, Inc',
'plan_name': 'Free',
Expand All @@ -414,7 +414,7 @@ update_companies = api_client.update_companies_batch([companyA, companyB])
```
## Troubleshooting

When using Docker with Ubuntu based image, if events are not being captured, it could be possible as the image can't find any timezone configuration.
When using Docker with Ubuntu based image, if events are not being captured, it could be possible as the image can't find any timezone configuration.
In order to resolve that, add the following line to your Dockerfile
```
ENV TZ=UTC
Expand Down
2 changes: 1 addition & 1 deletion examples/bottle/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
moesifwsgi==1.9.4
moesifwsgi>=1.9.6
bottle
4 changes: 2 additions & 2 deletions examples/falcon/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
moesifwsgi==1.9.4
moesifwsgi>=1.9.6
falcon==3.1.0
gunicorn
falcon-multipart
falcon-multipart
2 changes: 1 addition & 1 deletion examples/flask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
moesifwsgi>=1.9.4
moesifwsgi>=1.9.6
Flask
2 changes: 1 addition & 1 deletion moesifwsgi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def initialize_config(self):
response_catcher = HttpResponseCatcher(self.DEBUG)
self.api_client.http_call_back = response_catcher
Configuration.BASE_URI = self.settings.get("BASE_URI") or self.settings.get("LOCAL_MOESIF_BASEURL", "https://api.moesif.net")
Configuration.version = "moesifwsgi-python/1.9.5"
Configuration.version = "moesifwsgi-python/1.9.6"
if self.settings.get("CAPTURE_OUTGOING_REQUESTS", False):
StartCapture().start_capture_outgoing(self.settings)

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requests==2.30.0
requests==2.32.0
nose==1.3.7
isodatetimehandler==1.0.2
moesifapi>=1.4.9
moesifpythonrequest==0.3.3
moesifapi>=1.5.2
moesifpythonrequest>=0.3.4
readerwriterlock==1.0.9
apscheduler==3.10.4
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.9.5',
version='1.9.6',

description='Moesif Middleware for Python WSGI based platforms (Flask, Bottle & Others)',
long_description=long_description,
Expand Down Expand Up @@ -90,7 +90,7 @@
install_requires=[
'requests>=2.30.0',
'isodatetimehandler>=1.0.2',
'moesifapi>=1.4.9',
'moesifapi>=1.5.0',
Copy link
Contributor

@praves77 praves77 Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.5.2

'moesifpythonrequest>=0.3.1',
'readerwriterlock>=1.0.9',
'apscheduler>=3.10.4'
Expand Down