Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 62c04b8

Browse files
feat: update all protos and pb2 files (#92)
* feat: update all protos and pb2 files * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 09e9ccd commit 62c04b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3881
-842
lines changed

google/api/annotations.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015, Google Inc.
1+
// Copyright 2015 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/api/auth.proto

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC.
1+
// Copyright 2015 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,18 +16,16 @@ syntax = "proto3";
1616

1717
package google.api;
1818

19-
import "google/api/annotations.proto";
20-
2119
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
2220
option java_multiple_files = true;
2321
option java_outer_classname = "AuthProto";
2422
option java_package = "com.google.api";
2523
option objc_class_prefix = "GAPI";
2624

27-
28-
// `Authentication` defines the authentication configuration for an API.
25+
// `Authentication` defines the authentication configuration for API methods
26+
// provided by an API service.
2927
//
30-
// Example for an API targeted for external use:
28+
// Example:
3129
//
3230
// name: calendar.googleapis.com
3331
// authentication:
@@ -39,6 +37,9 @@ option objc_class_prefix = "GAPI";
3937
// - selector: "*"
4038
// requirements:
4139
// provider_id: google_calendar_auth
40+
// - selector: google.calendar.Delegate
41+
// oauth:
42+
// canonical_scopes: https://www.googleapis.com/auth/calendar.read
4243
message Authentication {
4344
// A list of authentication rules that apply to individual API methods.
4445
//
@@ -68,14 +69,37 @@ message AuthenticationRule {
6869
OAuthRequirements oauth = 2;
6970

7071
// If true, the service accepts API keys without any other credential.
72+
// This flag only applies to HTTP and gRPC requests.
7173
bool allow_without_credential = 5;
7274

7375
// Requirements for additional authentication providers.
7476
repeated AuthRequirement requirements = 7;
7577
}
7678

77-
// Configuration for an anthentication provider, including support for
78-
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
79+
// Specifies a location to extract JWT from an API request.
80+
message JwtLocation {
81+
oneof in {
82+
// Specifies HTTP header name to extract JWT token.
83+
string header = 1;
84+
85+
// Specifies URL query parameter name to extract JWT token.
86+
string query = 2;
87+
}
88+
89+
// The value prefix. The value format is "value_prefix{token}"
90+
// Only applies to "in" header type. Must be empty for "in" query type.
91+
// If not empty, the header value has to match (case sensitive) this prefix.
92+
// If not matched, JWT will not be extracted. If matched, JWT will be
93+
// extracted after the prefix is removed.
94+
//
95+
// For example, for "Authorization: Bearer {JWT}",
96+
// value_prefix="Bearer " with a space at the end.
97+
string value_prefix = 3;
98+
}
99+
100+
// Configuration for an authentication provider, including support for
101+
// [JSON Web Token
102+
// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
79103
message AuthProvider {
80104
// The unique identifier of the auth provider. It will be referred to by
81105
// `AuthRequirement.provider_id`.
@@ -92,34 +116,60 @@ message AuthProvider {
92116
string issuer = 2;
93117

94118
// URL of the provider's public key set to validate signature of the JWT. See
95-
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
119+
// [OpenID
120+
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
96121
// Optional if the key set document:
97122
// - can be retrieved from
98-
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
123+
// [OpenID
124+
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)
99125
// of the issuer.
100-
// - can be inferred from the email domain of the issuer (e.g. a Google service account).
126+
// - can be inferred from the email domain of the issuer (e.g. a Google
127+
// service account).
101128
//
102129
// Example: https://www.googleapis.com/oauth2/v1/certs
103130
string jwks_uri = 3;
104131

105132
// The list of JWT
106133
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
107134
// that are allowed to access. A JWT containing any of these audiences will
108-
// be accepted. When this setting is absent, only JWTs with audience
109-
// "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
110-
// will be accepted. For example, if no audiences are in the setting,
111-
// LibraryService API will only accept JWTs with the following audience
112-
// "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
135+
// be accepted. When this setting is absent, JWTs with audiences:
136+
// - "https://[service.name]/[google.protobuf.Api.name]"
137+
// - "https://[service.name]/"
138+
// will be accepted.
139+
// For example, if no audiences are in the setting, LibraryService API will
140+
// accept JWTs with the following audiences:
141+
// -
142+
// https://library-example.googleapis.com/google.example.library.v1.LibraryService
143+
// - https://library-example.googleapis.com/
113144
//
114145
// Example:
115146
//
116147
// audiences: bookstore_android.apps.googleusercontent.com,
117148
// bookstore_web.apps.googleusercontent.com
118149
string audiences = 4;
119150

120-
// Redirect URL if JWT token is required but no present or is expired.
151+
// Redirect URL if JWT token is required but not present or is expired.
121152
// Implement authorizationUrl of securityDefinitions in OpenAPI spec.
122153
string authorization_url = 5;
154+
155+
// Defines the locations to extract the JWT.
156+
//
157+
// JWT locations can be either from HTTP headers or URL query parameters.
158+
// The rule is that the first match wins. The checking order is: checking
159+
// all headers first, then URL query parameters.
160+
//
161+
// If not specified, default to use following 3 locations:
162+
// 1) Authorization: Bearer
163+
// 2) x-goog-iap-jwt-assertion
164+
// 3) access_token query parameter
165+
//
166+
// Default locations can be specified as followings:
167+
// jwt_locations:
168+
// - header: Authorization
169+
// value_prefix: "Bearer "
170+
// - header: x-goog-iap-jwt-assertion
171+
// - query: access_token
172+
repeated JwtLocation jwt_locations = 6;
123173
}
124174

125175
// OAuth scopes are a way to define data and permissions on data. For example,
@@ -152,7 +202,8 @@ message OAuthRequirements {
152202
}
153203

154204
// User-defined authentication requirements, including support for
155-
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
205+
// [JSON Web Token
206+
// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
156207
message AuthRequirement {
157208
// [id][google.api.AuthProvider.id] from authentication provider.
158209
//

google/api/auth_pb2.py

Lines changed: 139 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@
2727
_sym_db = _symbol_database.Default()
2828

2929

30-
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
31-
32-
3330
DESCRIPTOR = _descriptor.FileDescriptor(
3431
name="google/api/auth.proto",
3532
package="google.api",
3633
syntax="proto3",
3734
serialized_options=b"\n\016com.google.apiB\tAuthProtoP\001ZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig\242\002\004GAPI",
3835
create_key=_descriptor._internal_create_key,
39-
serialized_pb=b'\n\x15google/api/auth.proto\x12\ngoogle.api\x1a\x1cgoogle/api/annotations.proto"l\n\x0e\x41uthentication\x12-\n\x05rules\x18\x03 \x03(\x0b\x32\x1e.google.api.AuthenticationRule\x12+\n\tproviders\x18\x04 \x03(\x0b\x32\x18.google.api.AuthProvider"\xa9\x01\n\x12\x41uthenticationRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12,\n\x05oauth\x18\x02 \x01(\x0b\x32\x1d.google.api.OAuthRequirements\x12 \n\x18\x61llow_without_credential\x18\x05 \x01(\x08\x12\x31\n\x0crequirements\x18\x07 \x03(\x0b\x32\x1b.google.api.AuthRequirement"j\n\x0c\x41uthProvider\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06issuer\x18\x02 \x01(\t\x12\x10\n\x08jwks_uri\x18\x03 \x01(\t\x12\x11\n\taudiences\x18\x04 \x01(\t\x12\x19\n\x11\x61uthorization_url\x18\x05 \x01(\t"-\n\x11OAuthRequirements\x12\x18\n\x10\x63\x61nonical_scopes\x18\x01 \x01(\t"9\n\x0f\x41uthRequirement\x12\x13\n\x0bprovider_id\x18\x01 \x01(\t\x12\x11\n\taudiences\x18\x02 \x01(\tBk\n\x0e\x63om.google.apiB\tAuthProtoP\x01ZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig\xa2\x02\x04GAPIb\x06proto3',
40-
dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR],
36+
serialized_pb=b'\n\x15google/api/auth.proto\x12\ngoogle.api"l\n\x0e\x41uthentication\x12-\n\x05rules\x18\x03 \x03(\x0b\x32\x1e.google.api.AuthenticationRule\x12+\n\tproviders\x18\x04 \x03(\x0b\x32\x18.google.api.AuthProvider"\xa9\x01\n\x12\x41uthenticationRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12,\n\x05oauth\x18\x02 \x01(\x0b\x32\x1d.google.api.OAuthRequirements\x12 \n\x18\x61llow_without_credential\x18\x05 \x01(\x08\x12\x31\n\x0crequirements\x18\x07 \x03(\x0b\x32\x1b.google.api.AuthRequirement"L\n\x0bJwtLocation\x12\x10\n\x06header\x18\x01 \x01(\tH\x00\x12\x0f\n\x05query\x18\x02 \x01(\tH\x00\x12\x14\n\x0cvalue_prefix\x18\x03 \x01(\tB\x04\n\x02in"\x9a\x01\n\x0c\x41uthProvider\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06issuer\x18\x02 \x01(\t\x12\x10\n\x08jwks_uri\x18\x03 \x01(\t\x12\x11\n\taudiences\x18\x04 \x01(\t\x12\x19\n\x11\x61uthorization_url\x18\x05 \x01(\t\x12.\n\rjwt_locations\x18\x06 \x03(\x0b\x32\x17.google.api.JwtLocation"-\n\x11OAuthRequirements\x12\x18\n\x10\x63\x61nonical_scopes\x18\x01 \x01(\t"9\n\x0f\x41uthRequirement\x12\x13\n\x0bprovider_id\x18\x01 \x01(\t\x12\x11\n\taudiences\x18\x02 \x01(\tBk\n\x0e\x63om.google.apiB\tAuthProtoP\x01ZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig\xa2\x02\x04GAPIb\x06proto3',
4137
)
4238

4339

@@ -96,8 +92,8 @@
9692
syntax="proto3",
9793
extension_ranges=[],
9894
oneofs=[],
99-
serialized_start=67,
100-
serialized_end=175,
95+
serialized_start=37,
96+
serialized_end=145,
10197
)
10298

10399

@@ -194,8 +190,96 @@
194190
syntax="proto3",
195191
extension_ranges=[],
196192
oneofs=[],
197-
serialized_start=178,
198-
serialized_end=347,
193+
serialized_start=148,
194+
serialized_end=317,
195+
)
196+
197+
198+
_JWTLOCATION = _descriptor.Descriptor(
199+
name="JwtLocation",
200+
full_name="google.api.JwtLocation",
201+
filename=None,
202+
file=DESCRIPTOR,
203+
containing_type=None,
204+
create_key=_descriptor._internal_create_key,
205+
fields=[
206+
_descriptor.FieldDescriptor(
207+
name="header",
208+
full_name="google.api.JwtLocation.header",
209+
index=0,
210+
number=1,
211+
type=9,
212+
cpp_type=9,
213+
label=1,
214+
has_default_value=False,
215+
default_value=b"".decode("utf-8"),
216+
message_type=None,
217+
enum_type=None,
218+
containing_type=None,
219+
is_extension=False,
220+
extension_scope=None,
221+
serialized_options=None,
222+
file=DESCRIPTOR,
223+
create_key=_descriptor._internal_create_key,
224+
),
225+
_descriptor.FieldDescriptor(
226+
name="query",
227+
full_name="google.api.JwtLocation.query",
228+
index=1,
229+
number=2,
230+
type=9,
231+
cpp_type=9,
232+
label=1,
233+
has_default_value=False,
234+
default_value=b"".decode("utf-8"),
235+
message_type=None,
236+
enum_type=None,
237+
containing_type=None,
238+
is_extension=False,
239+
extension_scope=None,
240+
serialized_options=None,
241+
file=DESCRIPTOR,
242+
create_key=_descriptor._internal_create_key,
243+
),
244+
_descriptor.FieldDescriptor(
245+
name="value_prefix",
246+
full_name="google.api.JwtLocation.value_prefix",
247+
index=2,
248+
number=3,
249+
type=9,
250+
cpp_type=9,
251+
label=1,
252+
has_default_value=False,
253+
default_value=b"".decode("utf-8"),
254+
message_type=None,
255+
enum_type=None,
256+
containing_type=None,
257+
is_extension=False,
258+
extension_scope=None,
259+
serialized_options=None,
260+
file=DESCRIPTOR,
261+
create_key=_descriptor._internal_create_key,
262+
),
263+
],
264+
extensions=[],
265+
nested_types=[],
266+
enum_types=[],
267+
serialized_options=None,
268+
is_extendable=False,
269+
syntax="proto3",
270+
extension_ranges=[],
271+
oneofs=[
272+
_descriptor.OneofDescriptor(
273+
name="in",
274+
full_name="google.api.JwtLocation.in",
275+
index=0,
276+
containing_type=None,
277+
create_key=_descriptor._internal_create_key,
278+
fields=[],
279+
)
280+
],
281+
serialized_start=319,
282+
serialized_end=395,
199283
)
200284

201285

@@ -302,6 +386,25 @@
302386
file=DESCRIPTOR,
303387
create_key=_descriptor._internal_create_key,
304388
),
389+
_descriptor.FieldDescriptor(
390+
name="jwt_locations",
391+
full_name="google.api.AuthProvider.jwt_locations",
392+
index=5,
393+
number=6,
394+
type=11,
395+
cpp_type=10,
396+
label=3,
397+
has_default_value=False,
398+
default_value=[],
399+
message_type=None,
400+
enum_type=None,
401+
containing_type=None,
402+
is_extension=False,
403+
extension_scope=None,
404+
serialized_options=None,
405+
file=DESCRIPTOR,
406+
create_key=_descriptor._internal_create_key,
407+
),
305408
],
306409
extensions=[],
307410
nested_types=[],
@@ -311,8 +414,8 @@
311414
syntax="proto3",
312415
extension_ranges=[],
313416
oneofs=[],
314-
serialized_start=349,
315-
serialized_end=455,
417+
serialized_start=398,
418+
serialized_end=552,
316419
)
317420

318421

@@ -352,8 +455,8 @@
352455
syntax="proto3",
353456
extension_ranges=[],
354457
oneofs=[],
355-
serialized_start=457,
356-
serialized_end=502,
458+
serialized_start=554,
459+
serialized_end=599,
357460
)
358461

359462

@@ -412,16 +515,26 @@
412515
syntax="proto3",
413516
extension_ranges=[],
414517
oneofs=[],
415-
serialized_start=504,
416-
serialized_end=561,
518+
serialized_start=601,
519+
serialized_end=658,
417520
)
418521

419522
_AUTHENTICATION.fields_by_name["rules"].message_type = _AUTHENTICATIONRULE
420523
_AUTHENTICATION.fields_by_name["providers"].message_type = _AUTHPROVIDER
421524
_AUTHENTICATIONRULE.fields_by_name["oauth"].message_type = _OAUTHREQUIREMENTS
422525
_AUTHENTICATIONRULE.fields_by_name["requirements"].message_type = _AUTHREQUIREMENT
526+
_JWTLOCATION.oneofs_by_name["in"].fields.append(_JWTLOCATION.fields_by_name["header"])
527+
_JWTLOCATION.fields_by_name["header"].containing_oneof = _JWTLOCATION.oneofs_by_name[
528+
"in"
529+
]
530+
_JWTLOCATION.oneofs_by_name["in"].fields.append(_JWTLOCATION.fields_by_name["query"])
531+
_JWTLOCATION.fields_by_name["query"].containing_oneof = _JWTLOCATION.oneofs_by_name[
532+
"in"
533+
]
534+
_AUTHPROVIDER.fields_by_name["jwt_locations"].message_type = _JWTLOCATION
423535
DESCRIPTOR.message_types_by_name["Authentication"] = _AUTHENTICATION
424536
DESCRIPTOR.message_types_by_name["AuthenticationRule"] = _AUTHENTICATIONRULE
537+
DESCRIPTOR.message_types_by_name["JwtLocation"] = _JWTLOCATION
425538
DESCRIPTOR.message_types_by_name["AuthProvider"] = _AUTHPROVIDER
426539
DESCRIPTOR.message_types_by_name["OAuthRequirements"] = _OAUTHREQUIREMENTS
427540
DESCRIPTOR.message_types_by_name["AuthRequirement"] = _AUTHREQUIREMENT
@@ -449,6 +562,17 @@
449562
)
450563
_sym_db.RegisterMessage(AuthenticationRule)
451564

565+
JwtLocation = _reflection.GeneratedProtocolMessageType(
566+
"JwtLocation",
567+
(_message.Message,),
568+
{
569+
"DESCRIPTOR": _JWTLOCATION,
570+
"__module__": "google.api.auth_pb2"
571+
# @@protoc_insertion_point(class_scope:google.api.JwtLocation)
572+
},
573+
)
574+
_sym_db.RegisterMessage(JwtLocation)
575+
452576
AuthProvider = _reflection.GeneratedProtocolMessageType(
453577
"AuthProvider",
454578
(_message.Message,),

0 commit comments

Comments
 (0)