Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
feat: Rotation for Secrets (#425)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/3f2047bd-228a-422e-b865-ff4ee3d54ec6/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 365574085
Source-Link: googleapis/googleapis@6c76936
  • Loading branch information
yoshi-automation authored Mar 30, 2021
1 parent a2f27df commit 0d2e4b4
Show file tree
Hide file tree
Showing 8 changed files with 1,706 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public void createSecretTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllTopics(new ArrayList<Topic>())
.setRotation(Rotation.newBuilder().build())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -237,6 +238,7 @@ public void createSecretTest2() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllTopics(new ArrayList<Topic>())
.setRotation(Rotation.newBuilder().build())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -373,6 +375,7 @@ public void getSecretTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllTopics(new ArrayList<Topic>())
.setRotation(Rotation.newBuilder().build())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -415,6 +418,7 @@ public void getSecretTest2() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllTopics(new ArrayList<Topic>())
.setRotation(Rotation.newBuilder().build())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down Expand Up @@ -457,6 +461,7 @@ public void updateSecretTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllTopics(new ArrayList<Topic>())
.setRotation(Rotation.newBuilder().build())
.build();
mockSecretManagerService.addResponse(expectedResponse);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
internal_static_google_cloud_secretmanager_v1_Topic_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_secretmanager_v1_Topic_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_secretmanager_v1_Rotation_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_secretmanager_v1_Rotation_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
Expand All @@ -101,7 +105,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "google/api/field_behavior.proto\032\031google/"
+ "api/resource.proto\032\036google/protobuf/dura"
+ "tion.proto\032\037google/protobuf/timestamp.pr"
+ "oto\032\034google/api/annotations.proto\"\213\004\n\006Se"
+ "oto\032\034google/api/annotations.proto\"\313\004\n\006Se"
+ "cret\022\021\n\004name\030\001 \001(\tB\003\340A\003\022G\n\013replication\030\002"
+ " \001(\0132*.google.cloud.secretmanager.v1.Rep"
+ "licationB\006\340A\005\340A\002\0224\n\013create_time\030\003 \001(\0132\032."
Expand All @@ -111,64 +115,69 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "le.cloud.secretmanager.v1.TopicB\003\340A\001\0226\n\013"
+ "expire_time\030\006 \001(\0132\032.google.protobuf.Time"
+ "stampB\003\340A\001H\000\022-\n\003ttl\030\007 \001(\0132\031.google.proto"
+ "buf.DurationB\003\340A\004H\000\032-\n\013LabelsEntry\022\013\n\003ke"
+ "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:M\352AJ\n#secretm"
+ "anager.googleapis.com/Secret\022#projects/{"
+ "project}/secrets/{secret}B\014\n\nexpiration\""
+ "\337\003\n\rSecretVersion\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013"
+ "create_time\030\002 \001(\0132\032.google.protobuf.Time"
+ "stampB\003\340A\003\0225\n\014destroy_time\030\003 \001(\0132\032.googl"
+ "e.protobuf.TimestampB\003\340A\003\022F\n\005state\030\004 \001(\016"
+ "22.google.cloud.secretmanager.v1.SecretV"
+ "ersion.StateB\003\340A\003\022L\n\022replication_status\030"
+ "\005 \001(\01320.google.cloud.secretmanager.v1.Re"
+ "plicationStatus\"H\n\005State\022\025\n\021STATE_UNSPEC"
+ "IFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DISABLED\020\002\022\r\n\tDE"
+ "STROYED\020\003:n\352Ak\n*secretmanager.googleapis"
+ ".com/SecretVersion\022=projects/{project}/s"
+ "ecrets/{secret}/versions/{secret_version"
+ "}\"\220\004\n\013Replication\022I\n\tautomatic\030\001 \001(\01324.g"
+ "oogle.cloud.secretmanager.v1.Replication"
+ ".AutomaticH\000\022N\n\014user_managed\030\002 \001(\01326.goo"
+ "gle.cloud.secretmanager.v1.Replication.U"
+ "serManagedH\000\032o\n\tAutomatic\022b\n\033customer_ma"
+ "naged_encryption\030\001 \001(\01328.google.cloud.se"
+ "cretmanager.v1.CustomerManagedEncryption"
+ "B\003\340A\001\032\345\001\n\013UserManaged\022U\n\010replicas\030\001 \003(\0132"
+ ">.google.cloud.secretmanager.v1.Replicat"
+ "ion.UserManaged.ReplicaB\003\340A\002\032\177\n\007Replica\022"
+ "\020\n\010location\030\001 \001(\t\022b\n\033customer_managed_en"
+ "cryption\030\002 \001(\01328.google.cloud.secretmana"
+ "ger.v1.CustomerManagedEncryptionB\003\340A\001B\r\n"
+ "\013replication\"6\n\031CustomerManagedEncryptio"
+ "n\022\031\n\014kms_key_name\030\001 \001(\tB\003\340A\002\"\353\004\n\021Replica"
+ "tionStatus\022U\n\tautomatic\030\001 \001(\0132@.google.c"
+ "loud.secretmanager.v1.ReplicationStatus."
+ "AutomaticStatusH\000\022Z\n\014user_managed\030\002 \001(\0132"
+ "B.google.cloud.secretmanager.v1.Replicat"
+ "ionStatus.UserManagedStatusH\000\032{\n\017Automat"
+ "icStatus\022h\n\033customer_managed_encryption\030"
+ "\001 \001(\0132>.google.cloud.secretmanager.v1.Cu"
+ "stomerManagedEncryptionStatusB\003\340A\003\032\217\002\n\021U"
+ "serManagedStatus\022g\n\010replicas\030\001 \003(\0132P.goo"
+ "gle.cloud.secretmanager.v1.ReplicationSt"
+ "atus.UserManagedStatus.ReplicaStatusB\003\340A"
+ "\003\032\220\001\n\rReplicaStatus\022\025\n\010location\030\001 \001(\tB\003\340"
+ "A\003\022h\n\033customer_managed_encryption\030\002 \001(\0132"
+ ">.google.cloud.secretmanager.v1.Customer"
+ "ManagedEncryptionStatusB\003\340A\003B\024\n\022replicat"
+ "ion_status\"D\n\037CustomerManagedEncryptionS"
+ "tatus\022!\n\024kms_key_version_name\030\001 \001(\tB\003\340A\002"
+ "\"_\n\005Topic\022\021\n\004name\030\001 \001(\tB\003\340A\002:C\352A@\n\033pubsu"
+ "b.googleapis.com/Topic\022!projects/{projec"
+ "t}/topics/{topic}\"\035\n\rSecretPayload\022\014\n\004da"
+ "ta\030\001 \001(\014B\355\001\n!com.google.cloud.secretmana"
+ "ger.v1B\016ResourcesProtoP\001ZJgoogle.golang."
+ "org/genproto/googleapis/cloud/secretmana"
+ "ger/v1;secretmanager\370\001\001\242\002\003GSM\252\002\035Google.C"
+ "loud.SecretManager.V1\312\002\035Google\\Cloud\\Sec"
+ "retManager\\V1\352\002 Google::Cloud::SecretMan"
+ "ager::V1b\006proto3"
+ "buf.DurationB\003\340A\004H\000\022>\n\010rotation\030\t \001(\0132\'."
+ "google.cloud.secretmanager.v1.RotationB\003"
+ "\340A\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value"
+ "\030\002 \001(\t:\0028\001:M\352AJ\n#secretmanager.googleapi"
+ "s.com/Secret\022#projects/{project}/secrets"
+ "/{secret}B\014\n\nexpiration\"\337\003\n\rSecretVersio"
+ "n\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013create_time\030\002 \001("
+ "\0132\032.google.protobuf.TimestampB\003\340A\003\0225\n\014de"
+ "stroy_time\030\003 \001(\0132\032.google.protobuf.Times"
+ "tampB\003\340A\003\022F\n\005state\030\004 \001(\01622.google.cloud."
+ "secretmanager.v1.SecretVersion.StateB\003\340A"
+ "\003\022L\n\022replication_status\030\005 \001(\01320.google.c"
+ "loud.secretmanager.v1.ReplicationStatus\""
+ "H\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABL"
+ "ED\020\001\022\014\n\010DISABLED\020\002\022\r\n\tDESTROYED\020\003:n\352Ak\n*"
+ "secretmanager.googleapis.com/SecretVersi"
+ "on\022=projects/{project}/secrets/{secret}/"
+ "versions/{secret_version}\"\220\004\n\013Replicatio"
+ "n\022I\n\tautomatic\030\001 \001(\01324.google.cloud.secr"
+ "etmanager.v1.Replication.AutomaticH\000\022N\n\014"
+ "user_managed\030\002 \001(\01326.google.cloud.secret"
+ "manager.v1.Replication.UserManagedH\000\032o\n\t"
+ "Automatic\022b\n\033customer_managed_encryption"
+ "\030\001 \001(\01328.google.cloud.secretmanager.v1.C"
+ "ustomerManagedEncryptionB\003\340A\001\032\345\001\n\013UserMa"
+ "naged\022U\n\010replicas\030\001 \003(\0132>.google.cloud.s"
+ "ecretmanager.v1.Replication.UserManaged."
+ "ReplicaB\003\340A\002\032\177\n\007Replica\022\020\n\010location\030\001 \001("
+ "\t\022b\n\033customer_managed_encryption\030\002 \001(\01328"
+ ".google.cloud.secretmanager.v1.CustomerM"
+ "anagedEncryptionB\003\340A\001B\r\n\013replication\"6\n\031"
+ "CustomerManagedEncryption\022\031\n\014kms_key_nam"
+ "e\030\001 \001(\tB\003\340A\002\"\353\004\n\021ReplicationStatus\022U\n\tau"
+ "tomatic\030\001 \001(\0132@.google.cloud.secretmanag"
+ "er.v1.ReplicationStatus.AutomaticStatusH"
+ "\000\022Z\n\014user_managed\030\002 \001(\0132B.google.cloud.s"
+ "ecretmanager.v1.ReplicationStatus.UserMa"
+ "nagedStatusH\000\032{\n\017AutomaticStatus\022h\n\033cust"
+ "omer_managed_encryption\030\001 \001(\0132>.google.c"
+ "loud.secretmanager.v1.CustomerManagedEnc"
+ "ryptionStatusB\003\340A\003\032\217\002\n\021UserManagedStatus"
+ "\022g\n\010replicas\030\001 \003(\0132P.google.cloud.secret"
+ "manager.v1.ReplicationStatus.UserManaged"
+ "Status.ReplicaStatusB\003\340A\003\032\220\001\n\rReplicaSta"
+ "tus\022\025\n\010location\030\001 \001(\tB\003\340A\003\022h\n\033customer_m"
+ "anaged_encryption\030\002 \001(\0132>.google.cloud.s"
+ "ecretmanager.v1.CustomerManagedEncryptio"
+ "nStatusB\003\340A\003B\024\n\022replication_status\"D\n\037Cu"
+ "stomerManagedEncryptionStatus\022!\n\024kms_key"
+ "_version_name\030\001 \001(\tB\003\340A\002\"_\n\005Topic\022\021\n\004nam"
+ "e\030\001 \001(\tB\003\340A\002:C\352A@\n\033pubsub.googleapis.com"
+ "/Topic\022!projects/{project}/topics/{topic"
+ "}\"\200\001\n\010Rotation\022;\n\022next_rotation_time\030\001 \001"
+ "(\0132\032.google.protobuf.TimestampB\003\340A\001\0227\n\017r"
+ "otation_period\030\002 \001(\0132\031.google.protobuf.D"
+ "urationB\003\340A\004\"\035\n\rSecretPayload\022\014\n\004data\030\001 "
+ "\001(\014B\355\001\n!com.google.cloud.secretmanager.v"
+ "1B\016ResourcesProtoP\001ZJgoogle.golang.org/g"
+ "enproto/googleapis/cloud/secretmanager/v"
+ "1;secretmanager\370\001\001\242\002\003GSM\252\002\035Google.Cloud."
+ "SecretManager.V1\312\002\035Google\\Cloud\\SecretMa"
+ "nager\\V1\352\002 Google::Cloud::SecretManager:"
+ ":V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand All @@ -193,6 +202,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"Topics",
"ExpireTime",
"Ttl",
"Rotation",
"Expiration",
});
internal_static_google_cloud_secretmanager_v1_Secret_LabelsEntry_descriptor =
Expand Down Expand Up @@ -311,8 +321,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new java.lang.String[] {
"Name",
});
internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor =
internal_static_google_cloud_secretmanager_v1_Rotation_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_google_cloud_secretmanager_v1_Rotation_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_secretmanager_v1_Rotation_descriptor,
new java.lang.String[] {
"NextRotationTime", "RotationPeriod",
});
internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_google_cloud_secretmanager_v1_SecretPayload_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor,
Expand Down
Loading

0 comments on commit 0d2e4b4

Please sign in to comment.