aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/create_jwt.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/security/create_jwt.c')
-rw-r--r--test/core/security/create_jwt.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c
index 6d4707f3c7..1bd135f175 100644
--- a/test/core/security/create_jwt.c
+++ b/test/core/security/create_jwt.c
@@ -34,9 +34,8 @@
#include <stdio.h>
#include <string.h>
-#include "src/core/lib/security/credentials.h"
-#include "src/core/lib/security/json_token.h"
-#include "src/core/lib/support/load_file.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
@@ -46,13 +45,10 @@
void create_jwt(const char *json_key_file_path, const char *service_url,
const char *scope) {
grpc_auth_json_key key;
- int ok = 0;
char *jwt;
- gpr_slice json_key_data = gpr_load_file(json_key_file_path, 1, &ok);
- if (!ok) {
- fprintf(stderr, "Could not read %s.\n", json_key_file_path);
- exit(1);
- }
+ gpr_slice json_key_data;
+ GPR_ASSERT(GRPC_LOG_IF_ERROR(
+ "load_file", grpc_load_file(json_key_file_path, 1, &json_key_data)));
key = grpc_auth_json_key_create_from_string(
(const char *)GPR_SLICE_START_PTR(json_key_data));
gpr_slice_unref(json_key_data);