| // Copyright (c) 2017 The LUCI Authors. All rights reserved. |
| // Use of this source code is governed under the Apache License, Version 2.0 |
| // that can be found in the LICENSE file. |
| |
| // This file defines a common protocol to check what actions a given |
| // impersonated user can do on a given resource. |
| // For example, it can be used by one app against another. |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // versions: |
| // protoc-gen-go v1.26.0 |
| // protoc v3.17.0 |
| // source: go.chromium.org/luci/common/proto/access/access.proto |
| |
| package access |
| |
| import prpc "go.chromium.org/luci/grpc/prpc" |
| |
| import ( |
| context "context" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| durationpb "google.golang.org/protobuf/types/known/durationpb" |
| emptypb "google.golang.org/protobuf/types/known/emptypb" |
| reflect "reflect" |
| sync "sync" |
| ) |
| |
| const ( |
| // Verify that this generated code is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| // Verify that runtime/protoimpl is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| ) |
| |
| // DescriptionResponse is the response message from Access.Description. |
| type DescriptionResponse struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Resources is a list of resource types presented on the given service. |
| Resources []*DescriptionResponse_ResourceDescription `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` |
| } |
| |
| func (x *DescriptionResponse) Reset() { |
| *x = DescriptionResponse{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[0] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *DescriptionResponse) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*DescriptionResponse) ProtoMessage() {} |
| |
| func (x *DescriptionResponse) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[0] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use DescriptionResponse.ProtoReflect.Descriptor instead. |
| func (*DescriptionResponse) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{0} |
| } |
| |
| func (x *DescriptionResponse) GetResources() []*DescriptionResponse_ResourceDescription { |
| if x != nil { |
| return x.Resources |
| } |
| return nil |
| } |
| |
| // PermittedActionsRequest is a request message to Access.PermittedActions. |
| // |
| // Besides explicit fields in the message, there is an implicit parameter: the |
| // current identity which is defined by the "Authorization" OAuth 2.0 HTTP |
| // header and, optionally, LUCI-specific delegation token header. |
| type PermittedActionsRequest struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // ResourceKind is one of Resource.kind values returned by Access.Description. |
| // It identifies the type of the resource being checked. |
| ResourceKind string `protobuf:"bytes,1,opt,name=resource_kind,json=resourceKind,proto3" json:"resource_kind,omitempty"` |
| // ResourceIds identifies the resources presented on this service. |
| // For example, for a buildbucket bucket it would be a bucket name |
| // ("luci.chromium.try"). |
| // For a CIPD package it would be a full package name, |
| // "infra/git/linux-amd64". |
| ResourceIds []string `protobuf:"bytes,2,rep,name=resource_ids,json=resourceIds,proto3" json:"resource_ids,omitempty"` |
| } |
| |
| func (x *PermittedActionsRequest) Reset() { |
| *x = PermittedActionsRequest{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[1] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *PermittedActionsRequest) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*PermittedActionsRequest) ProtoMessage() {} |
| |
| func (x *PermittedActionsRequest) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[1] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use PermittedActionsRequest.ProtoReflect.Descriptor instead. |
| func (*PermittedActionsRequest) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{1} |
| } |
| |
| func (x *PermittedActionsRequest) GetResourceKind() string { |
| if x != nil { |
| return x.ResourceKind |
| } |
| return "" |
| } |
| |
| func (x *PermittedActionsRequest) GetResourceIds() []string { |
| if x != nil { |
| return x.ResourceIds |
| } |
| return nil |
| } |
| |
| // PermittedActionsResponse is the response message of the |
| // Accses.PermittedActions. |
| type PermittedActionsResponse struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Permitted maps a resource id to resource permissions. |
| Permitted map[string]*PermittedActionsResponse_ResourcePermissions `protobuf:"bytes,1,rep,name=permitted,proto3" json:"permitted,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
| // ValiditiyDuration specifies for how long clients may cache this |
| // information. |
| ValidityDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=validity_duration,json=validityDuration,proto3" json:"validity_duration,omitempty"` |
| } |
| |
| func (x *PermittedActionsResponse) Reset() { |
| *x = PermittedActionsResponse{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[2] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *PermittedActionsResponse) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*PermittedActionsResponse) ProtoMessage() {} |
| |
| func (x *PermittedActionsResponse) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[2] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use PermittedActionsResponse.ProtoReflect.Descriptor instead. |
| func (*PermittedActionsResponse) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{2} |
| } |
| |
| func (x *PermittedActionsResponse) GetPermitted() map[string]*PermittedActionsResponse_ResourcePermissions { |
| if x != nil { |
| return x.Permitted |
| } |
| return nil |
| } |
| |
| func (x *PermittedActionsResponse) GetValidityDuration() *durationpb.Duration { |
| if x != nil { |
| return x.ValidityDuration |
| } |
| return nil |
| } |
| |
| // ResourceDescription is one resource type, e.g. buildbucket bucket |
| // or swarming pool. |
| type DescriptionResponse_ResourceDescription struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Kind identifies the resource type presented on the service. |
| // Access.PermittedActions accepts one of resource kinds. |
| // Example: "bucket" for buildbucket bucket, "package" for CIPD package. |
| // |
| // For implementers: |
| // Kind must match regexp `^[a-z\-/]+$`. |
| Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` |
| // Comment provides more info about the resource. |
| Comment string `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` |
| // Actions defines all possible actions that can be performed on this type |
| // of resource. |
| // |
| // Map key is an action ID, unique within the resource. |
| // It is referenced from Role.allowed_actions. |
| // |
| // For implementers: |
| // ActionId must match regexp `^[A-Z\_]+$`. |
| // Recommendations: |
| // - "READ", not "GET" |
| // - "DELETE", not "REMOVE" |
| // - prefer concrete actions ("ADD_BUILD", "CHANGE_ACL", "INCREMENT") to |
| // abstract ones ("MODIFY", "WRITE", "UPDATE"). |
| Actions map[string]*DescriptionResponse_ResourceDescription_Action `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
| // Roles maps a role id to a set of actions. |
| // Access configurations are typically expressed with roles, not actions. |
| // |
| // For implementers: |
| // Role IDs must match regexp `^[A-Z\_]+$`. |
| // Recommendataion: if it makes sense, make role ID close to the action |
| // names, e.g. READER can READ, SCHEDULER can SCHEDULE. |
| Roles map[string]*DescriptionResponse_ResourceDescription_Role `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) Reset() { |
| *x = DescriptionResponse_ResourceDescription{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[3] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*DescriptionResponse_ResourceDescription) ProtoMessage() {} |
| |
| func (x *DescriptionResponse_ResourceDescription) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[3] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use DescriptionResponse_ResourceDescription.ProtoReflect.Descriptor instead. |
| func (*DescriptionResponse_ResourceDescription) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{0, 0} |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) GetKind() string { |
| if x != nil { |
| return x.Kind |
| } |
| return "" |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) GetComment() string { |
| if x != nil { |
| return x.Comment |
| } |
| return "" |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) GetActions() map[string]*DescriptionResponse_ResourceDescription_Action { |
| if x != nil { |
| return x.Actions |
| } |
| return nil |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription) GetRoles() map[string]*DescriptionResponse_ResourceDescription_Role { |
| if x != nil { |
| return x.Roles |
| } |
| return nil |
| } |
| |
| // Action describes what a user can do with a resource. |
| type DescriptionResponse_ResourceDescription_Action struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Comment provides more human-readable info about the action. |
| Comment string `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"` |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Action) Reset() { |
| *x = DescriptionResponse_ResourceDescription_Action{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[4] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Action) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*DescriptionResponse_ResourceDescription_Action) ProtoMessage() {} |
| |
| func (x *DescriptionResponse_ResourceDescription_Action) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[4] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use DescriptionResponse_ResourceDescription_Action.ProtoReflect.Descriptor instead. |
| func (*DescriptionResponse_ResourceDescription_Action) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{0, 0, 0} |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Action) GetComment() string { |
| if x != nil { |
| return x.Comment |
| } |
| return "" |
| } |
| |
| // Role is a named set of allowed actions. |
| type DescriptionResponse_ResourceDescription_Role struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // AllowedActions is a set of action IDs. |
| // It defines what a role bearer can do with the resource. |
| AllowedActions []string `protobuf:"bytes,1,rep,name=allowed_actions,json=allowedActions,proto3" json:"allowed_actions,omitempty"` |
| // Comment provides more info about the role. |
| Comment string `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Role) Reset() { |
| *x = DescriptionResponse_ResourceDescription_Role{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[5] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Role) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*DescriptionResponse_ResourceDescription_Role) ProtoMessage() {} |
| |
| func (x *DescriptionResponse_ResourceDescription_Role) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[5] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use DescriptionResponse_ResourceDescription_Role.ProtoReflect.Descriptor instead. |
| func (*DescriptionResponse_ResourceDescription_Role) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{0, 0, 1} |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Role) GetAllowedActions() []string { |
| if x != nil { |
| return x.AllowedActions |
| } |
| return nil |
| } |
| |
| func (x *DescriptionResponse_ResourceDescription_Role) GetComment() string { |
| if x != nil { |
| return x.Comment |
| } |
| return "" |
| } |
| |
| // ResourcePermissions describes what is permitted on a single resource. |
| type PermittedActionsResponse_ResourcePermissions struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Actions is a list of action ids that the user can do on the resource. |
| // For resources that do not exist, this list must be empty. |
| Actions []string `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` |
| } |
| |
| func (x *PermittedActionsResponse_ResourcePermissions) Reset() { |
| *x = PermittedActionsResponse_ResourcePermissions{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[8] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *PermittedActionsResponse_ResourcePermissions) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*PermittedActionsResponse_ResourcePermissions) ProtoMessage() {} |
| |
| func (x *PermittedActionsResponse_ResourcePermissions) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[8] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use PermittedActionsResponse_ResourcePermissions.ProtoReflect.Descriptor instead. |
| func (*PermittedActionsResponse_ResourcePermissions) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP(), []int{2, 0} |
| } |
| |
| func (x *PermittedActionsResponse_ResourcePermissions) GetActions() []string { |
| if x != nil { |
| return x.Actions |
| } |
| return nil |
| } |
| |
| var File_go_chromium_org_luci_common_proto_access_access_proto protoreflect.FileDescriptor |
| |
| var file_go_chromium_org_luci_common_proto_access_access_proto_rawDesc = []byte{ |
| 0x0a, 0x35, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, |
| 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, |
| 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, |
| 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, |
| 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, |
| 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, |
| 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, |
| 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x05, 0x0a, |
| 0x13, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, |
| 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, |
| 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, |
| 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, |
| 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, |
| 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, |
| 0x63, 0x65, 0x73, 0x1a, 0xc0, 0x04, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, |
| 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, |
| 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, |
| 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, |
| 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x56, 0x0a, 0x07, 0x61, 0x63, 0x74, |
| 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x61, 0x63, 0x63, |
| 0x65, 0x73, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, |
| 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, |
| 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, |
| 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, |
| 0x73, 0x12, 0x50, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, |
| 0x32, 0x3a, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, |
| 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, |
| 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, |
| 0x6e, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x6f, |
| 0x6c, 0x65, 0x73, 0x1a, 0x22, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, |
| 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, |
| 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x49, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, |
| 0x27, 0x0a, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, |
| 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, |
| 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, |
| 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, |
| 0x6e, 0x74, 0x1a, 0x72, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, |
| 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, |
| 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, |
| 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x44, 0x65, 0x73, |
| 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, |
| 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, |
| 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, |
| 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x6e, 0x0a, 0x0a, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, |
| 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, |
| 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, |
| 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x44, |
| 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, |
| 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, |
| 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, |
| 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x61, 0x0a, 0x17, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, |
| 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, |
| 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6b, 0x69, |
| 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, |
| 0x63, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, |
| 0x63, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, |
| 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x73, 0x22, 0xd6, 0x02, 0x0a, 0x18, 0x50, 0x65, |
| 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, |
| 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, |
| 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x63, 0x63, 0x65, |
| 0x73, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, |
| 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x6d, |
| 0x69, 0x74, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x70, 0x65, 0x72, 0x6d, |
| 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x46, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, |
| 0x79, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, |
| 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, |
| 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x76, 0x61, 0x6c, |
| 0x69, 0x64, 0x69, 0x74, 0x79, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2f, 0x0a, |
| 0x13, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, |
| 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, |
| 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x72, |
| 0x0a, 0x0e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, |
| 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, |
| 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, |
| 0x0b, 0x32, 0x34, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, |
| 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, |
| 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x65, 0x72, 0x6d, |
| 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, |
| 0x38, 0x01, 0x32, 0xa7, 0x01, 0x0a, 0x06, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x57, 0x0a, |
| 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, |
| 0x73, 0x12, 0x1f, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, |
| 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, |
| 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x6d, |
| 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, |
| 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, |
| 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, |
| 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, |
| 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, |
| 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, |
| 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, |
| 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, |
| 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| } |
| |
| var ( |
| file_go_chromium_org_luci_common_proto_access_access_proto_rawDescOnce sync.Once |
| file_go_chromium_org_luci_common_proto_access_access_proto_rawDescData = file_go_chromium_org_luci_common_proto_access_access_proto_rawDesc |
| ) |
| |
| func file_go_chromium_org_luci_common_proto_access_access_proto_rawDescGZIP() []byte { |
| file_go_chromium_org_luci_common_proto_access_access_proto_rawDescOnce.Do(func() { |
| file_go_chromium_org_luci_common_proto_access_access_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_common_proto_access_access_proto_rawDescData) |
| }) |
| return file_go_chromium_org_luci_common_proto_access_access_proto_rawDescData |
| } |
| |
| var file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes = make([]protoimpl.MessageInfo, 10) |
| var file_go_chromium_org_luci_common_proto_access_access_proto_goTypes = []interface{}{ |
| (*DescriptionResponse)(nil), // 0: access.DescriptionResponse |
| (*PermittedActionsRequest)(nil), // 1: access.PermittedActionsRequest |
| (*PermittedActionsResponse)(nil), // 2: access.PermittedActionsResponse |
| (*DescriptionResponse_ResourceDescription)(nil), // 3: access.DescriptionResponse.ResourceDescription |
| (*DescriptionResponse_ResourceDescription_Action)(nil), // 4: access.DescriptionResponse.ResourceDescription.Action |
| (*DescriptionResponse_ResourceDescription_Role)(nil), // 5: access.DescriptionResponse.ResourceDescription.Role |
| nil, // 6: access.DescriptionResponse.ResourceDescription.ActionsEntry |
| nil, // 7: access.DescriptionResponse.ResourceDescription.RolesEntry |
| (*PermittedActionsResponse_ResourcePermissions)(nil), // 8: access.PermittedActionsResponse.ResourcePermissions |
| nil, // 9: access.PermittedActionsResponse.PermittedEntry |
| (*durationpb.Duration)(nil), // 10: google.protobuf.Duration |
| (*emptypb.Empty)(nil), // 11: google.protobuf.Empty |
| } |
| var file_go_chromium_org_luci_common_proto_access_access_proto_depIdxs = []int32{ |
| 3, // 0: access.DescriptionResponse.resources:type_name -> access.DescriptionResponse.ResourceDescription |
| 9, // 1: access.PermittedActionsResponse.permitted:type_name -> access.PermittedActionsResponse.PermittedEntry |
| 10, // 2: access.PermittedActionsResponse.validity_duration:type_name -> google.protobuf.Duration |
| 6, // 3: access.DescriptionResponse.ResourceDescription.actions:type_name -> access.DescriptionResponse.ResourceDescription.ActionsEntry |
| 7, // 4: access.DescriptionResponse.ResourceDescription.roles:type_name -> access.DescriptionResponse.ResourceDescription.RolesEntry |
| 4, // 5: access.DescriptionResponse.ResourceDescription.ActionsEntry.value:type_name -> access.DescriptionResponse.ResourceDescription.Action |
| 5, // 6: access.DescriptionResponse.ResourceDescription.RolesEntry.value:type_name -> access.DescriptionResponse.ResourceDescription.Role |
| 8, // 7: access.PermittedActionsResponse.PermittedEntry.value:type_name -> access.PermittedActionsResponse.ResourcePermissions |
| 1, // 8: access.Access.PermittedActions:input_type -> access.PermittedActionsRequest |
| 11, // 9: access.Access.Description:input_type -> google.protobuf.Empty |
| 2, // 10: access.Access.PermittedActions:output_type -> access.PermittedActionsResponse |
| 0, // 11: access.Access.Description:output_type -> access.DescriptionResponse |
| 10, // [10:12] is the sub-list for method output_type |
| 8, // [8:10] is the sub-list for method input_type |
| 8, // [8:8] is the sub-list for extension type_name |
| 8, // [8:8] is the sub-list for extension extendee |
| 0, // [0:8] is the sub-list for field type_name |
| } |
| |
| func init() { file_go_chromium_org_luci_common_proto_access_access_proto_init() } |
| func file_go_chromium_org_luci_common_proto_access_access_proto_init() { |
| if File_go_chromium_org_luci_common_proto_access_access_proto != nil { |
| return |
| } |
| if !protoimpl.UnsafeEnabled { |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*DescriptionResponse); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*PermittedActionsRequest); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*PermittedActionsResponse); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*DescriptionResponse_ResourceDescription); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*DescriptionResponse_ResourceDescription_Action); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*DescriptionResponse_ResourceDescription_Role); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*PermittedActionsResponse_ResourcePermissions); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| } |
| type x struct{} |
| out := protoimpl.TypeBuilder{ |
| File: protoimpl.DescBuilder{ |
| GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| RawDescriptor: file_go_chromium_org_luci_common_proto_access_access_proto_rawDesc, |
| NumEnums: 0, |
| NumMessages: 10, |
| NumExtensions: 0, |
| NumServices: 1, |
| }, |
| GoTypes: file_go_chromium_org_luci_common_proto_access_access_proto_goTypes, |
| DependencyIndexes: file_go_chromium_org_luci_common_proto_access_access_proto_depIdxs, |
| MessageInfos: file_go_chromium_org_luci_common_proto_access_access_proto_msgTypes, |
| }.Build() |
| File_go_chromium_org_luci_common_proto_access_access_proto = out.File |
| file_go_chromium_org_luci_common_proto_access_access_proto_rawDesc = nil |
| file_go_chromium_org_luci_common_proto_access_access_proto_goTypes = nil |
| file_go_chromium_org_luci_common_proto_access_access_proto_depIdxs = nil |
| } |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ context.Context |
| var _ grpc.ClientConnInterface |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| const _ = grpc.SupportPackageIsVersion6 |
| |
| // AccessClient is the client API for Access service. |
| // |
| // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| type AccessClient interface { |
| // PermittedActions returns a list of actions the requester can perform |
| // on a given resource. |
| PermittedActions(ctx context.Context, in *PermittedActionsRequest, opts ...grpc.CallOption) (*PermittedActionsResponse, error) |
| // Description returns types of resources and actions that this service |
| // supports. |
| // It is intended to be used as self-documentation, for humans that play |
| // with the API. |
| // If the concepts returned by this RPC are internal, it should be restricted. |
| Description(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DescriptionResponse, error) |
| } |
| type accessPRPCClient struct { |
| client *prpc.Client |
| } |
| |
| func NewAccessPRPCClient(client *prpc.Client) AccessClient { |
| return &accessPRPCClient{client} |
| } |
| |
| func (c *accessPRPCClient) PermittedActions(ctx context.Context, in *PermittedActionsRequest, opts ...grpc.CallOption) (*PermittedActionsResponse, error) { |
| out := new(PermittedActionsResponse) |
| err := c.client.Call(ctx, "access.Access", "PermittedActions", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *accessPRPCClient) Description(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DescriptionResponse, error) { |
| out := new(DescriptionResponse) |
| err := c.client.Call(ctx, "access.Access", "Description", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| type accessClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewAccessClient(cc grpc.ClientConnInterface) AccessClient { |
| return &accessClient{cc} |
| } |
| |
| func (c *accessClient) PermittedActions(ctx context.Context, in *PermittedActionsRequest, opts ...grpc.CallOption) (*PermittedActionsResponse, error) { |
| out := new(PermittedActionsResponse) |
| err := c.cc.Invoke(ctx, "/access.Access/PermittedActions", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *accessClient) Description(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DescriptionResponse, error) { |
| out := new(DescriptionResponse) |
| err := c.cc.Invoke(ctx, "/access.Access/Description", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // AccessServer is the server API for Access service. |
| type AccessServer interface { |
| // PermittedActions returns a list of actions the requester can perform |
| // on a given resource. |
| PermittedActions(context.Context, *PermittedActionsRequest) (*PermittedActionsResponse, error) |
| // Description returns types of resources and actions that this service |
| // supports. |
| // It is intended to be used as self-documentation, for humans that play |
| // with the API. |
| // If the concepts returned by this RPC are internal, it should be restricted. |
| Description(context.Context, *emptypb.Empty) (*DescriptionResponse, error) |
| } |
| |
| // UnimplementedAccessServer can be embedded to have forward compatible implementations. |
| type UnimplementedAccessServer struct { |
| } |
| |
| func (*UnimplementedAccessServer) PermittedActions(context.Context, *PermittedActionsRequest) (*PermittedActionsResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method PermittedActions not implemented") |
| } |
| func (*UnimplementedAccessServer) Description(context.Context, *emptypb.Empty) (*DescriptionResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method Description not implemented") |
| } |
| |
| func RegisterAccessServer(s prpc.Registrar, srv AccessServer) { |
| s.RegisterService(&_Access_serviceDesc, srv) |
| } |
| |
| func _Access_PermittedActions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(PermittedActionsRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(AccessServer).PermittedActions(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/access.Access/PermittedActions", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(AccessServer).PermittedActions(ctx, req.(*PermittedActionsRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _Access_Description_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(emptypb.Empty) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(AccessServer).Description(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/access.Access/Description", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(AccessServer).Description(ctx, req.(*emptypb.Empty)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| var _Access_serviceDesc = grpc.ServiceDesc{ |
| ServiceName: "access.Access", |
| HandlerType: (*AccessServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "PermittedActions", |
| Handler: _Access_PermittedActions_Handler, |
| }, |
| { |
| MethodName: "Description", |
| Handler: _Access_Description_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "go.chromium.org/luci/common/proto/access/access.proto", |
| } |