Skip to content

Commit

Permalink
feat: Added support for accessing secret versions by alias
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Apr 5, 2022
1 parent 7289e58 commit 5102b66
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public void CreateSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -93,6 +100,13 @@ public void CreateSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -130,6 +144,13 @@ public void CreateSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -165,6 +186,13 @@ public void CreateSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -202,6 +230,13 @@ public void CreateSecretResourceNames()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -237,6 +272,13 @@ public void CreateSecretResourceNames()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.CreateSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -434,6 +476,13 @@ public void GetSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -467,6 +516,13 @@ public void GetSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -502,6 +558,13 @@ public void GetSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -535,6 +598,13 @@ public void GetSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -570,6 +640,13 @@ public void GetSecretResourceNames()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -603,6 +680,13 @@ public void GetSecretResourceNames()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.GetSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -639,6 +723,13 @@ public void UpdateSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.UpdateSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -673,6 +764,13 @@ public void UpdateSecretRequestObject()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.UpdateSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -709,6 +807,13 @@ public void UpdateSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.UpdateSecret(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -743,6 +848,13 @@ public void UpdateSecret()
Ttl = new wkt::Duration(),
Etag = "etage8ad7218",
Rotation = new Rotation(),
VersionAliases =
{
{
"key8a0b6e3c",
-5833447338835614944L
},
},
};
mockGrpcClient.Setup(x => x.UpdateSecretAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Secret>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecretManagerServiceClient client = new SecretManagerServiceClientImpl(mockGrpcClient.Object, null);
Expand Down
Loading

0 comments on commit 5102b66

Please sign in to comment.