Back to godoc.org

Package access

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package access contains Access service protocol.

Index

func FileDescriptorSet

func FileDescriptorSet() *descriptor.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterAccessServer

func RegisterAccessServer(s prpc.Registrar, srv AccessServer)

type AccessClient

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 *empty.Empty, opts ...grpc.CallOption) (*DescriptionResponse, error)
}

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.

func NewAccessClient

func NewAccessClient(cc grpc.ClientConnInterface) AccessClient

func NewAccessPRPCClient

func NewAccessPRPCClient(client *prpc.Client) AccessClient

type AccessServer

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, *empty.Empty) (*DescriptionResponse, error)
}

AccessServer is the server API for Access service.

type DescriptionResponse

type DescriptionResponse struct {
	// 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"`
	XXX_NoUnkeyedLiteral struct{}                                   `json:"-"`
	XXX_unrecognized     []byte                                     `json:"-"`
	XXX_sizecache        int32                                      `json:"-"`
}

DescriptionResponse is the response message from Access.Description.

func (*DescriptionResponse) Descriptor

func (*DescriptionResponse) Descriptor() ([]byte, []int)

func (*DescriptionResponse) GetResources

func (m *DescriptionResponse) GetResources() []*DescriptionResponse_ResourceDescription

func (*DescriptionResponse) ProtoMessage

func (*DescriptionResponse) ProtoMessage()

func (*DescriptionResponse) Reset

func (m *DescriptionResponse) Reset()

func (*DescriptionResponse) String

func (m *DescriptionResponse) String() string

func (*DescriptionResponse) XXX_DiscardUnknown

func (m *DescriptionResponse) XXX_DiscardUnknown()

func (*DescriptionResponse) XXX_Marshal

func (m *DescriptionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescriptionResponse) XXX_Merge

func (m *DescriptionResponse) XXX_Merge(src proto.Message)

func (*DescriptionResponse) XXX_Size

func (m *DescriptionResponse) XXX_Size() int

func (*DescriptionResponse) XXX_Unmarshal

func (m *DescriptionResponse) XXX_Unmarshal(b []byte) error

type DescriptionResponse_ResourceDescription

type DescriptionResponse_ResourceDescription struct {
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`

	Comment string `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"`

	Actions map[string]*DescriptionResponse_ResourceDescription_Action "" /* 155 byte string literal not displayed */

	Roles                map[string]*DescriptionResponse_ResourceDescription_Role "" /* 151 byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                                                 `json:"-"`
	XXX_unrecognized     []byte                                                   `json:"-"`
	XXX_sizecache        int32                                                    `json:"-"`
}

ResourceDescription is one resource type, e.g. buildbucket bucket or swarming pool.

func (*DescriptionResponse_ResourceDescription) Descriptor

func (*DescriptionResponse_ResourceDescription) Descriptor() ([]byte, []int)

func (*DescriptionResponse_ResourceDescription) GetActions

func (m *DescriptionResponse_ResourceDescription) GetActions() map[string]*DescriptionResponse_ResourceDescription_Action

func (*DescriptionResponse_ResourceDescription) GetComment

func (m *DescriptionResponse_ResourceDescription) GetComment() string

func (*DescriptionResponse_ResourceDescription) GetKind

func (m *DescriptionResponse_ResourceDescription) GetKind() string

func (*DescriptionResponse_ResourceDescription) GetRoles

func (m *DescriptionResponse_ResourceDescription) GetRoles() map[string]*DescriptionResponse_ResourceDescription_Role

func (*DescriptionResponse_ResourceDescription) ProtoMessage

func (*DescriptionResponse_ResourceDescription) ProtoMessage()

func (*DescriptionResponse_ResourceDescription) Reset

func (m *DescriptionResponse_ResourceDescription) Reset()

func (*DescriptionResponse_ResourceDescription) String

func (m *DescriptionResponse_ResourceDescription) String() string

func (*DescriptionResponse_ResourceDescription) XXX_DiscardUnknown

func (m *DescriptionResponse_ResourceDescription) XXX_DiscardUnknown()

func (*DescriptionResponse_ResourceDescription) XXX_Marshal

func (m *DescriptionResponse_ResourceDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescriptionResponse_ResourceDescription) XXX_Merge

func (m *DescriptionResponse_ResourceDescription) XXX_Merge(src proto.Message)

func (*DescriptionResponse_ResourceDescription) XXX_Size

func (m *DescriptionResponse_ResourceDescription) XXX_Size() int

func (*DescriptionResponse_ResourceDescription) XXX_Unmarshal

func (m *DescriptionResponse_ResourceDescription) XXX_Unmarshal(b []byte) error

type DescriptionResponse_ResourceDescription_Action

type DescriptionResponse_ResourceDescription_Action struct {
	// Comment provides more human-readable info about the action.
	Comment              string   `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Action describes what a user can do with a resource.

func (*DescriptionResponse_ResourceDescription_Action) Descriptor

func (*DescriptionResponse_ResourceDescription_Action) Descriptor() ([]byte, []int)

func (*DescriptionResponse_ResourceDescription_Action) GetComment

func (m *DescriptionResponse_ResourceDescription_Action) GetComment() string

func (*DescriptionResponse_ResourceDescription_Action) ProtoMessage

func (*DescriptionResponse_ResourceDescription_Action) ProtoMessage()

func (*DescriptionResponse_ResourceDescription_Action) Reset

func (m *DescriptionResponse_ResourceDescription_Action) Reset()

func (*DescriptionResponse_ResourceDescription_Action) String

func (m *DescriptionResponse_ResourceDescription_Action) String() string

func (*DescriptionResponse_ResourceDescription_Action) XXX_DiscardUnknown

func (m *DescriptionResponse_ResourceDescription_Action) XXX_DiscardUnknown()

func (*DescriptionResponse_ResourceDescription_Action) XXX_Marshal

func (m *DescriptionResponse_ResourceDescription_Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescriptionResponse_ResourceDescription_Action) XXX_Merge

func (m *DescriptionResponse_ResourceDescription_Action) XXX_Merge(src proto.Message)

func (*DescriptionResponse_ResourceDescription_Action) XXX_Size

func (m *DescriptionResponse_ResourceDescription_Action) XXX_Size() int

func (*DescriptionResponse_ResourceDescription_Action) XXX_Unmarshal

func (m *DescriptionResponse_ResourceDescription_Action) XXX_Unmarshal(b []byte) error

type DescriptionResponse_ResourceDescription_Role

type DescriptionResponse_ResourceDescription_Role struct {
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Role is a named set of allowed actions.

func (*DescriptionResponse_ResourceDescription_Role) Descriptor

func (*DescriptionResponse_ResourceDescription_Role) Descriptor() ([]byte, []int)

func (*DescriptionResponse_ResourceDescription_Role) GetAllowedActions

func (m *DescriptionResponse_ResourceDescription_Role) GetAllowedActions() []string

func (*DescriptionResponse_ResourceDescription_Role) GetComment

func (m *DescriptionResponse_ResourceDescription_Role) GetComment() string

func (*DescriptionResponse_ResourceDescription_Role) ProtoMessage

func (*DescriptionResponse_ResourceDescription_Role) ProtoMessage()

func (*DescriptionResponse_ResourceDescription_Role) Reset

func (m *DescriptionResponse_ResourceDescription_Role) Reset()

func (*DescriptionResponse_ResourceDescription_Role) String

func (m *DescriptionResponse_ResourceDescription_Role) String() string

func (*DescriptionResponse_ResourceDescription_Role) XXX_DiscardUnknown

func (m *DescriptionResponse_ResourceDescription_Role) XXX_DiscardUnknown()

func (*DescriptionResponse_ResourceDescription_Role) XXX_Marshal

func (m *DescriptionResponse_ResourceDescription_Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescriptionResponse_ResourceDescription_Role) XXX_Merge

func (m *DescriptionResponse_ResourceDescription_Role) XXX_Merge(src proto.Message)

func (*DescriptionResponse_ResourceDescription_Role) XXX_Size

func (m *DescriptionResponse_ResourceDescription_Role) XXX_Size() int

func (*DescriptionResponse_ResourceDescription_Role) XXX_Unmarshal

func (m *DescriptionResponse_ResourceDescription_Role) XXX_Unmarshal(b []byte) error

type PermittedActionsRequest

type PermittedActionsRequest struct {
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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.

func (*PermittedActionsRequest) Descriptor

func (*PermittedActionsRequest) Descriptor() ([]byte, []int)

func (*PermittedActionsRequest) GetResourceIds

func (m *PermittedActionsRequest) GetResourceIds() []string

func (*PermittedActionsRequest) GetResourceKind

func (m *PermittedActionsRequest) GetResourceKind() string

func (*PermittedActionsRequest) ProtoMessage

func (*PermittedActionsRequest) ProtoMessage()

func (*PermittedActionsRequest) Reset

func (m *PermittedActionsRequest) Reset()

func (*PermittedActionsRequest) String

func (m *PermittedActionsRequest) String() string

func (*PermittedActionsRequest) XXX_DiscardUnknown

func (m *PermittedActionsRequest) XXX_DiscardUnknown()

func (*PermittedActionsRequest) XXX_Marshal

func (m *PermittedActionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PermittedActionsRequest) XXX_Merge

func (m *PermittedActionsRequest) XXX_Merge(src proto.Message)

func (*PermittedActionsRequest) XXX_Size

func (m *PermittedActionsRequest) XXX_Size() int

func (*PermittedActionsRequest) XXX_Unmarshal

func (m *PermittedActionsRequest) XXX_Unmarshal(b []byte) error

type PermittedActionsResponse

type PermittedActionsResponse struct {
	Permitted map[string]*PermittedActionsResponse_ResourcePermissions "" /* 159 byte string literal not displayed */

	ValidityDuration     *duration.Duration `protobuf:"bytes,2,opt,name=validity_duration,json=validityDuration,proto3" json:"validity_duration,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

PermittedActionsResponse is the response message of the Accses.PermittedActions.

func (*PermittedActionsResponse) Descriptor

func (*PermittedActionsResponse) Descriptor() ([]byte, []int)

func (*PermittedActionsResponse) GetPermitted

func (m *PermittedActionsResponse) GetPermitted() map[string]*PermittedActionsResponse_ResourcePermissions

func (*PermittedActionsResponse) GetValidityDuration

func (m *PermittedActionsResponse) GetValidityDuration() *duration.Duration

func (*PermittedActionsResponse) ProtoMessage

func (*PermittedActionsResponse) ProtoMessage()

func (*PermittedActionsResponse) Reset

func (m *PermittedActionsResponse) Reset()

func (*PermittedActionsResponse) String

func (m *PermittedActionsResponse) String() string

func (*PermittedActionsResponse) XXX_DiscardUnknown

func (m *PermittedActionsResponse) XXX_DiscardUnknown()

func (*PermittedActionsResponse) XXX_Marshal

func (m *PermittedActionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PermittedActionsResponse) XXX_Merge

func (m *PermittedActionsResponse) XXX_Merge(src proto.Message)

func (*PermittedActionsResponse) XXX_Size

func (m *PermittedActionsResponse) XXX_Size() int

func (*PermittedActionsResponse) XXX_Unmarshal

func (m *PermittedActionsResponse) XXX_Unmarshal(b []byte) error

type PermittedActionsResponse_ResourcePermissions

type PermittedActionsResponse_ResourcePermissions struct {
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ResourcePermissions describes what is permitted on a single resource.

func (*PermittedActionsResponse_ResourcePermissions) Descriptor

func (*PermittedActionsResponse_ResourcePermissions) Descriptor() ([]byte, []int)

func (*PermittedActionsResponse_ResourcePermissions) GetActions

func (m *PermittedActionsResponse_ResourcePermissions) GetActions() []string

func (*PermittedActionsResponse_ResourcePermissions) ProtoMessage

func (*PermittedActionsResponse_ResourcePermissions) ProtoMessage()

func (*PermittedActionsResponse_ResourcePermissions) Reset

func (m *PermittedActionsResponse_ResourcePermissions) Reset()

func (*PermittedActionsResponse_ResourcePermissions) String

func (m *PermittedActionsResponse_ResourcePermissions) String() string

func (*PermittedActionsResponse_ResourcePermissions) XXX_DiscardUnknown

func (m *PermittedActionsResponse_ResourcePermissions) XXX_DiscardUnknown()

func (*PermittedActionsResponse_ResourcePermissions) XXX_Marshal

func (m *PermittedActionsResponse_ResourcePermissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PermittedActionsResponse_ResourcePermissions) XXX_Merge

func (m *PermittedActionsResponse_ResourcePermissions) XXX_Merge(src proto.Message)

func (*PermittedActionsResponse_ResourcePermissions) XXX_Size

func (m *PermittedActionsResponse_ResourcePermissions) XXX_Size() int

func (*PermittedActionsResponse_ResourcePermissions) XXX_Unmarshal

func (m *PermittedActionsResponse_ResourcePermissions) XXX_Unmarshal(b []byte) error

type UnimplementedAccessServer

type UnimplementedAccessServer struct {
}

UnimplementedAccessServer can be embedded to have forward compatible implementations.

func (*UnimplementedAccessServer) Description

func (*UnimplementedAccessServer) Description(ctx context.Context, req *empty.Empty) (*DescriptionResponse, error)

func (*UnimplementedAccessServer) PermittedActions

func (*UnimplementedAccessServer) PermittedActions(ctx context.Context, req *PermittedActionsRequest) (*PermittedActionsResponse, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier