GRPC Core 0.10.0.0

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
credentials.h File Reference
`#include "src/core/transport/stream_op.h"`
`#include <grpc/grpc.h>`
`#include <grpc/grpc_security.h>`
`#include <grpc/support/sync.h>`
`#include "src/core/httpcli/httpcli.h"`
`#include "src/core/security/json_token.h"`
`#include "src/core/security/security_connector.h"`

Go to the source code of this file.

## Data Structures
struct | grpc_credentials_md
struct | grpc_credentials_md_store
struct | grpc_credentials_vtable
struct | grpc_credentials
struct | grpc_credentials_array
struct | grpc_server_credentials_vtable
struct | grpc_server_credentials
struct | grpc_ssl_credentials
struct | grpc_ssl_server_credentials
struct | grpc_service_account_jwt_access_credentials
struct | grpc_oauth2_token_fetcher_credentials
struct | grpc_service_account_credentials
struct | grpc_refresh_token_credentials
struct | grpc_access_token_credentials
struct | grpc_fake_oauth2_credentials
struct | grpc_iam_credentials
struct | grpc_composite_credentials

## Macros
#define | GRPC_FAKE_TRANSPORT_SECURITY_TYPE "fake"
#define | GRPC_CREDENTIALS_TYPE_SSL "Ssl"
#define | GRPC_CREDENTIALS_TYPE_OAUTH2 "Oauth2"
#define | GRPC_CREDENTIALS_TYPE_JWT "Jwt"
#define | GRPC_CREDENTIALS_TYPE_IAM "Iam"
#define | GRPC_CREDENTIALS_TYPE_COMPOSITE "Composite"
#define | GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY "FakeTransportSecurity"
#define | GRPC_AUTHORIZATION_METADATA_KEY "Authorization"
#define | GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY "x-goog-iam-authorization-token"
#define | GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY "x-goog-iam-authority-selector"
#define | GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud"
#define | GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE "application_default_credentials.json"
#define | GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS 60
#define | GRPC_COMPUTE_ENGINE_METADATA_HOST "metadata"
#define | GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH "/computeMetadata/v1/instance/service-accounts/default/token"
#define | GRPC_GOOGLE_OAUTH2_SERVICE_HOST "www.googleapis.com"
#define | GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH "/oauth2/v3/token"
#define | GRPC_SERVICE_ACCOUNT_POST_BODY_PREFIX
#define | GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING "client_id=%s&client_secret=%s&refresh_token=%s&grant_type=refresh_token"

## Typedefs
typedef void(* | grpc_credentials_metadata_cb )(void *user_data, grpc_credentials_md *md_elems, size_t num_md, grpc_credentials_status status)
typedef struct grpc_credentials_metadata_request | grpc_credentials_metadata_request
typedef void(* | grpc_fetch_oauth2_func )(grpc_credentials_metadata_request *req, grpc_httpcli_context *http_context, grpc_pollset *pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline)

## Enumerations
enum | grpc_credentials_status { GRPC_CREDENTIALS_OK = 0, GRPC_CREDENTIALS_ERROR }

## Functions
grpc_credentials_md_store * | grpc_credentials_md_store_create (size_t initial_capacity)
void | grpc_credentials_md_store_add (grpc_credentials_md_store *store, gpr_slice key, gpr_slice value)
void | grpc_credentials_md_store_add_cstrings (grpc_credentials_md_store *store, const char *key, const char *value)
grpc_credentials_md_store * | grpc_credentials_md_store_ref (grpc_credentials_md_store *store)
void | grpc_credentials_md_store_unref (grpc_credentials_md_store *store)
grpc_credentials * | grpc_fake_transport_security_credentials_create (void)
grpc_server_credentials * | grpc_fake_transport_security_server_credentials_create (void)
char * | grpc_get_well_known_google_credentials_file_path (void)
grpc_credentials * | grpc_credentials_ref (grpc_credentials *creds)
void | grpc_credentials_unref (grpc_credentials *creds)
int | grpc_credentials_has_request_metadata (grpc_credentials *creds)
int | grpc_credentials_has_request_metadata_only (grpc_credentials *creds)
void | grpc_credentials_get_request_metadata (grpc_credentials *creds, grpc_pollset *pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data)
grpc_security_status | grpc_credentials_create_security_connector (grpc_credentials *creds, const char *target, const grpc_channel_args *args, grpc_credentials *request_metadata_creds, grpc_channel_security_connector **sc, grpc_channel_args **new_args)
const grpc_credentials_array * | grpc_composite_credentials_get_credentials (grpc_credentials *composite_creds)
grpc_credentials * | grpc_credentials_contains_type (grpc_credentials *creds, const char *type, grpc_credentials **composite_creds)
grpc_credentials_status | grpc_oauth2_token_fetcher_credentials_parse_server_response (const struct grpc_httpcli_response *response, grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime)
void | grpc_flush_cached_google_default_credentials (void)
grpc_credentials * | grpc_fake_oauth2_credentials_create (const char *token_md_value, int is_async)
grpc_credentials * | grpc_service_account_jwt_access_credentials_create_from_auth_json_key (grpc_auth_json_key key, gpr_timespec token_lifetime)
grpc_credentials * | grpc_refresh_token_credentials_create_from_auth_refresh_token (grpc_auth_refresh_token token)
grpc_security_status | grpc_server_credentials_create_security_connector (grpc_server_credentials *creds, grpc_security_connector **sc)

## Macro Definition Documentation

#define GRPC_AUTHORIZATION_METADATA_KEY "Authorization"

#define GRPC_COMPUTE_ENGINE_METADATA_HOST "metadata"

#define GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH "/computeMetadata/v1/instance/service-accounts/default/token"

#define GRPC_CREDENTIALS_TYPE_COMPOSITE "Composite"

#define GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY "FakeTransportSecurity"

#define GRPC_CREDENTIALS_TYPE_IAM "Iam"

#define GRPC_CREDENTIALS_TYPE_JWT "Jwt"

#define GRPC_CREDENTIALS_TYPE_OAUTH2 "Oauth2"

#define GRPC_CREDENTIALS_TYPE_SSL "Ssl"

#define GRPC_FAKE_TRANSPORT_SECURITY_TYPE "fake"

#define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud"

#define GRPC_GOOGLE_OAUTH2_SERVICE_HOST "www.googleapis.com"

#define GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH "/oauth2/v3/token"

#define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE "application_default_credentials.json"

#define GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY "x-goog-iam-authority-selector"

#define GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY "x-goog-iam-authorization-token"

#define GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING "client_id=%s&client_secret=%s&refresh_token=%s&grant_type=refresh_token"

#define GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS 60

#define GRPC_SERVICE_ACCOUNT_POST_BODY_PREFIX

Value:
"grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&" \
"assertion="

## Typedef Documentation

typedef void(* grpc_credentials_metadata_cb)(void *user_data, grpc_credentials_md *md_elems, size_t num_md, grpc_credentials_status status)

typedef struct grpc_credentials_metadata_request grpc_credentials_metadata_request

typedef void(* grpc_fetch_oauth2_func)(grpc_credentials_metadata_request *req, grpc_httpcli_context *http_context, grpc_pollset *pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline)

## Enumeration Type Documentation

enum grpc_credentials_status

Enumerator
GRPC_CREDENTIALS_OK |
GRPC_CREDENTIALS_ERROR |

## Function Documentation

const grpc_credentials_array* grpc_composite_credentials_get_credentials | ( | grpc_credentials * | composite_creds | ) |

grpc_credentials* grpc_credentials_contains_type | ( | grpc_credentials * | creds,
|  | const char * | type,
|  | grpc_credentials ** | composite_creds
| ) |  |

grpc_security_status grpc_credentials_create_security_connector | ( | grpc_credentials * | creds,
|  | const char * | target,
|  | const grpc_channel_args * | args,
|  | grpc_credentials * | request_metadata_creds,
|  | grpc_channel_security_connector ** | sc,
|  | grpc_channel_args ** | new_args
| ) |  |

void grpc_credentials_get_request_metadata | ( | grpc_credentials * | creds,
|  | grpc_pollset * | pollset,
|  | const char * | service_url,
|  | grpc_credentials_metadata_cb | cb,
|  | void * | user_data
| ) |  |

int grpc_credentials_has_request_metadata | ( | grpc_credentials * | creds | ) |

int grpc_credentials_has_request_metadata_only | ( | grpc_credentials * | creds | ) |

void grpc_credentials_md_store_add | ( | grpc_credentials_md_store * | store,
|  | gpr_slice | key,
|  | gpr_slice | value
| ) |  |

void grpc_credentials_md_store_add_cstrings | ( | grpc_credentials_md_store * | store,
|  | const char * | key,
|  | const char * | value
| ) |  |

grpc_credentials_md_store* grpc_credentials_md_store_create | ( | size_t | initial_capacity | ) |

grpc_credentials_md_store* grpc_credentials_md_store_ref | ( | grpc_credentials_md_store * | store | ) |

void grpc_credentials_md_store_unref | ( | grpc_credentials_md_store * | store | ) |

grpc_credentials* grpc_credentials_ref | ( | grpc_credentials * | creds | ) |

void grpc_credentials_unref | ( | grpc_credentials * | creds | ) |

grpc_credentials* grpc_fake_oauth2_credentials_create | ( | const char * | token_md_value,
|  | int | is_async
| ) |  |

grpc_credentials* grpc_fake_transport_security_credentials_create | ( | void |  | ) |

grpc_server_credentials* grpc_fake_transport_security_server_credentials_create | ( | void |  | ) |

void grpc_flush_cached_google_default_credentials | ( | void |  | ) |

char* grpc_get_well_known_google_credentials_file_path | ( | void |  | ) |

grpc_credentials_status grpc_oauth2_token_fetcher_credentials_parse_server_response | ( | const struct grpc_httpcli_response * | response,
|  | grpc_credentials_md_store ** | token_md,
|  | gpr_timespec * | token_lifetime
| ) |  |

grpc_credentials* grpc_refresh_token_credentials_create_from_auth_refresh_token | ( | grpc_auth_refresh_token | token | ) |

grpc_security_status grpc_server_credentials_create_security_connector | ( | grpc_server_credentials * | creds,
|  | grpc_security_connector ** | sc
| ) |  |

grpc_credentials* grpc_service_account_jwt_access_credentials_create_from_auth_json_key | ( | grpc_auth_json_key | key,
|  | gpr_timespec | token_lifetime
| ) |  |