resources.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.secrets.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option cc_enable_arenas = true;
  20. option csharp_namespace = "Google.Cloud.SecretManager.V1Beta1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/secretmanager/v1beta1;secretmanager";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ResourcesProto";
  24. option java_package = "com.google.cloud.secretmanager.v1beta1";
  25. option objc_class_prefix = "GSM";
  26. option php_namespace = "Google\\Cloud\\SecretManager\\V1beta1";
  27. option ruby_package = "Google::Cloud::SecretManager::V1beta1";
  28. // A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
  29. // be accessed.
  30. //
  31. // A [Secret][google.cloud.secrets.v1beta1.Secret] is made up of zero or more [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] that
  32. // represent the secret data.
  33. message Secret {
  34. option (google.api.resource) = {
  35. type: "secretmanager.googleapis.com/Secret"
  36. pattern: "projects/{project}/secrets/{secret}"
  37. };
  38. // Output only. The resource name of the [Secret][google.cloud.secrets.v1beta1.Secret] in the format `projects/*/secrets/*`.
  39. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  40. // Required. Immutable. The replication policy of the secret data attached to the [Secret][google.cloud.secrets.v1beta1.Secret].
  41. //
  42. // The replication policy cannot be changed after the Secret has been created.
  43. Replication replication = 2 [
  44. (google.api.field_behavior) = IMMUTABLE,
  45. (google.api.field_behavior) = REQUIRED
  46. ];
  47. // Output only. The time at which the [Secret][google.cloud.secrets.v1beta1.Secret] was created.
  48. google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  49. // The labels assigned to this Secret.
  50. //
  51. // Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
  52. // of maximum 128 bytes, and must conform to the following PCRE regular
  53. // expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
  54. //
  55. // Label values must be between 0 and 63 characters long, have a UTF-8
  56. // encoding of maximum 128 bytes, and must conform to the following PCRE
  57. // regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
  58. //
  59. // No more than 64 labels can be assigned to a given resource.
  60. map<string, string> labels = 4;
  61. }
  62. // A secret version resource in the Secret Manager API.
  63. message SecretVersion {
  64. option (google.api.resource) = {
  65. type: "secretmanager.googleapis.com/SecretVersion"
  66. pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}"
  67. };
  68. // The state of a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion], indicating if it can be accessed.
  69. enum State {
  70. // Not specified. This value is unused and invalid.
  71. STATE_UNSPECIFIED = 0;
  72. // The [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] may be accessed.
  73. ENABLED = 1;
  74. // The [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] may not be accessed, but the secret data
  75. // is still available and can be placed back into the [ENABLED][google.cloud.secrets.v1beta1.SecretVersion.State.ENABLED]
  76. // state.
  77. DISABLED = 2;
  78. // The [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] is destroyed and the secret data is no longer
  79. // stored. A version may not leave this state once entered.
  80. DESTROYED = 3;
  81. }
  82. // Output only. The resource name of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] in the
  83. // format `projects/*/secrets/*/versions/*`.
  84. //
  85. // [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] IDs in a [Secret][google.cloud.secrets.v1beta1.Secret] start at 1 and
  86. // are incremented for each subsequent version of the secret.
  87. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  88. // Output only. The time at which the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] was created.
  89. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  90. // Output only. The time this [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] was destroyed.
  91. // Only present if [state][google.cloud.secrets.v1beta1.SecretVersion.state] is
  92. // [DESTROYED][google.cloud.secrets.v1beta1.SecretVersion.State.DESTROYED].
  93. google.protobuf.Timestamp destroy_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  94. // Output only. The current state of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].
  95. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  96. }
  97. // A policy that defines the replication configuration of data.
  98. message Replication {
  99. // A replication policy that replicates the [Secret][google.cloud.secrets.v1beta1.Secret] payload without any
  100. // restrictions.
  101. message Automatic {
  102. }
  103. // A replication policy that replicates the [Secret][google.cloud.secrets.v1beta1.Secret] payload into the
  104. // locations specified in [Secret.replication.user_managed.replicas][]
  105. message UserManaged {
  106. // Represents a Replica for this [Secret][google.cloud.secrets.v1beta1.Secret].
  107. message Replica {
  108. // The canonical IDs of the location to replicate data.
  109. // For example: `"us-east1"`.
  110. string location = 1;
  111. }
  112. // Required. The list of Replicas for this [Secret][google.cloud.secrets.v1beta1.Secret].
  113. //
  114. // Cannot be empty.
  115. repeated Replica replicas = 1 [(google.api.field_behavior) = REQUIRED];
  116. }
  117. // The replication policy for this secret.
  118. oneof replication {
  119. // The [Secret][google.cloud.secrets.v1beta1.Secret] will automatically be replicated without any restrictions.
  120. Automatic automatic = 1;
  121. // The [Secret][google.cloud.secrets.v1beta1.Secret] will only be replicated into the locations specified.
  122. UserManaged user_managed = 2;
  123. }
  124. }
  125. // A secret payload resource in the Secret Manager API. This contains the
  126. // sensitive secret data that is associated with a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].
  127. message SecretPayload {
  128. // The secret data. Must be no larger than 64KiB.
  129. bytes data = 1;
  130. }