Go to the documentation of this file.
36 "load_file",
grpc_load_file(json_key_file_path, 1, &json_key_data)));
41 fprintf(
stderr,
"Could not parse json key.\n");
50 fprintf(
stderr,
"Could not create JWT.\n");
54 fprintf(
stdout,
"%s\n", jwt);
58 int main(
int argc,
char** argv) {
59 const char* scope =
nullptr;
60 const char* json_key_file_path =
nullptr;
67 "OPTIONAL Space delimited permissions. Mutually "
68 "exclusive with service_url",
71 "OPTIONAL service URL. Mutually exclusive with scope.",
75 if (json_key_file_path ==
nullptr) {
76 fprintf(
stderr,
"Missing --json_key option.\n");
80 if (scope !=
nullptr) {
83 "Options --scope and --service_url are mutually exclusive.\n");
88 fprintf(
stderr,
"Need one of --service_url or --scope options.\n");
GPRAPI void grpc_slice_unref(grpc_slice s)
int main(int argc, char **argv)
grpc_error_handle grpc_load_file(const char *filename, int add_null_terminator, grpc_slice *output)
char * grpc_jwt_encode_and_sign(const grpc_auth_json_key *json_key, const char *audience, gpr_timespec token_lifetime, const char *scope)
GPRAPI void gpr_free(void *ptr)
void gpr_cmdline_destroy(gpr_cmdline *cl)
#define GRPC_LOG_IF_ERROR(what, error)
void grpc_auth_json_key_destruct(grpc_auth_json_key *json_key)
grpc_auth_json_key grpc_auth_json_key_create_from_string(const char *json_string)
int grpc_auth_json_key_is_valid(const grpc_auth_json_key *json_key)
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void)
void create_jwt(const char *json_key_file_path, const char *service_url, const char *scope)
void gpr_cmdline_add_string(gpr_cmdline *cl, const char *name, const char *help, const char **value)
#define GRPC_SLICE_START_PTR(slice)
gpr_cmdline * gpr_cmdline_create(const char *description)
#define GRPC_JWT_OAUTH2_AUDIENCE
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
int gpr_cmdline_parse(gpr_cmdline *cl, int argc, char **argv)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:59