access

package
v0.0.0-...-4a11b79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package access contains Access service protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

Types

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 (*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 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 `` /* 155-byte string literal not displayed */
	// 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 `` /* 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 (*DescriptionResponse_ResourceDescription) GetComment

func (*DescriptionResponse_ResourceDescription) GetKind

func (*DescriptionResponse_ResourceDescription) GetRoles

func (*DescriptionResponse_ResourceDescription) ProtoMessage

func (*DescriptionResponse_ResourceDescription) Reset

func (*DescriptionResponse_ResourceDescription) 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 (*DescriptionResponse_ResourceDescription) XXX_Size

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) GetComment

func (*DescriptionResponse_ResourceDescription_Action) ProtoMessage

func (*DescriptionResponse_ResourceDescription_Action) Reset

func (*DescriptionResponse_ResourceDescription_Action) 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 (*DescriptionResponse_ResourceDescription_Action) XXX_Size

func (*DescriptionResponse_ResourceDescription_Action) XXX_Unmarshal

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) GetAllowedActions

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

func (*DescriptionResponse_ResourceDescription_Role) GetComment

func (*DescriptionResponse_ResourceDescription_Role) ProtoMessage

func (*DescriptionResponse_ResourceDescription_Role) Reset

func (*DescriptionResponse_ResourceDescription_Role) 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 (*DescriptionResponse_ResourceDescription_Role) XXX_Size

func (*DescriptionResponse_ResourceDescription_Role) XXX_Unmarshal

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 maps a resource id to resource permissions.
	Permitted map[string]*PermittedActionsResponse_ResourcePermissions `` /* 159-byte string literal not displayed */
	// ValiditiyDuration specifies for how long clients may cache this
	// information.
	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 (*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) GetActions

func (*PermittedActionsResponse_ResourcePermissions) ProtoMessage

func (*PermittedActionsResponse_ResourcePermissions) Reset

func (*PermittedActionsResponse_ResourcePermissions) 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 (*PermittedActionsResponse_ResourcePermissions) XXX_Size

func (*PermittedActionsResponse_ResourcePermissions) XXX_Unmarshal

type UnimplementedAccessServer

type UnimplementedAccessServer struct {
}

UnimplementedAccessServer can be embedded to have forward compatible implementations.

func (*UnimplementedAccessServer) Description

func (*UnimplementedAccessServer) PermittedActions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL