32 const char* kMeshCaPlugin =
"meshCA";
49 std::vector<grpc_error_handle>
52 std::vector<grpc_error_handle> error_list_sts_service;
54 &sts_config_.token_exchange_service_uri,
55 &error_list_sts_service,
false)) {
56 sts_config_.token_exchange_service_uri =
57 "securetoken.googleapis.com";
60 &error_list_sts_service,
false);
62 &error_list_sts_service,
false);
64 &error_list_sts_service,
false)) {
66 "https://www.googleapis.com/auth/cloud-platform";
69 &sts_config_.requested_token_type,
70 &error_list_sts_service,
false);
72 &sts_config_.subject_token_path,
73 &error_list_sts_service);
75 &sts_config_.subject_token_type,
76 &error_list_sts_service);
78 &sts_config_.actor_token_path, &error_list_sts_service,
81 &sts_config_.actor_token_type, &error_list_sts_service,
83 return error_list_sts_service;
86 std::vector<grpc_error_handle>
89 std::vector<grpc_error_handle> error_list_call_credentials;
92 &error_list_call_credentials)) {
93 std::vector<grpc_error_handle> error_list_sts_service =
94 ParseJsonObjectStsService(*sts_service);
95 if (!error_list_sts_service.empty()) {
97 "field:sts_service", &error_list_sts_service));
100 return error_list_call_credentials;
103 std::vector<grpc_error_handle>
106 std::vector<grpc_error_handle> error_list_google_grpc;
108 &error_list_google_grpc,
false)) {
111 const Json::Array* call_credentials_array =
nullptr;
113 &call_credentials_array, &error_list_google_grpc)) {
114 if (call_credentials_array->size() != 1) {
116 "field:call_credentials error:Need exactly one entry."));
119 if (
ExtractJsonType((*call_credentials_array)[0],
"call_credentials[0]",
120 &call_credentials, &error_list_google_grpc)) {
121 std::vector<grpc_error_handle> error_list_call_credentials =
122 ParseJsonObjectCallCredentials(*call_credentials);
123 if (!error_list_call_credentials.empty()) {
125 "field:call_credentials", &error_list_call_credentials));
131 return error_list_google_grpc;
134 std::vector<grpc_error_handle>
137 std::vector<grpc_error_handle> error_list_grpc_services;
140 &error_list_grpc_services)) {
141 std::vector<grpc_error_handle> error_list_google_grpc =
142 ParseJsonObjectGoogleGrpc(*google_grpc);
143 if (!error_list_google_grpc.empty()) {
145 "field:google_grpc", &error_list_google_grpc));
149 &error_list_grpc_services,
false)) {
152 return error_list_grpc_services;
155 std::vector<grpc_error_handle>
158 std::vector<grpc_error_handle> error_list_server;
164 "field:api_type error:Only GRPC is supported"));
169 &error_list_server)) {
170 if (grpc_services->size() != 1) {
172 "field:grpc_services error:Need exactly one entry"));
176 &grpc_service, &error_list_server)) {
177 std::vector<grpc_error_handle> error_list_grpc_services =
178 ParseJsonObjectGrpcServices(*grpc_service);
179 if (!error_list_grpc_services.empty()) {
181 "field:grpc_services", &error_list_grpc_services));
186 return error_list_server;
193 MakeRefCounted<GoogleMeshCaCertificateProviderFactory::Config>();
196 "error:config type should be OBJECT.");
199 std::vector<grpc_error_handle> error_list;
203 std::vector<grpc_error_handle> error_list_server =
205 if (!error_list_server.empty()) {
206 error_list.push_back(
212 &
config->certificate_lifetime_, &error_list,
false)) {
217 &
config->renewal_grace_period_, &error_list,
false)) {
222 &error_list,
false)) {
225 "field:key_type error:Only RSA is supported."));
229 &
config->key_size_, &error_list,
false)) {
233 &
config->location_, &error_list,
false)) {
236 if (!error_list.empty()) {
238 "Error parsing google Mesh CA config", &error_list);
249 return kMeshCaPlugin;