aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/grpc/grpc_security.h8
-rw-r--r--include/grpc/support/host_port.h5
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