From da715181692dfec74f599940a122ace2a9125f3a Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 31 Jan 2016 07:46:47 +0100 Subject: Replacing grpc_max_auth_token_lifetime by an accessor. --- test/core/security/create_jwt.c | 2 +- test/core/security/credentials_test.c | 6 +++--- test/core/security/json_token_test.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/core/security') diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index b02469fb35..288d9ce109 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -62,7 +62,7 @@ void create_jwt(const char *json_key_file_path, const char *service_url, } jwt = grpc_jwt_encode_and_sign( &key, service_url == NULL ? GRPC_JWT_OAUTH2_AUDIENCE : service_url, - grpc_max_auth_token_lifetime, scope); + grpc_max_auth_token_lifetime(), scope); grpc_auth_json_key_destruct(&key); if (jwt == NULL) { fprintf(stderr, "Could not create JWT.\n"); diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index a32ddd2ec7..25faa62917 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -734,7 +734,7 @@ static void validate_jwt_encode_and_sign_params( "777-abaslkan11hlb6nmim3bpspl31ud@developer." "gserviceaccount.com") == 0); if (scope != NULL) GPR_ASSERT(strcmp(scope, test_scope) == 0); - GPR_ASSERT(!gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime)); + GPR_ASSERT(!gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime())); } static char *encode_and_sign_jwt_success(const grpc_auth_json_key *json_key, @@ -794,7 +794,7 @@ static void test_jwt_creds_success(void) { NULL}; grpc_call_credentials *jwt_creds = grpc_service_account_jwt_access_credentials_create( - json_key_string, grpc_max_auth_token_lifetime, NULL); + json_key_string, grpc_max_auth_token_lifetime(), NULL); /* First request: jwt_encode_and_sign should be called. */ grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success); @@ -832,7 +832,7 @@ static void test_jwt_creds_signing_failure(void) { NULL}; grpc_call_credentials *jwt_creds = grpc_service_account_jwt_access_credentials_create( - json_key_string, grpc_max_auth_token_lifetime, NULL); + json_key_string, grpc_max_auth_token_lifetime(), NULL); grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure); grpc_call_credentials_get_request_metadata( diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c index 740fd018b6..a92b00f7b5 100644 --- a/test/core/security/json_token_test.c +++ b/test/core/security/json_token_test.c @@ -330,7 +330,7 @@ static void check_jwt_claim(grpc_json *claim, const char *expected_audience, issue_time.tv_sec = strtol(iat->value, NULL, 10); parsed_lifetime = gpr_time_sub(expiration, issue_time); - GPR_ASSERT(parsed_lifetime.tv_sec == grpc_max_auth_token_lifetime.tv_sec); + GPR_ASSERT(parsed_lifetime.tv_sec == grpc_max_auth_token_lifetime.tv_sec()); } static void check_jwt_signature(const char *b64_signature, RSA *rsa_key, @@ -361,12 +361,12 @@ static void check_jwt_signature(const char *b64_signature, RSA *rsa_key, static char *service_account_creds_jwt_encode_and_sign( const grpc_auth_json_key *key) { return grpc_jwt_encode_and_sign(key, GRPC_JWT_OAUTH2_AUDIENCE, - grpc_max_auth_token_lifetime, test_scope); + grpc_max_auth_token_lifetime(), test_scope); } static char *jwt_creds_jwt_encode_and_sign(const grpc_auth_json_key *key) { return grpc_jwt_encode_and_sign(key, test_service_url, - grpc_max_auth_token_lifetime, NULL); + grpc_max_auth_token_lifetime(), NULL); } static void service_account_creds_check_jwt_claim(grpc_json *claim) { -- cgit v1.2.3 From 1d43bc3ed3d15c04293d0ae2de2be2f00d11ee30 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 1 Feb 2016 00:51:35 +0100 Subject: Fixing copyrights. --- src/core/security/json_token.c | 2 +- test/core/security/create_jwt.c | 2 +- test/core/security/credentials_test.c | 2 +- test/core/security/json_token_test.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test/core/security') diff --git a/src/core/security/json_token.c b/src/core/security/json_token.c index d5d65249ca..762f02989a 100644 --- a/src/core/security/json_token.c +++ b/src/core/security/json_token.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index 288d9ce109..237dc9aa3e 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 25faa62917..8a210bb3c3 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c index a92b00f7b5..33de248e6a 100644 --- a/test/core/security/json_token_test.c +++ b/test/core/security/json_token_test.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without -- cgit v1.2.3