docker/libswarm — pull request #82 by zinic (2014-06-14 04:17:53+00:00)
Title: Add Authentication Adapter

This PR adds the following two adapters:

### Auth

This service can be used to autheticate or verify the identity of messages passed through libswarm. The service has several providers. One provider must be selected using the
**--provider** swtich.

Authenticators in the auth service also expect the **--auth-env** switch to be set to a string representing a single JSON dictionary of strings that can be used as named arguemnts in the auth providers. This can be used to communicate things such as username, password or provider feature switches.

Common arguments that are recognized by all auth providers:
* auth-user **string**: represents the user being authenticated.
* auth-key **string**: represents a user key.
* auth-password **string**: represents a user password.

**Auth Example**
```
swarmd "dockerserver" "injector --auth-env @auth.json" "auth --provider fail"
[DEBUG] Ls --test test
```

### Utils/Injector

This service can be used to inject arugments into a libchan message mid-stream. Arguments passed to the injector will be injected as read. Any argument that begins with the '@' character is treated as a file path, resolved and then read into the message's arguments.

**Injecting Arguments**
```
swarmd "dockerserver" "injector --test test" "debug"
[DEBUG] Ls --test test
```

**Injecting Files as Arguments**
```
swarmd "dockerserver" "injector --test @test.json" "debug"
[DEBUG] Ls --test {"test": "test"}
```

Signed-off-by: John Hopper john.hopper@jpserver.net