This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Milkman Plugins

This is a placeholder page that shows you how to use this template site.

This section is where the user documentation for your project lives - all the information your users need to understand and successfully use your project.

1 - Milkman Auth Plugin

Contains key-types for authentication, such as oauth-authentication

Contains key-types for authentication, such as oauth-authentication

Features

  • supports oauth2
    • password-grant, client-credential grant and authorization-code grant

Screenshot

Editing a secret oAuth Key (Password Grant).

Remarks

  • does not yet support specifying a redirect-url for authorization-code as there is currently no browser included.

2 - Milkman Cassandra Plugin

Introduces Cql Requests to Milkman using cassandra datastax driver.

Introduces Cql Requests to Milkman using cassandra datastax driver.

Requirements

This plugin requires milkman-jdbc plugin

Installation

After placing the jar into \plugin folder, you also have to place the driver-jars you want to use in that folder as well.

Usage

The used url is of following format:

cql://host[/keyspace]?dc=...[&username=...&password=...]

supported parameters

name description
dc datacenter, required. for local installations, this should be ‘datacenter1’
username username, optional
password password, optional

Screenshot

Editing a secret oAuth Key (Password Grant).

Features

  • Execution of Requests against cassandra databases

3 - Milkman Commandline Interface

This is an experimental interactive command line interface for plugin.

This is an experimental interactive command line interface for plugin. After copying the content of the archive to the root directory of milkman, you can start it by mm on terminal.

Screenshot

Example of a cli session

Features

  • Editing Request-Aspects via nano
  • Executing requests
  • Analyzing responses via less
  • Interactive mode (entered by simply starting mm) or non-interactive mode (by executing commands via mm [command])
  • Tab-Completion on interactive mode

Commands

  • Note: all IDs are derived from the original names. All lowercase and special characters are replaced with -. E.g. Your Workspace becomes your-workspace*
Command Alias Description Arguments
change-workspace ws Switches currently activated workspace workspace the id of the workspace to switch to
change-collection col Switches currently activated collection collection the id of the collection to switch to
execute-request req Executes a given request requestish1 the id of the request to execute
-l, --less outputs response into less
-v, --verbose outputs all aspects
edit-request e Edits an aspect of a request requestish1 the id of the request to execute
aspect the aspect to edit
quit q Quits Application

1A requestish is [[Workspace-Id/]Collection-Id/]Request-Id (i.e. the first two are optional)

Screenshot

4 - Milkman Explore Plugin

JMesPath exploring for your json response.

Extends Milkman-rest with an additional response-tab that allows for application/json responses to be explored using JMesPath.

Note

  • requires milkman-rest plugin

Screenshot

Example of the explore plugin

5 - Milkman GraphQL Plugin

Allows to craft GraphQL requests.

Allows to craft GraphQL requests.

Note

  • This plugin is rather simple and does not include advanced features such as auto-completion or schema-validation (yet).
  • Requires milkman-rest plugin

Screenshot

Example of the GraphQl plugin

6 - Milkman Grpc Plugin

Grpc Plugin for communication with Grpc Servers.

Grpc Plugin for communication with Grpc Servers.

Features

  • Can work with Server Reflection to query services and retrieve *.proto files
  • Given a *.proto file, Server Reflection is not necessary to query a service
  • Read/write ASCII headers
  • Support Server/client/both streams

Screenshot

Example of the Grpc plugin

Example of Server streaming

Example of Grpc Streaming

Client Streaming

To send multiple messages, just add multiple json objects to the payload, divided by two new lines.

7 - Milkman Http Plugin

Allows to share requests etc via Privatebin.

Introduces Http request capabilities to milkman. Consists of serveral features that together should make milkman be usable as postman-replacement for day-to-day work.

Screenshot

Example of the Rest plugin

Example of Server Sent Events Streaming

Example of Server-sent event streaming in the Rest plugin

Features

  • Postman-like UI
  • Crafting of requests by editing body, headers, parameters
  • Highlighting/formatting for json
  • Proxy-Authentication support (BASIC for now)
  • Importers for Postman exports (Collections, Environments, Data-Dump)
  • Importers for OpenApi v3.0
  • (planned) Exporters
  • Support import of APIs listed at APIs.guru, see demo

8 - Milkman Note Plugin

Introduces Sql Requests to Milkman using JDBC.

This is a very simple plugin that adds a tab to each request where users can enter some notes about the request.

This plugin serves demonstrational purposes and should show how milkman can be extended.

Screenshot

Example of the Notes plugin

9 - Milkman Privatebin Plugin

Allows to share requests etc via Privatebin.

Allows to share requests etc via Privatebin.

Screenshot

Example of the Privatebin plugin

Features

  • Customizable Privatebin installation
  • Client-side AES encryption
  • Share requests via simple URL
  • Burn After Reading feature

10 - Milkman Scripting Plugin

Ads Pre- and Post-scripts to requests

provides scripting capabilities via nashorn javascript engine (graal.js supported but disabled because it is too big in size).

Features

  • Provides possibility to pre-load scripts from web, such as chai, via settings.
  • Pre-Request script execution before actual request is made
  • Post-Request script execution with logging output
  • Extensions of template parameters with js: prefix
    • For example, you can set BASIC authorization via header:
      Authorization: Basic {{js:base64("username:password")}}

Example for scripts

var url = JSON.parse(milkman.response.body.body).url
milkman.setEnvironmentVariable("test.url", url)

example of pre-script:

var headerVal = milkman.request.headers.entries[0].value
milkman.toast(headerVal)

example of chai script (if you include chai in preload scripts):

chai.should();
var body = JSON.parse(mm.response.body.body)
body.should.have.lengthOf(200);

Screenshot

Example of the Scripting plugin

Preferences:

Example of the Scripting plugin

API

milkman (aliased to mm) is the only object available. It provides following properties:

  • request: an accessor for request-aspects. Every property of this request-object tries to fetch an according aspect. E.g. request.body would be the body-aspect of the request-container. (Thats why you have to write request.body.body, because the body-aspect stores its content in the body variable as well. Might be streamlined in the future)
  • response: an accessor for response-aspects. Every property of this response-object tries to fetch an according aspect. E.g. response.body would be the body-aspect of the response-container. (Thats why you have to write response.body.body, because the body-aspect stores its content in the body variable as well. Might be streamlined in the future)
  • setEnvironmentVariable(String, String) sets an environment variable in the currently active environment (if there is any activated).
  • toast(String) shows a toast at the bottom of the window

console works as usual as well

besides that, some often used functions are available:

  • base64(string), sha1(string), sha256(string), sha512(string)

11 - Milkman Socket.IO Plugin

Support for Socket.IO transport

Support for Socket.IO transport

Features

  • supports Socket.IO

Screenshot

Example of the Socket.IO plugin

Note

  • requires milkman-rest plugin

12 - Milkman Jdbc Plugin

Introduces Sql Requests to Milkman using JDBC.

Introduces Sql Requests to Milkman using JDBC.

Installation

After placing the jar into \plugin folder, you also have to place the driver-jars you want to use in that folder as well.

Screenshot

Example of the Sql plugin

Features

  • Execution of Requests against Jdbc compatible Databases.
  • (planned) exploration of table structures / existing tables.

13 - Milkman Git Sync Plugin

Team Synchronization via Git

Support for Socket.IO transport

This plugin allows to setup a git repository to where a workspace can be synchronized. Synchronization works by computing the diffs and applying them in a fuzzy manner to the latest version (simple algorithm of Differential Synchronization).

Screenshot

Example of the Scripting plugin

Features

  • synchronizes (on-demand for now) workspaces with a remote git repository

Remark

  • This feature is experimental.

14 - Milkman Test Plugin

Testing of Requests

a testrunner plugin that allows to execute multiple requests in a sequence and verify their results.

Usage

Just Drag-and-drop requests you want to execute into the test-tab and you are ready to go.

Demo

Example of the Testrunner plugin

Environment

On execution, a separate environment only for this test-run will be created, so everything written to the current environment. For differentiation in scripts, a __TEST__ = true variable is also added to the current environment.

Example test that is only executed on test-runs:

if (mm.getEnvironmentVariable("__TEST__")){
  chai.should();
  var json = JSON.parse(mm.response.body.body)
  json.should.have.property('name').that.is.equal("Leanne Graham")
}

Remark

This plugin is still in early development, so it might not seem to contain a lot of features. They will be added on-the-go when the need / issue arises.

15 - Milkman Websocket Plugin

Support for websocket transport

Support for websocket transport

Features

  • supports ws and wss
  • can interactively send messages

Screenshot

Example of the Websocket Streaming

Note

  • requires milkman-rest plugin