push
command to upload your bundle.zip
file to your bucket.
mservctl settings - Mac
To run mservctl
from your local machine, from the binary directory, run:
mservctl
from your local machine, from the binary directory, run:
chmod +x <filename>
). On MacOS you may also need to change your security settings to allow the binary to run.python-demo.mservctl.yaml
)endpoint
flag. Remember to prepend it with https://
.token
flagpython-demo.mservctl.yaml
config file should now look like this:
push
command:list
command. Run:manifest.json
are returned:auth
value token from your middleware.py
code9c9ecec1-8f98-4c3f-88cd-ca3c27599e6b
uptight-paddle-gw.usw2.ara.app/test/
. You should now see a 403 “error: “forbidden”. This is because your API has Authentication enabled and you haven’t provided the credentials yet.uptight-paddle-gw.usw2.ara.app/test/
)auth
value from your Python code. In our example 47a0c79c427728b3df4af62b9228c8ae
and click Send again.get
to your API request in Postman. So in our example uptight-paddle-gw.usw2.ara.app/test/get
. Click Send. This will return all the get requests, including headers. You should see the x-tyk-request: "something"
which is the post middleware hook you set up in the Python code.manifest.json
) and the python file (middleware.py
)manifest.json
and needs to have the following contents:
File | Description |
---|---|
custom_middleware | contains the middleware settings like the plugin driver you want to use (driver) and the hooks that your plugin will expose. We use the auth_check for this tutorial. For other hooks see here. |
file_list | contains the list of files to be included in the bundle. The CLI tool expects to find these files in the current working directory. |
name | references the name of the function that you implement in your plugin code: MyAuthMiddleware |
middleware.py | an additional file that contains the main implementation of our middleware. |
Authorization
.
File | Description | |
---|---|---|
MyAuthMiddleware @hook | checks for a value. If it is found it is treated as your authentication token. | |
MyPostMiddleware @hook | adds a header to the request. In this tutorial something |
bundle.zip
file in the plugin working directory.apt-get install -y build-essential