aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/security')
-rw-r--r--test/core/security/auth_context_test.c1
-rw-r--r--test/core/security/json_token_test.c12
-rw-r--r--test/core/security/jwt_verifier_test.c38
-rw-r--r--test/core/security/print_google_default_creds_token.c3
-rw-r--r--test/core/security/security_connector_test.c9
-rw-r--r--test/core/security/verify_jwt.c1
6 files changed, 31 insertions, 33 deletions
diff --git a/test/core/security/auth_context_test.c b/test/core/security/auth_context_test.c
index d785eb6064..d091c7e7e6 100644
--- a/test/core/security/auth_context_test.c
+++ b/test/core/security/auth_context_test.c
@@ -151,4 +151,3 @@ int main(int argc, char **argv) {
test_chained_context();
return 0;
}
-
diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c
index da57cef15c..0bac61eb54 100644
--- a/test/core/security/json_token_test.c
+++ b/test/core/security/json_token_test.c
@@ -263,8 +263,8 @@ static void check_jwt_header(grpc_json *header) {
GPR_ASSERT(kid != NULL);
GPR_ASSERT(kid->type == GRPC_JSON_STRING);
- GPR_ASSERT(strcmp(kid->value,
- "e6b5137873db8d2ef81e06a47289e6434ec8a165") == 0);
+ GPR_ASSERT(strcmp(kid->value, "e6b5137873db8d2ef81e06a47289e6434ec8a165") ==
+ 0);
}
static void check_jwt_claim(grpc_json *claim, const char *expected_audience,
@@ -298,9 +298,11 @@ static void check_jwt_claim(grpc_json *claim, const char *expected_audience,
GPR_ASSERT(iss != NULL);
GPR_ASSERT(iss->type == GRPC_JSON_STRING);
- GPR_ASSERT(strcmp(iss->value,
- "777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount.com")
- ==0);
+ GPR_ASSERT(
+ strcmp(
+ iss->value,
+ "777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount.com") ==
+ 0);
if (expected_scope != NULL) {
GPR_ASSERT(scope != NULL);
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
index 440286ea1a..5cc8b2e9be 100644
--- a/test/core/security/jwt_verifier_test.c
+++ b/test/core/security/jwt_verifier_test.c
@@ -93,8 +93,7 @@ static const char json_key_str_part3_for_custom_email_issuer[] =
"com\", \"type\": \"service_account\" }";
static grpc_jwt_verifier_email_domain_key_url_mapping custom_mapping = {
- "bar.com", "keys.bar.com/jwk"
-};
+ "bar.com", "keys.bar.com/jwk"};
static const char expected_user_data[] = "user data";
@@ -153,7 +152,7 @@ static const char expired_claims[] =
" \"iss\": \"blah.foo.com\","
" \"sub\": \"juju@blah.foo.com\","
" \"jti\": \"jwtuniqueid\","
- " \"iat\": 100," /* Way back in the past... */
+ " \"iat\": 100," /* Way back in the past... */
" \"exp\": 120,"
" \"nbf\": 60,"
" \"foo\": \"bar\"}";
@@ -316,8 +315,8 @@ static void test_jwt_verifier_google_email_issuer_success(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_google_keys_for_email,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
GPR_ASSERT(jwt != NULL);
grpc_jwt_verifier_verify(verifier, NULL, jwt, expected_audience,
@@ -348,8 +347,8 @@ static void test_jwt_verifier_custom_email_issuer_success(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_custom_keys_for_email,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
GPR_ASSERT(jwt != NULL);
grpc_jwt_verifier_verify(verifier, NULL, jwt, expected_audience,
@@ -359,9 +358,10 @@ static void test_jwt_verifier_custom_email_issuer_success(void) {
grpc_httpcli_set_override(NULL, NULL);
}
-static int httpcli_get_jwk_set(
- const grpc_httpcli_request *request, gpr_timespec deadline,
- grpc_httpcli_response_cb on_response, void *user_data) {
+static int httpcli_get_jwk_set(const grpc_httpcli_request *request,
+ gpr_timespec deadline,
+ grpc_httpcli_response_cb on_response,
+ void *user_data) {
grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
@@ -396,8 +396,8 @@ static void test_jwt_verifier_url_issuer_success(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_openid_config,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
GPR_ASSERT(jwt != NULL);
grpc_jwt_verifier_verify(verifier, NULL, jwt, expected_audience,
@@ -436,8 +436,8 @@ static void test_jwt_verifier_url_issuer_bad_config(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_bad_json,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
GPR_ASSERT(jwt != NULL);
grpc_jwt_verifier_verify(verifier, NULL, jwt, expected_audience,
@@ -457,8 +457,8 @@ static void test_jwt_verifier_bad_json_key(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_bad_json,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
GPR_ASSERT(jwt != NULL);
grpc_jwt_verifier_verify(verifier, NULL, jwt, expected_audience,
@@ -503,8 +503,8 @@ static void test_jwt_verifier_bad_signature(void) {
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
grpc_httpcli_set_override(httpcli_get_openid_config,
httpcli_post_should_not_be_called);
- jwt =
- grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime, NULL);
+ jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+ NULL);
grpc_auth_json_key_destruct(&key);
corrupt_jwt_sig(jwt);
GPR_ASSERT(jwt != NULL);
@@ -546,7 +546,6 @@ static void test_jwt_verifier_bad_format(void) {
/* bad signature custom provided email*/
/* bad key */
-
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_claims_success();
@@ -562,4 +561,3 @@ int main(int argc, char **argv) {
test_jwt_verifier_bad_format();
return 0;
}
-
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
index 7238efbbfd..b4323ab200 100644
--- a/test/core/security/print_google_default_creds_token.c
+++ b/test/core/security/print_google_default_creds_token.c
@@ -49,8 +49,7 @@ typedef struct {
int is_done;
} synchronizer;
-static void on_metadata_response(void *user_data,
- grpc_credentials_md *md_elems,
+static void on_metadata_response(void *user_data, grpc_credentials_md *md_elems,
size_t num_md,
grpc_credentials_status status) {
synchronizer *sync = user_data;
diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c
index b37fd7213d..3f6c592b0b 100644
--- a/test/core/security/security_connector_test.c
+++ b/test/core/security/security_connector_test.c
@@ -77,9 +77,9 @@ static void test_unauthenticated_ssl_peer(void) {
}
static int check_identity(const grpc_auth_context *ctx,
- const char *expected_property_name,
- const char **expected_identities,
- size_t num_identities) {
+ const char *expected_property_name,
+ const char **expected_identities,
+ size_t num_identities) {
grpc_auth_property_iterator it;
const grpc_auth_property *prop;
size_t i;
@@ -166,7 +166,8 @@ static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
ctx = tsi_ssl_peer_to_auth_context(&peer);
GPR_ASSERT(ctx != NULL);
GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
- GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
+ GPR_ASSERT(
+ check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
GPR_ASSERT(check_transport_security_type(ctx));
GPR_ASSERT(check_x509_cn(ctx, expected_cn));
diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c
index 69bbc3cc0c..5ebde5fbb4 100644
--- a/test/core/security/verify_jwt.c
+++ b/test/core/security/verify_jwt.c
@@ -120,4 +120,3 @@ int main(int argc, char **argv) {
gpr_cmdline_destroy(cl);
return !sync.success;
}
-