-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 20240917-01 dev Moesif integration * 20240917-01 Added API visibility integration with Moesif Postman collection updated
- Loading branch information
1 parent
ee9d2f6
commit e92c3ce
Showing
11 changed files
with
247 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 105 additions & 85 deletions
190
contrib/postman/NGINX Declarative API.postman_collection.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Moesif integration - https://www.moesif.com/docs/server-integration/nginx-openresty/ | ||
# URI: {{ loc.uri }} | ||
# application ID: {{ vis.moesif.application_id }} | ||
|
||
lua_shared_dict moesif_conf 5m; | ||
|
||
init_by_lua_block { | ||
local config = ngx.shared.moesif_conf; | ||
config:set("application_id", "{{ vis.moesif.application_id }}") | ||
} | ||
|
||
lua_package_cpath ";;${prefix}?.so;${prefix}src/?.so;/usr/share/lua/5.1/lua/resty/moesif/?.so;/usr/share/lua/5.1/?.so;/usr/lib64/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/openresty/luajit/share/lua/5.1/lua/resty?.so;/usr/local/share/lua/5.1/resty/moesif/?.so;{{ vis.moesif.plugin_path }}/?.so"; | ||
lua_package_path ";;${prefix}?.lua;${prefix}src/?.lua;/usr/share/lua/5.1/lua/resty/moesif/?.lua;/usr/share/lua/5.1/?.lua;/usr/lib64/lua/5.1/?.lua;/usr/lib/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/lua/resty?.lua;/usr/local/share/lua/5.1/resty/moesif/?.lua;{{ vis.moesif.plugin_path }}/?.lua"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Moesif integration - https://www.moesif.com/docs/server-integration/nginx-openresty/ | ||
# URI: {{ loc.uri }} | ||
# application ID: {{ vis.moesif.application_id }} | ||
|
||
# Define the variables Moesif requires | ||
set $moesif_user_id nil; | ||
set $moesif_company_id nil; | ||
set $moesif_req_body nil; | ||
set $moesif_res_body nil; | ||
|
||
# Optionally, set moesif_user_id and moesif_company_id such from a request header or NGINX var to identify customer | ||
header_filter_by_lua_block { | ||
ngx.var.moesif_user_id = ngx.req.get_headers()["X-User-Id"] | ||
ngx.var.moesif_company_id = ngx.req.get_headers()["X-Company-Id"] | ||
} | ||
|
||
# Add Moesif plugin | ||
access_by_lua_file {{ vis.moesif.plugin_path }}/read_req_body.lua; | ||
body_filter_by_lua_file {{ vis.moesif.plugin_path }}/read_res_body.lua; | ||
log_by_lua_file {{ vis.moesif.plugin_path }}/send_event.lua; | ||
|