Classes | Macros | Functions | Variables
h2_oauth2.cc File Reference
#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
Include dependency graph for h2_oauth2.cc:

Go to the source code of this file.

Classes

struct  fullstack_secure_fixture_data
 
struct  test_processor_state
 

Macros

#define CA_CERT_PATH   "src/core/tsi/test_creds/ca.pem"
 
#define SERVER_CERT_PATH   "src/core/tsi/test_creds/server1.pem"
 
#define SERVER_KEY_PATH   "src/core/tsi/test_creds/server1.key"
 

Functions

static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack (const grpc_channel_args *, const grpc_channel_args *, grpc_tls_version tls_version)
 
static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_2 (const grpc_channel_args *client_args, const grpc_channel_args *server_args)
 
static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_3 (const grpc_channel_args *client_args, const grpc_channel_args *server_args)
 
static void chttp2_init_client_secure_fullstack (grpc_end2end_test_fixture *f, const grpc_channel_args *client_args, grpc_channel_credentials *creds)
 
static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack (grpc_end2end_test_fixture *f, const grpc_channel_args *client_args)
 
static void chttp2_init_server_secure_fullstack (grpc_end2end_test_fixture *f, const grpc_channel_args *server_args, grpc_server_credentials *server_creds)
 
static void chttp2_init_server_simple_ssl_secure_fullstack (grpc_end2end_test_fixture *f, const grpc_channel_args *server_args)
 
void chttp2_tear_down_secure_fullstack (grpc_end2end_test_fixture *f)
 
static int fail_server_auth_check (const grpc_channel_args *server_args)
 
static const grpc_metadatafind_metadata (const grpc_metadata *md, size_t md_count, const char *key, const char *value)
 
int main (int argc, char **argv)
 
static void process_oauth2_failure (void *state, grpc_auth_context *, const grpc_metadata *md, size_t md_count, grpc_process_auth_metadata_done_cb cb, void *user_data)
 
static void process_oauth2_success (void *state, grpc_auth_context *ctx, const grpc_metadata *md, size_t md_count, grpc_process_auth_metadata_done_cb cb, void *user_data)
 
static void processor_destroy (void *state)
 
static grpc_auth_metadata_processor test_processor_create (int failing)
 

Variables

static const char * client_identity = "Brainy Smurf"
 
static const char * client_identity_property_name = "smurf_name"
 
static grpc_end2end_test_config configs []
 
static const char oauth2_md [] = "Bearer aaslkfjs424535asdf"
 

Macro Definition Documentation

◆ CA_CERT_PATH

#define CA_CERT_PATH   "src/core/tsi/test_creds/ca.pem"

Definition at line 35 of file h2_oauth2.cc.

◆ SERVER_CERT_PATH

#define SERVER_CERT_PATH   "src/core/tsi/test_creds/server1.pem"

Definition at line 36 of file h2_oauth2.cc.

◆ SERVER_KEY_PATH

#define SERVER_KEY_PATH   "src/core/tsi/test_creds/server1.key"

Definition at line 37 of file h2_oauth2.cc.

Function Documentation

◆ chttp2_create_fixture_secure_fullstack()

static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack ( const grpc_channel_args ,
const grpc_channel_args ,
grpc_tls_version  tls_version 
)
static

Definition at line 98 of file h2_oauth2.cc.

◆ chttp2_create_fixture_secure_fullstack_tls1_2()

static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_2 ( const grpc_channel_args client_args,
const grpc_channel_args server_args 
)
static

Definition at line 112 of file h2_oauth2.cc.

◆ chttp2_create_fixture_secure_fullstack_tls1_3()

static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_3 ( const grpc_channel_args client_args,
const grpc_channel_args server_args 
)
static

Definition at line 119 of file h2_oauth2.cc.

◆ chttp2_init_client_secure_fullstack()

static void chttp2_init_client_secure_fullstack ( grpc_end2end_test_fixture f,
const grpc_channel_args client_args,
grpc_channel_credentials creds 
)
static

Definition at line 126 of file h2_oauth2.cc.

◆ chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack()

static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack ( grpc_end2end_test_fixture f,
const grpc_channel_args client_args 
)
static

Definition at line 158 of file h2_oauth2.cc.

◆ chttp2_init_server_secure_fullstack()

static void chttp2_init_server_secure_fullstack ( grpc_end2end_test_fixture f,
const grpc_channel_args server_args,
grpc_server_credentials server_creds 
)
static

Definition at line 136 of file h2_oauth2.cc.

◆ chttp2_init_server_simple_ssl_secure_fullstack()

static void chttp2_init_server_simple_ssl_secure_fullstack ( grpc_end2end_test_fixture f,
const grpc_channel_args server_args 
)
static

Definition at line 228 of file h2_oauth2.cc.

◆ chttp2_tear_down_secure_fullstack()

void chttp2_tear_down_secure_fullstack ( grpc_end2end_test_fixture f)

Definition at line 152 of file h2_oauth2.cc.

◆ fail_server_auth_check()

static int fail_server_auth_check ( const grpc_channel_args server_args)
static

Definition at line 195 of file h2_oauth2.cc.

◆ find_metadata()

static const grpc_metadata* find_metadata ( const grpc_metadata md,
size_t  md_count,
const char *  key,
const char *  value 
)
static

Definition at line 48 of file h2_oauth2.cc.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 282 of file h2_oauth2.cc.

◆ process_oauth2_failure()

static void process_oauth2_failure ( void *  state,
grpc_auth_context ,
const grpc_metadata md,
size_t  md_count,
grpc_process_auth_metadata_done_cb  cb,
void *  user_data 
)
static

Definition at line 84 of file h2_oauth2.cc.

◆ process_oauth2_success()

static void process_oauth2_success ( void *  state,
grpc_auth_context ctx,
const grpc_metadata md,
size_t  md_count,
grpc_process_auth_metadata_done_cb  cb,
void *  user_data 
)
static

Definition at line 65 of file h2_oauth2.cc.

◆ processor_destroy()

static void processor_destroy ( void *  state)
static

Definition at line 207 of file h2_oauth2.cc.

◆ test_processor_create()

static grpc_auth_metadata_processor test_processor_create ( int  failing)
static

Definition at line 213 of file h2_oauth2.cc.

Variable Documentation

◆ client_identity

const char* client_identity = "Brainy Smurf"
static

Definition at line 41 of file h2_oauth2.cc.

◆ client_identity_property_name

const char* client_identity_property_name = "smurf_name"
static

Definition at line 40 of file h2_oauth2.cc.

◆ configs

grpc_end2end_test_config configs[]
static

◆ oauth2_md

const char oauth2_md[] = "Bearer aaslkfjs424535asdf"
static

Definition at line 39 of file h2_oauth2.cc.

FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER
#define FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER
Definition: end2end_tests.h:38
chttp2_create_fixture_secure_fullstack_tls1_3
static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_3(const grpc_channel_args *client_args, const grpc_channel_args *server_args)
Definition: h2_oauth2.cc:119
FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS
#define FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS
Definition: end2end_tests.h:32
chttp2_tear_down_secure_fullstack
void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f)
Definition: h2_oauth2.cc:152
chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack
static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack(grpc_end2end_test_fixture *f, const grpc_channel_args *client_args)
Definition: h2_oauth2.cc:158
FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION
#define FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION
Definition: end2end_tests.h:28
FEATURE_MASK_DOES_NOT_SUPPORT_CLIENT_HANDSHAKE_COMPLETE_FIRST
#define FEATURE_MASK_DOES_NOT_SUPPORT_CLIENT_HANDSHAKE_COMPLETE_FIRST
Definition: end2end_tests.h:42
chttp2_init_server_simple_ssl_secure_fullstack
static void chttp2_init_server_simple_ssl_secure_fullstack(grpc_end2end_test_fixture *f, const grpc_channel_args *server_args)
Definition: h2_oauth2.cc:228
chttp2_create_fixture_secure_fullstack_tls1_2
static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack_tls1_2(const grpc_channel_args *client_args, const grpc_channel_args *server_args)
Definition: h2_oauth2.cc:112
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL
#define FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL
Definition: end2end_tests.h:37


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:19