@google-cloud/apikeys 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
1
+ // Copyright 2022 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.api.apikeys.v2;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+
23
+ option csharp_namespace = "Google.Cloud.ApiKeys.V2";
24
+ option go_package = "google.golang.org/genproto/googleapis/api/apikeys/v2;apikeys";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "ResourcesProto";
27
+ option java_package = "com.google.api.apikeys.v2";
28
+ option php_namespace = "Google\\Cloud\\ApiKeys\\V2";
29
+ option ruby_package = "Google::Cloud::ApiKeys::V2";
30
+
31
+ // The representation of a key managed by the API Keys API.
32
+ message Key {
33
+ option (google.api.resource) = {
34
+ type: "apikeys.googleapis.com/Key"
35
+ pattern: "projects/{project}/locations/{location}/keys/{key}"
36
+ plural: "keys"
37
+ singular: "key"
38
+ style: DECLARATIVE_FRIENDLY
39
+ };
40
+
41
+ // Output only. The resource name of the key.
42
+ // The `name` has the form:
43
+ // `projects/<PROJECT_NUMBER>/locations/global/keys/<KEY_ID>`.
44
+ // For example:
45
+ // `projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2`
46
+ //
47
+ // NOTE: Key is a global resource; hence the only supported value for
48
+ // location is `global`.
49
+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
50
+
51
+ // Output only. Unique id in UUID4 format.
52
+ string uid = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
53
+
54
+ // Human-readable display name of this key that you can modify.
55
+ // The maximum length is 63 characters.
56
+ string display_name = 2;
57
+
58
+ // Output only. An encrypted and signed value held by this key.
59
+ // This field can be accessed only through the `GetKeyString` method.
60
+ string key_string = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
61
+
62
+ // Output only. A timestamp identifying the time this key was originally
63
+ // created.
64
+ google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
65
+
66
+ // Output only. A timestamp identifying the time this key was last
67
+ // updated.
68
+ google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
69
+
70
+ // Output only. A timestamp when this key was deleted. If the resource is not deleted,
71
+ // this must be empty.
72
+ google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
73
+
74
+ // Annotations is an unstructured key-value map stored with a policy that
75
+ // may be set by external tools to store and retrieve arbitrary metadata.
76
+ // They are not queryable and should be preserved when modifying objects.
77
+ map<string, string> annotations = 8;
78
+
79
+ // Key restrictions.
80
+ Restrictions restrictions = 9;
81
+
82
+ // Output only. A checksum computed by the server based on the current value of the Key
83
+ // resource. This may be sent on update and delete requests to ensure the
84
+ // client has an up-to-date value before proceeding.
85
+ // See https://google.aip.dev/154.
86
+ string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
87
+ }
88
+
89
+ // Describes the restrictions on the key.
90
+ message Restrictions {
91
+ // The websites, IP addresses, Android apps, or iOS apps (the clients) that
92
+ // are allowed to use the key. You can specify only one type of client
93
+ // restrictions per key.
94
+ oneof client_restrictions {
95
+ // The HTTP referrers (websites) that are allowed to use the key.
96
+ BrowserKeyRestrictions browser_key_restrictions = 1;
97
+
98
+ // The IP addresses of callers that are allowed to use the key.
99
+ ServerKeyRestrictions server_key_restrictions = 2;
100
+
101
+ // The Android apps that are allowed to use the key.
102
+ AndroidKeyRestrictions android_key_restrictions = 3;
103
+
104
+ // The iOS apps that are allowed to use the key.
105
+ IosKeyRestrictions ios_key_restrictions = 4;
106
+ }
107
+
108
+ // A restriction for a specific service and optionally one or
109
+ // more specific methods. Requests are allowed if they
110
+ // match any of these restrictions. If no restrictions are
111
+ // specified, all targets are allowed.
112
+ repeated ApiTarget api_targets = 5;
113
+ }
114
+
115
+ // The HTTP referrers (websites) that are allowed to use the key.
116
+ message BrowserKeyRestrictions {
117
+ // A list of regular expressions for the referrer URLs that are allowed
118
+ // to make API calls with this key.
119
+ repeated string allowed_referrers = 1;
120
+ }
121
+
122
+ // The IP addresses of callers that are allowed to use the key.
123
+ message ServerKeyRestrictions {
124
+ // A list of the caller IP addresses that are allowed to make API calls
125
+ // with this key.
126
+ repeated string allowed_ips = 1;
127
+ }
128
+
129
+ // The Android apps that are allowed to use the key.
130
+ message AndroidKeyRestrictions {
131
+ // A list of Android applications that are allowed to make API calls with
132
+ // this key.
133
+ repeated AndroidApplication allowed_applications = 1;
134
+ }
135
+
136
+ // Identifier of an Android application for key use.
137
+ message AndroidApplication {
138
+ // The SHA1 fingerprint of the application. For example, both sha1 formats are
139
+ // acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or
140
+ // DA39A3EE5E6B4B0D3255BFEF95601890AFD80709.
141
+ // Output format is the latter.
142
+ string sha1_fingerprint = 1;
143
+
144
+ // The package name of the application.
145
+ string package_name = 2;
146
+ }
147
+
148
+ // The iOS apps that are allowed to use the key.
149
+ message IosKeyRestrictions {
150
+ // A list of bundle IDs that are allowed when making API calls with this key.
151
+ repeated string allowed_bundle_ids = 1;
152
+ }
153
+
154
+ // A restriction for a specific service and optionally one or multiple
155
+ // specific methods. Both fields are case insensitive.
156
+ message ApiTarget {
157
+ // The service for this restriction. It should be the canonical
158
+ // service name, for example: `translate.googleapis.com`.
159
+ // You can use [`gcloud services list`](/sdk/gcloud/reference/services/list)
160
+ // to get a list of services that are enabled in the project.
161
+ string service = 1;
162
+
163
+ // Optional. List of one or more methods that can be called.
164
+ // If empty, all methods for the service are allowed. A wildcard
165
+ // (*) can be used as the last symbol.
166
+ // Valid examples:
167
+ // `google.cloud.translate.v2.TranslateService.GetSupportedLanguage`
168
+ // `TranslateText`
169
+ // `Get*`
170
+ // `translate.googleapis.com.Get*`
171
+ repeated string methods = 2 [(google.api.field_behavior) = OPTIONAL];
172
+ }