Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove server unimplemented GrpcStorageImpl#getServiceAccount #2718

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static com.google.cloud.storage.StorageV2ProtoUtils.objectAclEntityOrAltEq;
import static com.google.cloud.storage.Utils.bucketNameCodec;
import static com.google.cloud.storage.Utils.ifNonNull;
import static com.google.cloud.storage.Utils.projectNameCodec;
import static com.google.common.base.MoreObjects.firstNonNull;
import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -90,7 +89,6 @@
import com.google.storage.v2.GetBucketRequest;
import com.google.storage.v2.GetNotificationConfigRequest;
import com.google.storage.v2.GetObjectRequest;
import com.google.storage.v2.GetServiceAccountRequest;
import com.google.storage.v2.ListBucketsRequest;
import com.google.storage.v2.ListNotificationConfigsRequest;
import com.google.storage.v2.ListNotificationConfigsResponse;
Expand Down Expand Up @@ -1390,16 +1388,7 @@ public List<Boolean> testIamPermissions(

@Override
public ServiceAccount getServiceAccount(String projectId) {
GetServiceAccountRequest req =
GetServiceAccountRequest.newBuilder()
.setProject(projectNameCodec.encode(projectId))
.build();
GrpcCallContext retryContext = Retrying.newCallContext();
return Retrying.run(
getOptions(),
retryAlgorithmManager.getFor(req),
() -> storageClient.getServiceAccountCallable().call(req, retryContext),
codecs.serviceAccount());
return CrossTransportUtils.throwHttpJsonOnly(Storage.class, "getServiceAccount");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4781,7 +4781,7 @@ List<Boolean> testIamPermissions(
* @return the service account associated with this project
* @throws StorageException upon failure
*/
@TransportCompatibility({Transport.HTTP, Transport.GRPC})
@TransportCompatibility({Transport.HTTP})
ServiceAccount getServiceAccount(String projectId);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@ static final class ServiceAccount {
private static void get(ArrayList<RpcMethodMapping> a) {
a.add(
RpcMethodMapping.newBuilder(59, serviceaccount.get)
.withApplicable(TestRetryConformance.transportIs(Transport.HTTP))
.withTest(
(ctx, c) ->
ctx.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(StorageITRunner.class)
@CrossRun(
backends = {Backend.PROD},
transports = {Transport.HTTP, Transport.GRPC})
transports = {Transport.HTTP})
public class ITServiceAccountTest {

private static final String SERVICE_ACCOUNT_EMAIL_SUFFIX =
Expand Down
Loading