diff --git a/modules/grpc/common/grpc-grammar.ym b/modules/grpc/common/grpc-grammar.ym index 53b8a81d6..421bf3ca7 100644 --- a/modules/grpc/common/grpc-grammar.ym +++ b/modules/grpc/common/grpc-grammar.ym @@ -52,6 +52,11 @@ GrpcClientCredentialsBuilderW *last_grpc_client_credentials_builder; %token KW_TARGET_SERVICE_ACCOUNTS %token KW_URL %token KW_ADC +%token KW_SERVICE_ACCOUNT +%token KW_TOKEN_VALIDITY_DURATION +%token KW_AUDIENCE +%token KW_SCOPE +%token KW_KEY %token KW_COMPRESSION %token KW_BATCH_BYTES %token KW_CONCURRENT_REQUESTS @@ -211,6 +216,7 @@ grpc_client_credentials_option | KW_TLS { grpc_client_credentials_builder_set_mode(last_grpc_client_credentials_builder, GCAM_TLS); } '(' grpc_client_credentials_builder_tls_options ')' | KW_ALTS { grpc_client_credentials_builder_set_mode(last_grpc_client_credentials_builder, GCAM_ALTS); } '(' grpc_client_credentials_builder_alts_options ')' | KW_ADC { grpc_client_credentials_builder_set_mode(last_grpc_client_credentials_builder, GCAM_ADC); } '(' ')' + | KW_SERVICE_ACCOUNT { grpc_client_credentials_builder_set_mode(last_grpc_client_credentials_builder, GCAM_SERVICE_ACCOUNT); } '(' grpc_client_credentials_builder_service_account_options ')' ; grpc_client_credentials_builder_tls_options @@ -255,6 +261,16 @@ grpc_client_credentials_builder_alts_target_service_accounts | ; +grpc_client_credentials_builder_service_account_options + : grpc_client_credentials_builder_service_account_option grpc_client_credentials_builder_service_account_options + | + ; + +grpc_client_credentials_builder_service_account_option + : KW_KEY '(' path_secret ')' { grpc_client_credentials_builder_service_account_set_key(last_grpc_client_credentials_builder, $3); free($3); } + | KW_TOKEN_VALIDITY_DURATION '(' nonnegative_integer64 ')' { grpc_client_credentials_builder_service_account_set_validity_duration(last_grpc_client_credentials_builder, $3); } + ; + /* END_RULES */ %% diff --git a/modules/grpc/common/grpc-parser.h b/modules/grpc/common/grpc-parser.h index 12b00dde3..3e4daf45c 100644 --- a/modules/grpc/common/grpc-parser.h +++ b/modules/grpc/common/grpc-parser.h @@ -35,6 +35,11 @@ { "url", KW_URL }, \ { "target_service_accounts", KW_TARGET_SERVICE_ACCOUNTS }, \ { "adc", KW_ADC }, \ + { "service_account", KW_SERVICE_ACCOUNT }, \ + { "key", KW_KEY }, \ + { "scope", KW_SCOPE }, \ + { "audience", KW_AUDIENCE }, \ + { "token_validity_duration", KW_TOKEN_VALIDITY_DURATION }, \ { "compression", KW_COMPRESSION }, \ { "batch_bytes", KW_BATCH_BYTES }, \ { "channel_args", KW_CHANNEL_ARGS }, \