Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
policy.proto83 linesDownload Raw Back to api
1// Copyright 2026 Google LLC2//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 at6//7//     http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// 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 and13// limitations under the License.14 15syntax = "proto3";16 17package google.api;18 19import "google/protobuf/descriptor.proto";20 21option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";22option java_multiple_files = true;23option java_outer_classname = "PolicyProto";24option java_package = "com.google.api";25option objc_class_prefix = "GAPI";26 27extend google.protobuf.FieldOptions {28  // See [FieldPolicy][].29  google.api.FieldPolicy field_policy = 158361448;30}31 32extend google.protobuf.MethodOptions {33  // See [MethodPolicy][].34  google.api.MethodPolicy method_policy = 161893301;35}36 37// Google API Policy Annotation38//39// This message defines a simple API policy annotation that can be used to40// annotate API request and response message fields with applicable policies.41// One field may have multiple applicable policies that must all be satisfied42// before a request can be processed. This policy annotation is used to43// generate the overall policy that will be used for automatic runtime44// policy enforcement and documentation generation.45message FieldPolicy {46  // Selects one or more request or response message fields to apply this47  // `FieldPolicy`.48  //49  // When a `FieldPolicy` is used in proto annotation, the selector must50  // be left as empty. The service config generator will automatically fill51  // the correct value.52  //53  // When a `FieldPolicy` is used in service config, the selector must be a54  // comma-separated string with valid request or response field paths,55  // such as "foo.bar" or "foo.bar,foo.baz".56  string selector = 1;57 58  // Specifies the required permission(s) for the resource referred to by the59  // field. It requires the field contains a valid resource reference, and60  // the request must pass the permission checks to proceed. For example,61  // "resourcemanager.projects.get".62  string resource_permission = 2;63 64  // Specifies the resource type for the resource referred to by the field.65  string resource_type = 3;66}67 68// Defines policies applying to an RPC method.69message MethodPolicy {70  // Selects a method to which these policies should be enforced, for example,71  // "google.pubsub.v1.Subscriber.CreateSubscription".72  //73  // Refer to [selector][google.api.DocumentationRule.selector] for syntax74  // details.75  //76  // NOTE: This field must not be set in the proto annotation. It will be77  // automatically filled by the service config compiler .78  string selector = 9;79 80  // Policies that are applicable to the request message.81  repeated FieldPolicy request_policies = 2;82}83 
codekingpro/portable-devtools · Team Ai