DEPRECATED - Limit restful requests to backend ElasticSearch cluster: Queries only.
Перейти к файлу
Bastien Abadie 987f924750
Merge pull request #14 from La0/async
Support Async connection
2018-05-29 14:47:32 +02:00
esFrontLine Add async connection 2018-05-29 10:53:12 +02:00
resources add url_prefix to prod. spelling 2018-05-24 15:39:46 -04:00
tests Fix client tests 2018-05-29 14:10:27 +02:00
vendor More test fixes 2018-05-24 11:19:45 -04:00
.gitignore some little details about logging errors 2018-05-23 22:56:38 -04:00
CLIENTS.md Add clients documentation 2018-05-29 10:53:44 +02:00
Dockerfile Move docker in tests directory 2018-05-24 18:51:48 +02:00
MANIFEST.in Bug 943465 - esFrontLine does not filter paths strict enough 2013-11-26 20:47:31 -05:00
README.md docs 2018-05-28 19:13:23 -04:00
requirements.txt Merge branch 'activedata' of https://github.com/klahnakoski/esFrontLine into activedata 2018-05-23 23:28:19 -04:00
setup.py Use find_packages in setup.py to embed client 2018-05-29 11:26:18 +02:00

README.md

esFrontLine

Limit restful requests to backend ElasticSearch cluster: Queries for the public,

Requirements

  • Python 2.7 or 3.6.2+
  • An ElasticSearch cluster to forward queries to

Install

I will assume you have Python installed (if not, here are Windows7 instructions)

pip install esFrontLine

Setup

You must write your own setting.json file with the following properties set:

  • elasticsearch - (Array of) ElasticSearch nodes
  • elasticsearch.host - URL of the ElasticSearch node that will accept query requests
  • elasticsearch.port - port for ES (default = 9200)
  • flask - flask.run() parameters (default port = 5000)
  • whitelist - list of indexes that are allowed
  • users - list of allowed HAWK users, with their linked resources
  • users.resources - list of indexes the user is allowed
  • users.hawk - object of Hawk credentials
  • users.hawk.id - any human readable name to identify the user or application
  • users.hawk.key - the secret value held by both endpoints and not shared with anyone
  • users.hawk.algorithm: always "sha256" for now
  • debug - for debugging

Here is an example of my settings.json file

{
    "elasticsearch":[{
        "host":"http://elasticsearch4.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch5.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch7.metrics.scl3.mozilla.com",
        "port":9200
    },{
        "host":"http://elasticsearch8.metrics.scl3.mozilla.com",
        "port":9200
    }],
    "flask":{
        "host":"0.0.0.0",
        "port":9292,
        "debug":false,
        "threaded":true,
        "processes":1
    },
    "users": [
      {
        "hawk": {
          "id": "kyle@example.com",
          "key": "secret",
          "algorithm": "sha256"
        },
        "resources": [
          "testing"
        ]
      }
    ],
    "whitelist":["bugs", "org_chart", "bug_summary", "reviews"],
    "debug":{
        "log":[{
            "filename": "./tests/results/logs/app.log",
            "maxBytes": 10000000,
            "backupCount": 200,
            "encoding": "utf8"
        },{
            "stream":"sys.stdout"
        }]
    }

}

Execution

python app.py --settings-file <path_to_file_with_JSON_settings>

Code Source

https://github.com/klahnakoski/esFrontLine