aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/security/credentials
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-05-31 15:09:12 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-05-31 15:10:58 -0700
commit2a50dfefdc8a244113864049573416aa04ec9a56 (patch)
treea1a41de25d41fd92defe99d7f59361333371d347 /src/core/lib/security/credentials
parent8bec6f6a55afaa1e321f29bf816d2a010f510b3c (diff)
s/grpc_pops/grpc_polling_entity
Diffstat (limited to 'src/core/lib/security/credentials')
-rw-r--r--src/core/lib/security/credentials/composite/composite_credentials.c20
-rw-r--r--src/core/lib/security/credentials/credentials.c4
-rw-r--r--src/core/lib/security/credentials/credentials.h11
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.c2
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.c18
-rw-r--r--src/core/lib/security/credentials/iam/iam_credentials.c2
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_credentials.c2
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.c10
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.c14
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.h2
-rw-r--r--src/core/lib/security/credentials/plugin/plugin_credentials.c2
11 files changed, 44 insertions, 43 deletions
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.c b/src/core/lib/security/credentials/composite/composite_credentials.c
index 38abd84b04..07db8bfd75 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.c
+++ b/src/core/lib/security/credentials/composite/composite_credentials.c
@@ -35,7 +35,7 @@
#include <string.h>
-#include "src/core/lib/iomgr/pops.h"
+#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h>
@@ -50,7 +50,7 @@ typedef struct {
grpc_credentials_md_store *md_elems;
grpc_auth_metadata_context auth_md_context;
void *user_data;
- grpc_pops *pops;
+ grpc_polling_entity *pollent;
grpc_credentials_metadata_cb cb;
} grpc_composite_call_credentials_metadata_context;
@@ -93,9 +93,9 @@ static void composite_call_metadata_cb(grpc_exec_ctx *exec_ctx, void *user_data,
if (ctx->creds_index < ctx->composite_creds->inner.num_creds) {
grpc_call_credentials *inner_creds =
ctx->composite_creds->inner.creds_array[ctx->creds_index++];
- grpc_call_credentials_get_request_metadata(exec_ctx, inner_creds, ctx->pops,
- ctx->auth_md_context,
- composite_call_metadata_cb, ctx);
+ grpc_call_credentials_get_request_metadata(
+ exec_ctx, inner_creds, ctx->pollent, ctx->auth_md_context,
+ composite_call_metadata_cb, ctx);
return;
}
@@ -106,9 +106,9 @@ static void composite_call_metadata_cb(grpc_exec_ctx *exec_ctx, void *user_data,
}
static void composite_call_get_request_metadata(
- grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds, grpc_pops *pops,
- grpc_auth_metadata_context auth_md_context, grpc_credentials_metadata_cb cb,
- void *user_data) {
+ grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context auth_md_context,
+ grpc_credentials_metadata_cb cb, void *user_data) {
grpc_composite_call_credentials *c = (grpc_composite_call_credentials *)creds;
grpc_composite_call_credentials_metadata_context *ctx;
@@ -118,10 +118,10 @@ static void composite_call_get_request_metadata(
ctx->user_data = user_data;
ctx->cb = cb;
ctx->composite_creds = c;
- ctx->pops = pops;
+ ctx->pollent = pollent;
ctx->md_elems = grpc_credentials_md_store_create(c->inner.num_creds);
grpc_call_credentials_get_request_metadata(
- exec_ctx, c->inner.creds_array[ctx->creds_index++], ctx->pops,
+ exec_ctx, c->inner.creds_array[ctx->creds_index++], ctx->pollent,
auth_md_context, composite_call_metadata_cb, ctx);
}
diff --git a/src/core/lib/security/credentials/credentials.c b/src/core/lib/security/credentials/credentials.c
index b33deefb3d..f45a8d8ff6 100644
--- a/src/core/lib/security/credentials/credentials.c
+++ b/src/core/lib/security/credentials/credentials.c
@@ -111,7 +111,7 @@ void grpc_call_credentials_release(grpc_call_credentials *creds) {
void grpc_call_credentials_get_request_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
- grpc_pops *pops, grpc_auth_metadata_context context,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb, void *user_data) {
if (creds == NULL || creds->vtable->get_request_metadata == NULL) {
if (cb != NULL) {
@@ -119,7 +119,7 @@ void grpc_call_credentials_get_request_metadata(
}
return;
}
- creds->vtable->get_request_metadata(exec_ctx, creds, pops, context, cb,
+ creds->vtable->get_request_metadata(exec_ctx, creds, pollent, context, cb,
user_data);
}
diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h
index d3531bcfc0..15dcfe473d 100644
--- a/src/core/lib/security/credentials/credentials.h
+++ b/src/core/lib/security/credentials/credentials.h
@@ -41,7 +41,7 @@
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
-#include "src/core/lib/iomgr/pops.h"
+#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/transport/security_connector.h"
struct grpc_http_response;
@@ -165,7 +165,8 @@ typedef void (*grpc_credentials_metadata_cb)(grpc_exec_ctx *exec_ctx,
typedef struct {
void (*destruct)(grpc_call_credentials *c);
void (*get_request_metadata)(grpc_exec_ctx *exec_ctx,
- grpc_call_credentials *c, grpc_pops *pops,
+ grpc_call_credentials *c,
+ grpc_polling_entity *pollent,
grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb,
void *user_data);
@@ -180,9 +181,9 @@ struct grpc_call_credentials {
grpc_call_credentials *grpc_call_credentials_ref(grpc_call_credentials *creds);
void grpc_call_credentials_unref(grpc_call_credentials *creds);
void grpc_call_credentials_get_request_metadata(
- grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds, grpc_pops *pops,
- grpc_auth_metadata_context context, grpc_credentials_metadata_cb cb,
- void *user_data);
+ grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context context,
+ grpc_credentials_metadata_cb cb, void *user_data);
/* Metadata-only credentials with the specified key and value where
asynchronicity can be simulated for testing. */
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.c b/src/core/lib/security/credentials/fake/fake_credentials.c
index beb0e5ee1e..005777d3c6 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.c
+++ b/src/core/lib/security/credentials/fake/fake_credentials.c
@@ -106,7 +106,7 @@ static void on_simulated_token_fetch_done(grpc_exec_ctx *exec_ctx,
static void md_only_test_get_request_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
- grpc_pops *pops, grpc_auth_metadata_context context,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb, void *user_data) {
grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)creds;
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.c b/src/core/lib/security/credentials/google_default/google_default_credentials.c
index ddea7a9ed2..ef21c24a6c 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.c
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.c
@@ -41,7 +41,7 @@
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
-#include "src/core/lib/iomgr/pops.h"
+#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include "src/core/lib/support/env.h"
@@ -63,7 +63,7 @@ static gpr_once g_once = GPR_ONCE_INIT;
static void init_default_credentials(void) { gpr_mu_init(&g_state_mu); }
typedef struct {
- grpc_pops pops;
+ grpc_polling_entity pollent;
int is_done;
int success;
} compute_engine_detector;
@@ -87,7 +87,7 @@ static void on_compute_engine_detection_http_response(
}
gpr_mu_lock(g_polling_mu);
detector->is_done = 1;
- grpc_pollset_kick(grpc_pops_pollset(&detector->pops), NULL);
+ grpc_pollset_kick(grpc_pops_pollset(&detector->pollent), NULL);
gpr_mu_unlock(g_polling_mu);
}
@@ -108,7 +108,7 @@ static int is_stack_running_on_compute_engine(void) {
grpc_pollset *pollset = gpr_malloc(grpc_pollset_size());
grpc_pollset_init(pollset, &g_polling_mu);
- detector.pops = grpc_pops_create_from_pollset(pollset);
+ detector.pollent = grpc_pops_create_from_pollset(pollset);
detector.is_done = 0;
detector.success = 0;
@@ -119,7 +119,7 @@ static int is_stack_running_on_compute_engine(void) {
grpc_httpcli_context_init(&context);
grpc_httpcli_get(
- &exec_ctx, &context, &detector.pops, &request,
+ &exec_ctx, &context, &detector.pollent, &request,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), max_detection_delay),
on_compute_engine_detection_http_response, &detector);
@@ -130,7 +130,7 @@ static int is_stack_running_on_compute_engine(void) {
gpr_mu_lock(g_polling_mu);
while (!detector.is_done) {
grpc_pollset_worker *worker = NULL;
- grpc_pollset_work(&exec_ctx, grpc_pops_pollset(&detector.pops), &worker,
+ grpc_pollset_work(&exec_ctx, grpc_pops_pollset(&detector.pollent), &worker,
gpr_now(GPR_CLOCK_MONOTONIC),
gpr_inf_future(GPR_CLOCK_MONOTONIC));
}
@@ -138,13 +138,13 @@ static int is_stack_running_on_compute_engine(void) {
grpc_httpcli_context_destroy(&context);
grpc_closure_init(&destroy_closure, destroy_pollset,
- grpc_pops_pollset(&detector.pops));
- grpc_pollset_shutdown(&exec_ctx, grpc_pops_pollset(&detector.pops),
+ grpc_pops_pollset(&detector.pollent));
+ grpc_pollset_shutdown(&exec_ctx, grpc_pops_pollset(&detector.pollent),
&destroy_closure);
grpc_exec_ctx_finish(&exec_ctx);
g_polling_mu = NULL;
- gpr_free(grpc_pops_pollset(&detector.pops));
+ gpr_free(grpc_pops_pollset(&detector.pollent));
return detector.success;
}
diff --git a/src/core/lib/security/credentials/iam/iam_credentials.c b/src/core/lib/security/credentials/iam/iam_credentials.c
index 90779cfc71..64d5871844 100644
--- a/src/core/lib/security/credentials/iam/iam_credentials.c
+++ b/src/core/lib/security/credentials/iam/iam_credentials.c
@@ -49,7 +49,7 @@ static void iam_destruct(grpc_call_credentials *creds) {
static void iam_get_request_metadata(grpc_exec_ctx *exec_ctx,
grpc_call_credentials *creds,
- grpc_pops* pops,
+ grpc_polling_entity *pollent,
grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb,
void *user_data) {
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.c b/src/core/lib/security/credentials/jwt/jwt_credentials.c
index 590f29b7b7..973fb75eaa 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.c
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.c
@@ -64,7 +64,7 @@ static void jwt_destruct(grpc_call_credentials *creds) {
static void jwt_get_request_metadata(grpc_exec_ctx *exec_ctx,
grpc_call_credentials *creds,
- grpc_pops* pops,
+ grpc_polling_entity *pollent,
grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb,
void *user_data) {
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.c b/src/core/lib/security/credentials/jwt/jwt_verifier.c
index a3e0c2d78c..c56715e55a 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.c
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.c
@@ -37,7 +37,7 @@
#include <string.h>
#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/iomgr/pops.h"
+#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/util/b64.h"
#include "src/core/lib/tsi/ssl_types.h"
@@ -322,7 +322,7 @@ grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims,
typedef struct {
grpc_jwt_verifier *verifier;
- grpc_pops pops;
+ grpc_polling_entity pollent;
jose_header *header;
grpc_jwt_claims *claims;
char *audience;
@@ -342,7 +342,7 @@ static verifier_cb_ctx *verifier_cb_ctx_create(
verifier_cb_ctx *ctx = gpr_malloc(sizeof(verifier_cb_ctx));
memset(ctx, 0, sizeof(verifier_cb_ctx));
ctx->verifier = verifier;
- ctx->pops = grpc_pops_create_from_pollset(pollset);
+ ctx->pollent = grpc_pops_create_from_pollset(pollset);
ctx->header = header;
ctx->audience = gpr_strdup(audience);
ctx->claims = claims;
@@ -645,7 +645,7 @@ static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
*(req.host + (req.http.path - jwks_uri)) = '\0';
}
grpc_httpcli_get(
- exec_ctx, &ctx->verifier->http_ctx, &ctx->pops, &req,
+ exec_ctx, &ctx->verifier->http_ctx, &ctx->pollent, &req,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay),
on_keys_retrieved, ctx);
grpc_json_destroy(json);
@@ -748,7 +748,7 @@ static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
}
grpc_httpcli_get(
- exec_ctx, &ctx->verifier->http_ctx, &ctx->pops, &req,
+ exec_ctx, &ctx->verifier->http_ctx, &ctx->pollent, &req,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay),
http_cb, ctx);
gpr_free(req.host);
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c b/src/core/lib/security/credentials/oauth2/oauth2_credentials.c
index 131aa69fb8..268026b9f0 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.c
@@ -244,7 +244,7 @@ static void on_oauth2_token_fetcher_http_response(
static void oauth2_token_fetcher_get_request_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
- grpc_pops *pops, grpc_auth_metadata_context context,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb, void *user_data) {
grpc_oauth2_token_fetcher_credentials *c =
(grpc_oauth2_token_fetcher_credentials *)creds;
@@ -270,7 +270,7 @@ static void oauth2_token_fetcher_get_request_metadata(
c->fetch_func(
exec_ctx,
grpc_credentials_metadata_request_create(creds, cb, user_data),
- &c->httpcli_context, pops, on_oauth2_token_fetcher_http_response,
+ &c->httpcli_context, pollent, on_oauth2_token_fetcher_http_response,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), refresh_threshold));
}
}
@@ -295,7 +295,7 @@ static grpc_call_credentials_vtable compute_engine_vtable = {
static void compute_engine_fetch_oauth2(
grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
- grpc_httpcli_context *httpcli_context, grpc_pops* pops,
+ grpc_httpcli_context *httpcli_context, grpc_polling_entity *pollent,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_http_header header = {"Metadata-Flavor", "Google"};
grpc_httpcli_request request;
@@ -304,7 +304,7 @@ static void compute_engine_fetch_oauth2(
request.http.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.http.hdr_count = 1;
request.http.hdrs = &header;
- grpc_httpcli_get(exec_ctx, httpcli_context, pops, &request, deadline,
+ grpc_httpcli_get(exec_ctx, httpcli_context, pollent, &request, deadline,
response_cb, metadata_req);
}
@@ -336,7 +336,7 @@ static grpc_call_credentials_vtable refresh_token_vtable = {
static void refresh_token_fetch_oauth2(
grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
- grpc_httpcli_context *httpcli_context, grpc_pops* pops,
+ grpc_httpcli_context *httpcli_context, grpc_polling_entity *pollent,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_google_refresh_token_credentials *c =
(grpc_google_refresh_token_credentials *)metadata_req->creds;
@@ -353,7 +353,7 @@ static void refresh_token_fetch_oauth2(
request.http.hdr_count = 1;
request.http.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
- grpc_httpcli_post(exec_ctx, httpcli_context, pops, &request, body,
+ grpc_httpcli_post(exec_ctx, httpcli_context, pollent, &request, body,
strlen(body), deadline, response_cb, metadata_req);
gpr_free(body);
}
@@ -396,7 +396,7 @@ static void access_token_destruct(grpc_call_credentials *creds) {
static void access_token_get_request_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
- grpc_pops* pops, grpc_auth_metadata_context context,
+ grpc_polling_entity *pollent, grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb, void *user_data) {
grpc_access_token_credentials *c = (grpc_access_token_credentials *)creds;
cb(exec_ctx, user_data, c->access_token_md->entries, 1, GRPC_CREDENTIALS_OK);
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index 2ae37f5c24..3bc8360a41 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -70,7 +70,7 @@ void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token *refresh_token);
typedef void (*grpc_fetch_oauth2_func)(grpc_exec_ctx *exec_ctx,
grpc_credentials_metadata_request *req,
grpc_httpcli_context *http_context,
- grpc_pops *pops,
+ grpc_polling_entity *pollent,
grpc_httpcli_response_cb response_cb,
gpr_timespec deadline);
typedef struct {
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.c b/src/core/lib/security/credentials/plugin/plugin_credentials.c
index 348f4c929f..9fb55e8466 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.c
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.c
@@ -94,7 +94,7 @@ static void plugin_md_request_metadata_ready(void *request,
static void plugin_get_request_metadata(grpc_exec_ctx *exec_ctx,
grpc_call_credentials *creds,
- grpc_pops *pops,
+ grpc_polling_entity *pollent,
grpc_auth_metadata_context context,
grpc_credentials_metadata_cb cb,
void *user_data) {