3366dde7ab
* begin security bindings * secure channel creation * SSL credentials support * add client-side ssl support * ssl test * read file before passing to channel credentials, free credentials when done creating * use localhost key/cert for test * WIP sketch of callbacks for metadata plugins * conversion from Haskell auth processor to C * add test for custom server metadata auth processor * wip auth failure test * rebase tweak * working test of custom auth metadata server processor * improve security docs, clean up * add unsafe layer client-side auth metadata plugin functionality * add client config option for custom auth metadata * WIP client-side metadata auth plugin. Crashing when calling C callback. * get initial version of client-side metadata plugins working * replace String with ByteString in a few places, add function for getting AuthProperty * AuthContext utilities and more documentation * end-to-end test of client and server auth plugins * remove redundant tests * function for parents in unary calls, add deactivated failing test for auth metadata propagation from parent to child * some cleanup * tweaks * more tweaks * remove unused file * docs tweak * consolidate exports * update protobuf-wire commit |
||
---|---|---|
bench | ||
cbits | ||
examples | ||
include | ||
src/Network/GRPC | ||
tests | ||
.gitignore | ||
default-tests.nix | ||
default.nix | ||
grpc-haskell.cabal | ||
LICENSE | ||
README.md | ||
release.nix | ||
Setup.hs | ||
stack.yaml |
Running the tests
In order to run the tests, you will need to have the grpcio
, gevent
, and
grpcio-tools
python packages installed. You can install them using
pip
. It is recommended that you use a python virtualenv to do this.
$ virtualenv path/to/virtualenv # to create a virtualenv
$ . path/to/virtualenv/bin/activate # to use an existing virtualenv
$ pip install grpcio-tools gevent
$ pip install grpcio # Need to install grpcio-tools first to avoid a versioning problem
Building GRPC
In order to compile this project, and anything which depends on it, you will need a working installation of the GRPC C core libraries. This library currently uses the 0.15 version range. If you are on OS X, you can install it with homebrew:
brew tap grpc/grpc
brew install grpc
Alternatively, you can build gRPC from source by checking out an appropriate revision of the repository, and installing as follows:
git clone https://github.com/grpc/grpc.git
git checkout release-0_15_1
cd grpc
git submodule update --init
make
sudo make install
Alternatively, using Nix, pass the following expression to nix-build
and point Stack to the build products in the Nix store:
let pkgs = import <nixpkgs> {};
in pkgs.stdenv.mkDerivation rec
{ name = "grpc";
src = pkgs.fetchgit
{ url = "https://github.com/grpc/grpc.git";
rev = "674b30373e2d6a1e26425952805179f8d52a8c00";
sha256 = "05vj48w4h7bn6xyf1wyg2l6psl38h4yz6j1cl0yd2p5h7f5hb3s7";
};
preInstall = "export prefix";
buildInputs =
[ pkgs.darwin.cctools
pkgs.autoconf
pkgs.automake
pkgs.libtool
pkgs.which
pkgs.zlib
pkgs.openssl
];
}
Using the Library
You must compile with -threaded
, because we rely on being able to execute Haskell while blocking on foreign calls to the gRPC library. If not using code generation, the recommended place to start is in the Network.GRPC.HighLevel.Server.Unregistered
module, where serverLoop
provides a handler loop.