diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/grpc_security.h | 8 | ||||
-rw-r--r-- | include/grpc/support/slice.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 737c811f1d..27f3373b8d 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -78,6 +78,14 @@ grpc_credentials *grpc_composite_credentials_create(grpc_credentials *creds1, /* Creates a compute engine credentials object. */ grpc_credentials *grpc_compute_engine_credentials_create(void); +extern const gpr_timespec grpc_max_service_accounts_token_validity; + +/* Creates a service account credentials object. May return NULL if the input is + invalid. time_validity should not exceed grpc_max_service_accounts_token + validity or will be cropped to this value. */ +grpc_credentials *grpc_service_accounts_credentials_create( + const char *json_key, const char *scope, gpr_timespec token_validity); + /* Creates a fake transport security credentials object for testing. */ grpc_credentials *grpc_fake_transport_security_credentials_create(void); diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index 6678f39256..a89073c56a 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -101,6 +101,7 @@ typedef struct gpr_slice { : ((slice).data.inlined.length = (newlen))) #define GPR_SLICE_END_PTR(slice) \ GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice) +#define GPR_SLICE_IS_EMPTY(slice) (GPR_SLICE_LENGTH(slice) == 0) /* Increment the refcount of s. Requires slice is initialized. Returns s. */ |