|
35 | 35 |
|
36 | 36 | import com.google.api.client.json.GenericJson;
|
37 | 37 | import com.google.api.client.json.JsonObjectParser;
|
| 38 | +import com.google.auth.RequestMetadataCallback; |
38 | 39 | import com.google.auth.http.HttpTransportFactory;
|
39 | 40 | import com.google.auth.oauth2.AwsCredentials.AwsCredentialSource;
|
40 | 41 | import com.google.auth.oauth2.IdentityPoolCredentials.IdentityPoolCredentialSource;
|
|
48 | 49 | import java.util.Collection;
|
49 | 50 | import java.util.List;
|
50 | 51 | import java.util.Map;
|
| 52 | +import java.util.concurrent.Executor; |
51 | 53 | import javax.annotation.Nullable;
|
52 | 54 |
|
53 | 55 | /**
|
@@ -208,6 +210,26 @@ private ImpersonatedCredentials initializeImpersonatedCredentials() {
|
208 | 210 | .build();
|
209 | 211 | }
|
210 | 212 |
|
| 213 | + @Override |
| 214 | + public void getRequestMetadata( |
| 215 | + URI uri, Executor executor, final RequestMetadataCallback callback) { |
| 216 | + super.getRequestMetadata( |
| 217 | + uri, |
| 218 | + executor, |
| 219 | + new RequestMetadataCallback() { |
| 220 | + @Override |
| 221 | + public void onSuccess(Map<String, List<String>> metadata) { |
| 222 | + metadata = addQuotaProjectIdToRequestMetadata(quotaProjectId, metadata); |
| 223 | + callback.onSuccess(metadata); |
| 224 | + } |
| 225 | + |
| 226 | + @Override |
| 227 | + public void onFailure(Throwable exception) { |
| 228 | + callback.onFailure(exception); |
| 229 | + } |
| 230 | + }); |
| 231 | + } |
| 232 | + |
211 | 233 | @Override
|
212 | 234 | public Map<String, List<String>> getRequestMetadata(URI uri) throws IOException {
|
213 | 235 | Map<String, List<String>> requestMetadata = super.getRequestMetadata(uri);
|
|
0 commit comments