-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59de125
commit a64ad81
Showing
281 changed files
with
38,288 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2015, Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
import "google/api/http.proto"; | ||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "AnnotationsProto"; | ||
option java_package = "com.google.api"; | ||
option objc_class_prefix = "GAPI"; | ||
|
||
extend google.protobuf.MethodOptions { | ||
// See `HttpRule`. | ||
HttpRule http = 72295728; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
// Copyright 2017 Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "AuthProto"; | ||
option java_package = "com.google.api"; | ||
option objc_class_prefix = "GAPI"; | ||
|
||
|
||
// `Authentication` defines the authentication configuration for an API. | ||
// | ||
// Example for an API targeted for external use: | ||
// | ||
// name: calendar.googleapis.com | ||
// authentication: | ||
// providers: | ||
// - id: google_calendar_auth | ||
// jwks_uri: https://www.googleapis.com/oauth2/v1/certs | ||
// issuer: https://securetoken.google.com | ||
// rules: | ||
// - selector: "*" | ||
// requirements: | ||
// provider_id: google_calendar_auth | ||
message Authentication { | ||
// A list of authentication rules that apply to individual API methods. | ||
// | ||
// **NOTE:** All service configuration rules follow "last one wins" order. | ||
repeated AuthenticationRule rules = 3; | ||
|
||
// Defines a set of authentication providers that a service supports. | ||
repeated AuthProvider providers = 4; | ||
} | ||
|
||
// Authentication rules for the service. | ||
// | ||
// By default, if a method has any authentication requirements, every request | ||
// must include a valid credential matching one of the requirements. | ||
// It's an error to include more than one kind of credential in a single | ||
// request. | ||
// | ||
// If a method doesn't have any auth requirements, request credentials will be | ||
// ignored. | ||
message AuthenticationRule { | ||
// Selects the methods to which this rule applies. | ||
// | ||
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details. | ||
string selector = 1; | ||
|
||
// The requirements for OAuth credentials. | ||
OAuthRequirements oauth = 2; | ||
|
||
// Whether to allow requests without a credential. The credential can be | ||
// an OAuth token, Google cookies (first-party auth) or EndUserCreds. | ||
// | ||
// For requests without credentials, if the service control environment is | ||
// specified, each incoming request **must** be associated with a service | ||
// consumer. This can be done by passing an API key that belongs to a consumer | ||
// project. | ||
bool allow_without_credential = 5; | ||
|
||
// Requirements for additional authentication providers. | ||
repeated AuthRequirement requirements = 7; | ||
} | ||
|
||
// Configuration for an anthentication provider, including support for | ||
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). | ||
message AuthProvider { | ||
// The unique identifier of the auth provider. It will be referred to by | ||
// `AuthRequirement.provider_id`. | ||
// | ||
// Example: "bookstore_auth". | ||
string id = 1; | ||
|
||
// Identifies the principal that issued the JWT. See | ||
// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 | ||
// Usually a URL or an email address. | ||
// | ||
// Example: https://securetoken.google.com | ||
// Example: [email protected] | ||
string issuer = 2; | ||
|
||
// URL of the provider's public key set to validate signature of the JWT. See | ||
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). | ||
// Optional if the key set document: | ||
// - can be retrieved from | ||
// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html | ||
// of the issuer. | ||
// - can be inferred from the email domain of the issuer (e.g. a Google service account). | ||
// | ||
// Example: https://www.googleapis.com/oauth2/v1/certs | ||
string jwks_uri = 3; | ||
|
||
// The list of JWT | ||
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). | ||
// that are allowed to access. A JWT containing any of these audiences will | ||
// be accepted. When this setting is absent, only JWTs with audience | ||
// "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" | ||
// will be accepted. For example, if no audiences are in the setting, | ||
// LibraryService API will only accept JWTs with the following audience | ||
// "https://library-example.googleapis.com/google.example.library.v1.LibraryService". | ||
// | ||
// Example: | ||
// | ||
// audiences: bookstore_android.apps.googleusercontent.com, | ||
// bookstore_web.apps.googleusercontent.com | ||
string audiences = 4; | ||
} | ||
|
||
// OAuth scopes are a way to define data and permissions on data. For example, | ||
// there are scopes defined for "Read-only access to Google Calendar" and | ||
// "Access to Cloud Platform". Users can consent to a scope for an application, | ||
// giving it permission to access that data on their behalf. | ||
// | ||
// OAuth scope specifications should be fairly coarse grained; a user will need | ||
// to see and understand the text description of what your scope means. | ||
// | ||
// In most cases: use one or at most two OAuth scopes for an entire family of | ||
// products. If your product has multiple APIs, you should probably be sharing | ||
// the OAuth scope across all of those APIs. | ||
// | ||
// When you need finer grained OAuth consent screens: talk with your product | ||
// management about how developers will use them in practice. | ||
// | ||
// Please note that even though each of the canonical scopes is enough for a | ||
// request to be accepted and passed to the backend, a request can still fail | ||
// due to the backend requiring additional scopes or permissions. | ||
message OAuthRequirements { | ||
// The list of publicly documented OAuth scopes that are allowed access. An | ||
// OAuth token containing any of these scopes will be accepted. | ||
// | ||
// Example: | ||
// | ||
// canonical_scopes: https://www.googleapis.com/auth/calendar, | ||
// https://www.googleapis.com/auth/calendar.read | ||
string canonical_scopes = 1; | ||
} | ||
|
||
// User-defined authentication requirements, including support for | ||
// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). | ||
message AuthRequirement { | ||
// [id][google.api.AuthProvider.id] from authentication provider. | ||
// | ||
// Example: | ||
// | ||
// provider_id: bookstore_auth | ||
string provider_id = 1; | ||
|
||
// NOTE: This will be deprecated soon, once AuthProvider.audiences is | ||
// implemented and accepted in all the runtime components. | ||
// | ||
// The list of JWT | ||
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). | ||
// that are allowed to access. A JWT containing any of these audiences will | ||
// be accepted. When this setting is absent, only JWTs with audience | ||
// "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" | ||
// will be accepted. For example, if no audiences are in the setting, | ||
// LibraryService API will only accept JWTs with the following audience | ||
// "https://library-example.googleapis.com/google.example.library.v1.LibraryService". | ||
// | ||
// Example: | ||
// | ||
// audiences: bookstore_android.apps.googleusercontent.com, | ||
// bookstore_web.apps.googleusercontent.com | ||
string audiences = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2017 Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "BackendProto"; | ||
option java_package = "com.google.api"; | ||
option objc_class_prefix = "GAPI"; | ||
|
||
|
||
// `Backend` defines the backend configuration for a service. | ||
message Backend { | ||
// A list of API backend rules that apply to individual API methods. | ||
// | ||
// **NOTE:** All service configuration rules follow "last one wins" order. | ||
repeated BackendRule rules = 1; | ||
} | ||
|
||
// A backend rule provides configuration for an individual API element. | ||
message BackendRule { | ||
// Selects the methods to which this rule applies. | ||
// | ||
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details. | ||
string selector = 1; | ||
|
||
// The address of the API backend. | ||
string address = 2; | ||
|
||
// The number of seconds to wait for a response from a request. The | ||
// default depends on the deployment context. | ||
double deadline = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Copyright 2016 Google Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
import "google/api/annotations.proto"; | ||
import "google/api/metric.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "BillingProto"; | ||
option java_package = "com.google.api"; | ||
|
||
|
||
// Billing related configuration of the service. | ||
// | ||
// The following example shows how to configure metrics for billing: | ||
// | ||
// metrics: | ||
// - name: library.googleapis.com/read_calls | ||
// metric_kind: DELTA | ||
// value_type: INT64 | ||
// - name: library.googleapis.com/write_calls | ||
// metric_kind: DELTA | ||
// value_type: INT64 | ||
// billing: | ||
// metrics: | ||
// - library.googleapis.com/read_calls | ||
// - library.googleapis.com/write_calls | ||
// | ||
// The next example shows how to enable billing status check and customize the | ||
// check behavior. It makes sure billing status check is included in the `Check` | ||
// method of [Service Control API](https://cloud.google.com/service-control/). | ||
// In the example, "google.storage.Get" method can be served when the billing | ||
// status is either `current` or `delinquent`, while "google.storage.Write" | ||
// method can only be served when the billing status is `current`: | ||
// | ||
// billing: | ||
// rules: | ||
// - selector: google.storage.Get | ||
// allowed_statuses: | ||
// - current | ||
// - delinquent | ||
// - selector: google.storage.Write | ||
// allowed_statuses: current | ||
// | ||
// Mostly services should only allow `current` status when serving requests. | ||
// In addition, services can choose to allow both `current` and `delinquent` | ||
// statuses when serving read-only requests to resources. If there's no | ||
// matching selector for operation, no billing status check will be performed. | ||
// | ||
message Billing { | ||
// Names of the metrics to report to billing. Each name must | ||
// be defined in [Service.metrics][google.api.Service.metrics] section. | ||
repeated string metrics = 1; | ||
|
||
// A list of billing status rules for configuring billing status check. | ||
repeated BillingStatusRule rules = 5; | ||
} | ||
|
||
// Defines the billing status requirements for operations. | ||
// | ||
// When used with | ||
// [Service Control API](https://cloud.google.com/service-control/), the | ||
// following statuses are supported: | ||
// | ||
// - **current**: the associated billing account is up to date and capable of | ||
// paying for resource usages. | ||
// - **delinquent**: the associated billing account has a correctable problem, | ||
// such as late payment. | ||
// | ||
// Mostly services should only allow `current` status when serving requests. | ||
// In addition, services can choose to allow both `current` and `delinquent` | ||
// statuses when serving read-only requests to resources. If the list of | ||
// allowed_statuses is empty, it means no billing requirement. | ||
// | ||
message BillingStatusRule { | ||
// Selects the operation names to which this rule applies. | ||
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details. | ||
string selector = 1; | ||
|
||
// Allowed billing statuses. The billing status check passes if the actual | ||
// billing status matches any of the provided values here. | ||
repeated string allowed_statuses = 2; | ||
} |
Oops, something went wrong.