context.proto 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2016 Google Inc.
  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.api;
  16. option java_multiple_files = true;
  17. option java_outer_classname = "ContextProto";
  18. option java_package = "com.google.api";
  19. option objc_class_prefix = "GAPI";
  20. // `Context` defines which contexts an API requests.
  21. //
  22. // Example:
  23. //
  24. // context:
  25. // rules:
  26. // - selector: "*"
  27. // requested:
  28. // - google.rpc.context.ProjectContext
  29. // - google.rpc.context.OriginContext
  30. //
  31. // The above specifies that all methods in the API request
  32. // `google.rpc.context.ProjectContext` and
  33. // `google.rpc.context.OriginContext`.
  34. //
  35. // Available context types are defined in package
  36. // `google.rpc.context`.
  37. message Context {
  38. // A list of RPC context rules that apply to individual API methods.
  39. //
  40. // **NOTE:** All service configuration rules follow "last one wins" order.
  41. repeated ContextRule rules = 1;
  42. }
  43. // A context rule provides information about the context for an individual API
  44. // element.
  45. message ContextRule {
  46. // Selects the methods to which this rule applies.
  47. //
  48. // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
  49. string selector = 1;
  50. // A list of full type names of requested contexts.
  51. repeated string requested = 2;
  52. // A list of full type names of provided contexts.
  53. repeated string provided = 3;
  54. }