aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/create_jwt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/security/create_jwt.cc')
-rw-r--r--test/core/security/create_jwt.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/core/security/create_jwt.cc b/test/core/security/create_jwt.cc
index 867a8ba575..56ae9c891c 100644
--- a/test/core/security/create_jwt.cc
+++ b/test/core/security/create_jwt.cc
@@ -39,6 +39,7 @@ void create_jwt(const char* json_key_file_path, const char* service_url,
grpc_slice_unref(json_key_data);
if (!grpc_auth_json_key_is_valid(&key)) {
fprintf(stderr, "Could not parse json key.\n");
+ fflush(stderr);
exit(1);
}
jwt = grpc_jwt_encode_and_sign(
@@ -47,6 +48,7 @@ void create_jwt(const char* json_key_file_path, const char* service_url,
grpc_auth_json_key_destruct(&key);
if (jwt == nullptr) {
fprintf(stderr, "Could not create JWT.\n");
+ fflush(stderr);
exit(1);
}
fprintf(stdout, "%s\n", jwt);
@@ -72,16 +74,19 @@ int main(int argc, char** argv) {
if (json_key_file_path == nullptr) {
fprintf(stderr, "Missing --json_key option.\n");
+ fflush(stderr);
exit(1);
}
if (scope != nullptr) {
if (service_url != nullptr) {
fprintf(stderr,
"Options --scope and --service_url are mutually exclusive.\n");
+ fflush(stderr);
exit(1);
}
} else if (service_url == nullptr) {
fprintf(stderr, "Need one of --service_url or --scope options.\n");
+ fflush(stderr);
exit(1);
}