Skip to content

Commit

Permalink
fix: remove server unimplemented GrpcStorageImpl#getServiceAccount (#…
Browse files Browse the repository at this point in the history
…2718)

Partial revert of 96b6330
  • Loading branch information
BenWhitehead committed Sep 23, 2024
1 parent 06f7292 commit 51076a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
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

0 comments on commit 51076a8

Please sign in to comment.