resources.proto 6.7 KB

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