Skip to content

Commit

Permalink
feat: Checksums in Secret Manager
Browse files Browse the repository at this point in the history
Users can now use checksums for data integrity assurance when adding and
accessing SecretVersions.

PiperOrigin-RevId: 425369494

Source-Link: googleapis/googleapis@70d389c

Source-Link: googleapis/googleapis-gen@cf92905
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU2VjcmV0TWFuYWdlci5WMS8uT3dsQm90LnlhbWwiLCJoIjoiY2Y5MjkwNTY4Mjg0ZDJmMDk5YjlhMDBjYzgyYTJhMTMzYmU2ZGZkYSJ9
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Feb 1, 2022
1 parent af7ce3b commit 58ebe8d
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public void AddSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -289,6 +290,7 @@ public void AddSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -316,6 +318,7 @@ public void AddSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -341,6 +344,7 @@ public void AddSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -368,6 +372,7 @@ public void AddSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -393,6 +398,7 @@ public void AddSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.AddSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -858,6 +864,7 @@ public void GetSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -882,6 +889,7 @@ public void GetSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -908,6 +916,7 @@ public void GetSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -932,6 +941,7 @@ public void GetSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -958,6 +968,7 @@ public void GetSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -982,6 +993,7 @@ public void GetSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.GetSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1135,6 +1147,7 @@ public void DisableSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1160,6 +1173,7 @@ public void DisableSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1186,6 +1200,7 @@ public void DisableSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1210,6 +1225,7 @@ public void DisableSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1236,6 +1252,7 @@ public void DisableSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1260,6 +1277,7 @@ public void DisableSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DisableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1287,6 +1305,7 @@ public void EnableSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1312,6 +1331,7 @@ public void EnableSecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1338,6 +1358,7 @@ public void EnableSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1362,6 +1383,7 @@ public void EnableSecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1388,6 +1410,7 @@ public void EnableSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1412,6 +1435,7 @@ public void EnableSecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.EnableSecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -1439,6 +1463,7 @@ public void DestroySecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1464,6 +1489,7 @@ public void DestroySecretVersionRequestObject()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1490,6 +1516,7 @@ public void DestroySecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1514,6 +1541,7 @@ public void DestroySecretVersion()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1540,6 +1568,7 @@ public void DestroySecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersion(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand All @@ -1564,6 +1593,7 @@ public void DestroySecretVersionResourceNames()
State = SecretVersion.Types.State.Disabled,
ReplicationStatus = new ReplicationStatus(),
Etag = "etage8ad7218",
ClientSpecifiedPayloadChecksum = false,
};
mockGrpcClient.Setup(x => x.DestroySecretVersionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecretVersion>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down
Loading

0 comments on commit 58ebe8d

Please sign in to comment.