diff options
author | 2018-05-11 12:20:11 -0700 | |
---|---|---|
committer | 2018-05-11 12:20:11 -0700 | |
commit | 4fad281ce8affe27fb7428f264d2c3b9dfc45f2f (patch) | |
tree | ca96c9efd69afec56aa2e5fe072a9f758247d0a3 /src/core/lib/security/credentials/alts | |
parent | ec445cc2bb270ed4acb1c710c3533fca14a50019 (diff) | |
parent | 61fdb46ac456027c79841949272ec540f66d2317 (diff) |
Merge remote-tracking branch 'upstream/master' into fork_exec_ctx_check
Diffstat (limited to 'src/core/lib/security/credentials/alts')
3 files changed, 8 insertions, 65 deletions
diff --git a/src/core/lib/security/credentials/alts/alts_credentials.h b/src/core/lib/security/credentials/alts/alts_credentials.h index 621789cf65..810117f2be 100644 --- a/src/core/lib/security/credentials/alts/alts_credentials.h +++ b/src/core/lib/security/credentials/alts/alts_credentials.h @@ -41,26 +41,6 @@ typedef struct grpc_alts_server_credentials { } grpc_alts_server_credentials; /** - * This method creates an ALTS channel credential object. - * - * - options: grpc ALTS credentials options instance for client. - * - * It returns the created ALTS channel credential object. - */ -grpc_channel_credentials* grpc_alts_credentials_create( - const grpc_alts_credentials_options* options); - -/** - * This method creates an ALTS server credential object. - * - * - options: grpc ALTS credentials options instance for server. - * - * It returns the created ALTS server credential object. - */ -grpc_server_credentials* grpc_alts_server_credentials_create( - const grpc_alts_credentials_options* options); - -/** * This method creates an ALTS channel credential object with customized * information provided by caller. * diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc b/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc index 7d54e8346f..0a39c6c485 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc @@ -44,20 +44,20 @@ static target_service_account* target_service_account_create( return sa; } -bool grpc_alts_credentials_client_options_add_target_service_account( - grpc_alts_credentials_client_options* options, - const char* service_account) { +void grpc_alts_credentials_client_options_add_target_service_account( + grpc_alts_credentials_options* options, const char* service_account) { if (options == nullptr || service_account == nullptr) { gpr_log( GPR_ERROR, "Invalid nullptr arguments to " "grpc_alts_credentials_client_options_add_target_service_account()"); - return false; + return; } + auto client_options = + reinterpret_cast<grpc_alts_credentials_client_options*>(options); target_service_account* node = target_service_account_create(service_account); - node->next = options->target_account_list_head; - options->target_account_list_head = node; - return true; + node->next = client_options->target_account_list_head; + client_options->target_account_list_head = node; } static void target_service_account_destroy( diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h index 4e46d9f2de..320af718bd 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h @@ -21,19 +21,10 @@ #include <grpc/support/port_platform.h> -#include <stdbool.h> +#include <grpc/grpc_security.h> #include "src/core/tsi/alts/handshaker/transport_security_common_api.h" -/** - * Main interface for ALTS credentials options. The options will contain - * information that will be passed from grpc to TSI layer such as RPC protocol - * versions. ALTS client (channel) and server credentials will have their own - * implementation of this interface. The APIs listed in this header are - * thread-compatible. - */ -typedef struct grpc_alts_credentials_options grpc_alts_credentials_options; - /* V-table for grpc_alts_credentials_options */ typedef struct grpc_alts_credentials_options_vtable { grpc_alts_credentials_options* (*copy)( @@ -80,33 +71,5 @@ typedef struct grpc_alts_credentials_server_options { grpc_alts_credentials_options* grpc_alts_credentials_options_copy( const grpc_alts_credentials_options* options); -/** - * This method destroys a grpc_alts_credentials_options instance by - * de-allocating all of its occupied memory. - * - * - options: a grpc_alts_credentials_options instance that needs to be - * destroyed. - */ -void grpc_alts_credentials_options_destroy( - grpc_alts_credentials_options* options); - -/* This method creates a grpc ALTS credentials client options instance. */ -grpc_alts_credentials_options* grpc_alts_credentials_client_options_create(); - -/* This method creates a grpc ALTS credentials server options instance. */ -grpc_alts_credentials_options* grpc_alts_credentials_server_options_create(); - -/** - * This method adds a target service account to grpc ALTS credentials client - * options instance. - * - * - options: grpc ALTS credentials client options instance. - * - service_account: service account of target endpoint. - * - * It returns true on success and false on failure. - */ -bool grpc_alts_credentials_client_options_add_target_service_account( - grpc_alts_credentials_client_options* options, const char* service_account); - #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_GRPC_ALTS_CREDENTIALS_OPTIONS_H \ */ |