aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/googleapis-common-protos/google/api/visibility.proto
blob: 0be4581d1451b4bf39fe54dddd1be5c2311622d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright 2021 Google LLC
//
// 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/protobuf/descriptor.proto";

option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/visibility;visibility";
option java_multiple_files = true;
option java_outer_classname = "VisibilityProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.EnumOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule enum_visibility = 72295727;
}

extend google.protobuf.EnumValueOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule value_visibility = 72295727;
}

extend google.protobuf.FieldOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule field_visibility = 72295727;
}

extend google.protobuf.MessageOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule message_visibility = 72295727;
}

extend google.protobuf.MethodOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule method_visibility = 72295727;
}

extend google.protobuf.ServiceOptions {
  // See `VisibilityRule`.
  google.api.VisibilityRule api_visibility = 72295727;
}

// `Visibility` restricts service consumer's access to service elements,
// such as whether an application can call a visibility-restricted method.
// The restriction is expressed by applying visibility labels on service
// elements. The visibility labels are elsewhere linked to service consumers.
//
// A service can define multiple visibility labels, but a service consumer
// should be granted at most one visibility label. Multiple visibility
// labels for a single service consumer are not supported.
//
// If an element and all its parents have no visibility label, its visibility
// is unconditionally granted.
//
// Example:
//
//     visibility:
//       rules:
//       - selector: google.calendar.Calendar.EnhancedSearch
//         restriction: PREVIEW
//       - selector: google.calendar.Calendar.Delegate
//         restriction: INTERNAL
//
// Here, all methods are publicly visible except for the restricted methods
// EnhancedSearch and Delegate.
message Visibility {
  // A list of visibility rules that apply to individual API elements.
  //
  // **NOTE:** All service configuration rules follow "last one wins" order.
  repeated VisibilityRule rules = 1;
}

// A visibility rule provides visibility configuration for an individual API
// element.
message VisibilityRule {
  // Selects methods, messages, fields, enums, etc. to which this rule applies.
  //
  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
  // details.
  string selector = 1;

  // A comma-separated list of visibility labels that apply to the `selector`.
  // Any of the listed labels can be used to grant the visibility.
  //
  // If a rule has multiple labels, removing one of the labels but not all of
  // them can break clients.
  //
  // Example:
  //
  //     visibility:
  //       rules:
  //       - selector: google.calendar.Calendar.EnhancedSearch
  //         restriction: INTERNAL, PREVIEW
  //
  // Removing INTERNAL from this restriction will break clients that rely on
  // this method and only had access to it through INTERNAL.
  string restriction = 2;
}