diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-02-22 05:41:15 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-02-22 05:41:15 +0100 |
commit | b87d17618335e703554417803059ac20739bff32 (patch) | |
tree | 0a808a257ef05993f3f742e9ded2a45b2911bf13 /include | |
parent | 3e001792faf64ccfe04e6a78b367e59e74e47c40 (diff) | |
parent | 6e8d15e7de3c7463210f3e62ba9429177722c4df (diff) |
Merge branch 'master' of github.com:google/grpc into installed_ssl_roots-patch
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/grpc_security.h | 8 | ||||
-rw-r--r-- | include/grpc/support/host_port.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index d23a5fd5c5..0eae444a9b 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -103,6 +103,14 @@ extern const gpr_timespec grpc_max_auth_token_lifetime; grpc_credentials *grpc_service_account_credentials_create( const char *json_key, const char *scope, gpr_timespec token_lifetime); +/* Creates a JWT credentials object. May return NULL if the input is invalid. + - json_key is the JSON key string containing the client's private key. + - token_lifetime is the lifetime of each Json Web Token (JWT) created with + this credentials. It should not exceed grpc_max_auth_token_lifetime or + will be cropped to this value. */ +grpc_credentials *grpc_jwt_credentials_create(const char *json_key, + gpr_timespec token_lifetime); + /* Creates a fake transport security credentials object for testing. */ grpc_credentials *grpc_fake_transport_security_credentials_create(void); diff --git a/include/grpc/support/host_port.h b/include/grpc/support/host_port.h index 362046cb95..2dac38a157 100644 --- a/include/grpc/support/host_port.h +++ b/include/grpc/support/host_port.h @@ -50,6 +50,11 @@ extern "C" { In the unlikely event of an error, returns -1 and sets *out to NULL. */ int gpr_join_host_port(char **out, const char *host, int port); +/* Given a name in the form "host:port" or "[ho:st]:port", split into hostname + and port number, into newly allocated strings, which must later be + destroyed using gpr_free(). */ +void gpr_split_host_port(const char *name, char **host, char **port); + #ifdef __cplusplus } #endif |