-
Notifications
You must be signed in to change notification settings - Fork 0
/
amelinium.http.middleware.remote-ip.html
9 lines (9 loc) · 24.6 KB
/
amelinium.http.middleware.remote-ip.html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.http.middleware.remote-ip documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Amelinium</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch current"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-get-ips-from-req-data"><div class="inner"><span>get-ips-from-req-data</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-get-ips-from-req-data-lru"><div class="inner"><span>get-ips-from-req-data-lru</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-get-proxy-header"><div class="inner"><span>get-proxy-header</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-ip-separator"><div class="inner"><span>ip-separator</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-new-reserved"><div class="inner"><span>new-reserved</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-process-proxy"><div class="inner"><span>process-proxy</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-process-proxy-for"><div class="inner"><span>process-proxy-for</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-proxy-header"><div class="inner"><span>proxy-header</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-remote-addr-get"><div class="inner"><span>remote-addr-get</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-remote-addr-parse"><div class="inner"><span>remote-addr-parse</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-safe-ip-to-address"><div class="inner"><span>safe-ip-to-address</span></div></a></li><li class="depth-1"><a href="amelinium.http.middleware.remote-ip.html#var-wrap-ip"><div class="inner"><span>wrap-ip</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.http.middleware.remote-ip</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>amelinium service, remote IP middleware.</p>
</div></div><div class="public anchor" id="var-get-ips-from-req-data"><h3>get-ips-from-req-data</h3><div class="usage"><code>(get-ips-from-req-data pheader addr-string)</code><code>(get-ips-from-req-data pheader addr-string proxy-setting)</code><code>(get-ips-from-req-data pheader addr-string proxy-setting proxy-for-fn)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L99">view source</a></div></div><div class="public anchor" id="var-get-ips-from-req-data-lru"><h3>get-ips-from-req-data-lru</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L112">view source</a></div></div><div class="public anchor" id="var-get-proxy-header"><h3>get-proxy-header</h3><div class="usage"><code>(get-proxy-header headers proxy-setting)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L95">view source</a></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler req)</code><code>(handler req proxy-setting)</code><code>(handler req proxy-setting proxy-for-fn)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L115">view source</a></div></div><div class="public anchor" id="var-ip-separator"><h3>ip-separator</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L28">view source</a></div></div><div class="public anchor" id="var-new-reserved"><h3>new-reserved</h3><div class="usage"><code>(new-reserved p)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L147">view source</a></div></div><div class="public anchor" id="var-process-proxy"><h3>process-proxy</h3><div class="usage"><code>(process-proxy p)</code></div><div class="doc"><div class="markdown"><p>Prepares proxy header configuration for address-getting middleware.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L48">view source</a></div></div><div class="public anchor" id="var-process-proxy-for"><h3>process-proxy-for</h3><div class="usage"><code>(process-proxy-for t)</code></div><div class="doc"><div class="markdown"><p>Prepares configuration of proxy-detection. If the config contains a sequence it will turn it into two Trie trees of IP ranges and return a function which returns truthy value if a client IP from the given request is within any range.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L57">view source</a></div></div><div class="public anchor" id="var-proxy-header"><h3>proxy-header</h3><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L27">view source</a></div></div><div class="public anchor" id="var-remote-addr-get"><h3>remote-addr-get</h3><div class="usage"><code>(remote-addr-get req)</code></div><div class="doc"><div class="markdown"><p>Parses :remote-addr key of a request to get the string representation of client’s IP address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L42">view source</a></div></div><div class="public anchor" id="var-remote-addr-parse"><h3>remote-addr-parse</h3><div class="usage"><code>(remote-addr-parse addr)</code></div><div class="doc"><div class="markdown"><p>Parses remote address string to get the string representation of client’s IP address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L34">view source</a></div></div><div class="public anchor" id="var-safe-ip-to-address"><h3>safe-ip-to-address</h3><div class="usage"><code>(safe-ip-to-address s)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L30">view source</a></div></div><div class="public anchor" id="var-wrap-ip"><h3>wrap-ip</h3><div class="usage"><code>(wrap-ip k ip-getter-sym proxy-setting proxy-for)</code></div><div class="doc"><div class="markdown"><p>Client IP getter middleware.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/http/middleware/remote_ip.clj#L133">view source</a></div></div></div></body></html>