23 #include "absl/strings/string_view.h"
34 RefCountedPtr<FileExternalAccountCredentials>
36 std::vector<std::string> scopes,
38 auto creds = MakeRefCounted<FileExternalAccountCredentials>(
50 auto it =
options.credential_source.object_value().find(
"file");
51 if (
it ==
options.credential_source.object_value().end()) {
60 file_ =
it->second.string_value();
61 it =
options.credential_source.object_value().find(
"format");
62 if (
it !=
options.credential_source.object_value().end()) {
63 const Json& format_json =
it->second;
66 "The JSON value of credential source format is not an object.");
69 auto format_it = format_json.
object_value().find(
"type");
72 "format.type field not present.");
77 "format.type field must be a string.");
82 format_it = format_json.
object_value().find(
"subject_token_field_name");
85 "format.subject_token_field_name field must be present if the "
86 "format is in Json.");
91 "format.subject_token_field_name field must be a string.");
102 struct SliceWrapper {
106 SliceWrapper content_slice;
121 "The content of the file is not a valid json object."));
129 "Subject token field not present."));
134 "Subject token field must be a string."));