service

package
v3.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package service is a generated protocol buffer package.

It is generated from these files:

common.proto

It has these top-level messages:

Query
ResourcePolicyQuery
ResourcePolicy
ActionOutputQuery
SourceSingleQuery
StopEvent
StatusResponse
ChangesArchiveQuery

Package service is a generated protocol buffer package.

It is generated from these files:

common.proto

It has these top-level messages:

Query
ResourcePolicyQuery
ResourcePolicy
ActionOutputQuery
SourceSingleQuery
StopEvent
StatusResponse
ChangesArchiveQuery

Package service provides protobuf "any" types used by other proto's

Index

Constants

This section is empty.

Variables

View Source
var OperationType_name = map[int32]string{
	0: "OR",
	1: "AND",
}
View Source
var OperationType_value = map[string]int32{
	"OR":  0,
	"AND": 1,
}
View Source
var ResourcePolicyAction_name = map[int32]string{
	0: "ANY",
	1: "OWNER",
	2: "READ",
	3: "WRITE",
	4: "EDIT_RULES",
}
View Source
var ResourcePolicyAction_value = map[string]int32{
	"ANY":        0,
	"OWNER":      1,
	"READ":       2,
	"WRITE":      3,
	"EDIT_RULES": 4,
}
View Source
var ResourcePolicy_PolicyEffect_name = map[int32]string{
	0: "deny",
	1: "allow",
}
View Source
var ResourcePolicy_PolicyEffect_value = map[string]int32{
	"deny":  0,
	"allow": 1,
}

Functions

func ReduceQueryBooleans

func ReduceQueryBooleans(results []bool, operation OperationType) bool

func RegisterArchiverHandler added in v1.0.2

func RegisterArchiverHandler(s server.Server, hdlr ArchiverHandler, opts ...server.HandlerOption) error

func RegisterServiceHandler

func RegisterServiceHandler(s server.Server, hdlr ServiceHandler, opts ...server.HandlerOption) error

func RegisterStarterHandler

func RegisterStarterHandler(s server.Server, hdlr StarterHandler, opts ...server.HandlerOption) error

Types

type ActionOutputQuery

type ActionOutputQuery struct {
	// Check if ActionOutput has Success = true
	Success bool `protobuf:"varint,1,opt,name=Success" json:"Success,omitempty"`
	// Check if ActionOutput has Success = false
	Failed bool `protobuf:"varint,2,opt,name=Failed" json:"Failed,omitempty"`
	// Find occurence of string in body
	StringBodyCompare string `protobuf:"bytes,3,opt,name=StringBodyCompare" json:"StringBodyCompare,omitempty"`
	// Find similar Json
	JsonBodyCompare string `protobuf:"bytes,4,opt,name=JsonBodyCompare" json:"JsonBodyCompare,omitempty"`
	// Find occurence of string in error
	ErrorStringCompare string `protobuf:"bytes,5,opt,name=ErrorStringCompare" json:"ErrorStringCompare,omitempty"`
	// Invert condition
	Not bool `protobuf:"varint,6,opt,name=Not" json:"Not,omitempty"`
}

func (*ActionOutputQuery) Descriptor

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

func (*ActionOutputQuery) GetErrorStringCompare

func (m *ActionOutputQuery) GetErrorStringCompare() string

func (*ActionOutputQuery) GetFailed

func (m *ActionOutputQuery) GetFailed() bool

func (*ActionOutputQuery) GetJsonBodyCompare

func (m *ActionOutputQuery) GetJsonBodyCompare() string

func (*ActionOutputQuery) GetNot

func (m *ActionOutputQuery) GetNot() bool

func (*ActionOutputQuery) GetStringBodyCompare

func (m *ActionOutputQuery) GetStringBodyCompare() string

func (*ActionOutputQuery) GetSuccess

func (m *ActionOutputQuery) GetSuccess() bool

func (*ActionOutputQuery) ProtoMessage

func (*ActionOutputQuery) ProtoMessage()

func (*ActionOutputQuery) Reset

func (m *ActionOutputQuery) Reset()

func (*ActionOutputQuery) String

func (m *ActionOutputQuery) String() string

type ArchiverHandler added in v1.0.2

type ArchiverHandler interface {
	Archive(context.Context, *Query, *StatusResponse) error
}

type ArchiverService added in v1.2.2

type ArchiverService interface {
	Archive(ctx context.Context, in *Query, opts ...client.CallOption) (*StatusResponse, error)
}

func NewArchiverService added in v1.2.2

func NewArchiverService(name string, c client.Client) ArchiverService

type ChangesArchiveQuery added in v1.0.2

type ChangesArchiveQuery struct {
	RemainingRows uint64 `protobuf:"varint,1,opt,name=RemainingRows" json:"RemainingRows,omitempty"`
}

TODO - move from there

func (*ChangesArchiveQuery) Descriptor added in v1.0.2

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

func (*ChangesArchiveQuery) GetRemainingRows added in v1.0.2

func (m *ChangesArchiveQuery) GetRemainingRows() uint64

func (*ChangesArchiveQuery) ProtoMessage added in v1.0.2

func (*ChangesArchiveQuery) ProtoMessage()

func (*ChangesArchiveQuery) Reset added in v1.0.2

func (m *ChangesArchiveQuery) Reset()

func (*ChangesArchiveQuery) String added in v1.0.2

func (m *ChangesArchiveQuery) String() string

type ConcreteQuery

type ConcreteQuery struct {
	Name string      `json:"Name,omitempty"`
	Data interface{} `json:"Data,omitempty"`
}

type Matcher

type Matcher interface {
	// Matches tries to apply a *SingleQuery on an existing object
	Matches(object interface{}) bool
}

Matcher interface provides a way to filter idm objects with standard XXXSingleQueries.

type MatcherParser

type MatcherParser func(o *any.Any) (Matcher, error)

MatcherParser is a generic function to parse a protobuf into Matcher

type MultiMatcher

type MultiMatcher struct {
	Operation OperationType
	// contains filtered or unexported fields
}

MultiMatcher parses a Query and transform it to a recursive tree of Matches

func (*MultiMatcher) Matches

func (mm *MultiMatcher) Matches(object interface{}) bool

Matches implements the Matcher interface

func (*MultiMatcher) Parse

func (mm *MultiMatcher) Parse(q *Query, parser MatcherParser) error

Parse transforms input query into Matcher interfaces

type OperationType

type OperationType int32
const (
	OperationType_OR  OperationType = 0
	OperationType_AND OperationType = 1
)

func (OperationType) EnumDescriptor

func (OperationType) EnumDescriptor() ([]byte, []int)

func (OperationType) String

func (x OperationType) String() string

type Query

type Query struct {
	SubQueries          []*google_protobuf.Any `protobuf:"bytes,1,rep,name=SubQueries" json:"SubQueries,omitempty"`
	Operation           OperationType          `protobuf:"varint,2,opt,name=Operation,enum=service.OperationType" json:"Operation,omitempty"`
	ResourcePolicyQuery *ResourcePolicyQuery   `protobuf:"bytes,3,opt,name=ResourcePolicyQuery" json:"ResourcePolicyQuery,omitempty"`
	Offset              int64                  `protobuf:"varint,4,opt,name=Offset" json:"Offset,omitempty"`
	Limit               int64                  `protobuf:"varint,5,opt,name=Limit" json:"Limit,omitempty"`
	GroupBy             int32                  `protobuf:"varint,6,opt,name=groupBy" json:"groupBy,omitempty"`
}

func (*Query) Descriptor

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

func (*Query) GetGroupBy

func (m *Query) GetGroupBy() int32

func (*Query) GetLimit

func (m *Query) GetLimit() int64

func (*Query) GetOffset

func (m *Query) GetOffset() int64

func (*Query) GetOperation

func (m *Query) GetOperation() OperationType

func (*Query) GetResourcePolicyQuery

func (m *Query) GetResourcePolicyQuery() *ResourcePolicyQuery

func (*Query) GetSubQueries

func (m *Query) GetSubQueries() []*google_protobuf.Any

func (*Query) MarshalJSONPB

func (q *Query) MarshalJSONPB(marshaler *jsonpb.Marshaler) ([]byte, error)

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) String

func (m *Query) String() string

func (*Query) UnmarshalJSONPB

func (q *Query) UnmarshalJSONPB(unmarshaller *jsonpb.Unmarshaler, data []byte) error

type ResourcePoliciesBuilder

type ResourcePoliciesBuilder struct {
	// contains filtered or unexported fields
}

ResourcePoliciesBuilder is a helper for building ResourcePolicies lists

func NewResourcePoliciesBuilder

func NewResourcePoliciesBuilder() *ResourcePoliciesBuilder

NewResourcePoliciesBuilder creates a ResourcePoliciesBuilder

func (*ResourcePoliciesBuilder) Policies

func (r *ResourcePoliciesBuilder) Policies() []*ResourcePolicy

Policies returns internal buffer

func (*ResourcePoliciesBuilder) Reset

Reset clears internal buffer

func (*ResourcePoliciesBuilder) WithOwner

func (r *ResourcePoliciesBuilder) WithOwner(userUuid string) *ResourcePoliciesBuilder

WithOwner appends an owner policy with user uuid

func (*ResourcePoliciesBuilder) WithProfileRead

func (r *ResourcePoliciesBuilder) WithProfileRead(profile string) *ResourcePoliciesBuilder

WithProfileRead appends a read policy for profile:profileName

func (*ResourcePoliciesBuilder) WithProfileWrite

func (r *ResourcePoliciesBuilder) WithProfileWrite(profile string) *ResourcePoliciesBuilder

WithProfileWrite appends a write policy for profile:profileName

func (*ResourcePoliciesBuilder) WithResourcePolicy

func (r *ResourcePoliciesBuilder) WithResourcePolicy(policy *ResourcePolicy) *ResourcePoliciesBuilder

WithResourcePolicy appends arbitrary policy

func (*ResourcePoliciesBuilder) WithStandardUserPolicies

func (r *ResourcePoliciesBuilder) WithStandardUserPolicies(userLogin string) *ResourcePoliciesBuilder

WithStandardUserPolicies is a shortcut for WithProfileWrite(profile:admin).WithProfileRead(profile:standard).WithUserWrite(userLogin)

func (*ResourcePoliciesBuilder) WithUserRead

func (r *ResourcePoliciesBuilder) WithUserRead(login string) *ResourcePoliciesBuilder

WithUserRead appends a read policy for this user:login

func (*ResourcePoliciesBuilder) WithUserWrite

func (r *ResourcePoliciesBuilder) WithUserWrite(login string) *ResourcePoliciesBuilder

WithUserWrite appends a write policy for user:login

type ResourcePolicy

type ResourcePolicy struct {
	Id             int64                       `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Resource       string                      `protobuf:"bytes,2,opt,name=Resource" json:"Resource,omitempty"`
	Action         ResourcePolicyAction        `protobuf:"varint,3,opt,name=Action,enum=service.ResourcePolicyAction" json:"Action,omitempty"`
	Subject        string                      `protobuf:"bytes,4,opt,name=Subject" json:"Subject,omitempty"`
	Effect         ResourcePolicy_PolicyEffect `protobuf:"varint,5,opt,name=Effect,enum=service.ResourcePolicy_PolicyEffect" json:"Effect,omitempty"`
	JsonConditions string                      `protobuf:"bytes,6,opt,name=JsonConditions" json:"JsonConditions,omitempty"`
}

func (*ResourcePolicy) Descriptor

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

func (*ResourcePolicy) GetAction

func (m *ResourcePolicy) GetAction() ResourcePolicyAction

func (*ResourcePolicy) GetEffect

func (*ResourcePolicy) GetId

func (m *ResourcePolicy) GetId() int64

func (*ResourcePolicy) GetJsonConditions

func (m *ResourcePolicy) GetJsonConditions() string

func (*ResourcePolicy) GetResource

func (m *ResourcePolicy) GetResource() string

func (*ResourcePolicy) GetSubject

func (m *ResourcePolicy) GetSubject() string

func (*ResourcePolicy) ProtoMessage

func (*ResourcePolicy) ProtoMessage()

func (*ResourcePolicy) Reset

func (m *ResourcePolicy) Reset()

func (*ResourcePolicy) String

func (m *ResourcePolicy) String() string

type ResourcePolicyAction

type ResourcePolicyAction int32
const (
	ResourcePolicyAction_ANY        ResourcePolicyAction = 0
	ResourcePolicyAction_OWNER      ResourcePolicyAction = 1
	ResourcePolicyAction_READ       ResourcePolicyAction = 2
	ResourcePolicyAction_WRITE      ResourcePolicyAction = 3
	ResourcePolicyAction_EDIT_RULES ResourcePolicyAction = 4
)

func (ResourcePolicyAction) EnumDescriptor

func (ResourcePolicyAction) EnumDescriptor() ([]byte, []int)

func (ResourcePolicyAction) String

func (x ResourcePolicyAction) String() string

type ResourcePolicyQuery

type ResourcePolicyQuery struct {
	Subjects []string `protobuf:"bytes,1,rep,name=Subjects" json:"Subjects,omitempty"`
	Empty    bool     `protobuf:"varint,2,opt,name=Empty" json:"Empty,omitempty"`
	Any      bool     `protobuf:"varint,3,opt,name=Any" json:"Any,omitempty"`
}

func (*ResourcePolicyQuery) Descriptor

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

func (*ResourcePolicyQuery) GetAny

func (m *ResourcePolicyQuery) GetAny() bool

func (*ResourcePolicyQuery) GetEmpty

func (m *ResourcePolicyQuery) GetEmpty() bool

func (*ResourcePolicyQuery) GetSubjects

func (m *ResourcePolicyQuery) GetSubjects() []string

func (*ResourcePolicyQuery) ProtoMessage

func (*ResourcePolicyQuery) ProtoMessage()

func (*ResourcePolicyQuery) Reset

func (m *ResourcePolicyQuery) Reset()

func (*ResourcePolicyQuery) String

func (m *ResourcePolicyQuery) String() string

type ResourcePolicy_PolicyEffect

type ResourcePolicy_PolicyEffect int32
const (
	ResourcePolicy_deny  ResourcePolicy_PolicyEffect = 0
	ResourcePolicy_allow ResourcePolicy_PolicyEffect = 1
)

func (ResourcePolicy_PolicyEffect) EnumDescriptor

func (ResourcePolicy_PolicyEffect) EnumDescriptor() ([]byte, []int)

func (ResourcePolicy_PolicyEffect) String

type Service

type Service interface {
	Status(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*StatusResponse, error)
}

func NewService added in v1.2.2

func NewService(name string, c client.Client) Service

type ServiceHandler

type ServiceHandler interface {
	Status(context.Context, *google_protobuf1.Empty, *StatusResponse) error
}

type SourceSingleQuery

type SourceSingleQuery struct {
	// Regexp to filter context by IP
	IPMask string `protobuf:"bytes,2,opt,name=IPMask" json:"IPMask,omitempty"`
	// Regexp to filter for a given user-agent
	UserAgent string `protobuf:"bytes,3,opt,name=UserAgent" json:"UserAgent,omitempty"`
	// Limit to a given workspaceId
	WorkspaceId string `protobuf:"bytes,4,opt,name=WorkspaceId" json:"WorkspaceId,omitempty"`
	// Invert condition
	Not bool `protobuf:"varint,5,opt,name=Not" json:"Not,omitempty"`
}

func (*SourceSingleQuery) Descriptor

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

func (*SourceSingleQuery) GetIPMask

func (m *SourceSingleQuery) GetIPMask() string

func (*SourceSingleQuery) GetNot

func (m *SourceSingleQuery) GetNot() bool

func (*SourceSingleQuery) GetUserAgent

func (m *SourceSingleQuery) GetUserAgent() string

func (*SourceSingleQuery) GetWorkspaceId

func (m *SourceSingleQuery) GetWorkspaceId() string

func (*SourceSingleQuery) ProtoMessage

func (*SourceSingleQuery) ProtoMessage()

func (*SourceSingleQuery) Reset

func (m *SourceSingleQuery) Reset()

func (*SourceSingleQuery) String

func (m *SourceSingleQuery) String() string

type StarterHandler

type StarterHandler interface {
	Start(context.Context, *google_protobuf1.Empty, *google_protobuf1.Empty) error
}

type StarterService added in v1.2.2

type StarterService interface {
	Start(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*google_protobuf1.Empty, error)
}

func NewStarterService added in v1.2.2

func NewStarterService(name string, c client.Client) StarterService

type StatusResponse

type StatusResponse struct {
	OK      bool   `protobuf:"varint,1,opt,name=OK" json:"OK,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=Address" json:"Address,omitempty"`
}

func (*StatusResponse) Descriptor

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

func (*StatusResponse) GetAddress added in v1.2.2

func (m *StatusResponse) GetAddress() string

func (*StatusResponse) GetOK

func (m *StatusResponse) GetOK() bool

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) Reset

func (m *StatusResponse) Reset()

func (*StatusResponse) String

func (m *StatusResponse) String() string

type StopEvent

type StopEvent struct {
	ServiceName string `protobuf:"bytes,1,opt,name=ServiceName" json:"ServiceName,omitempty"`
}

func (*StopEvent) Descriptor

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

func (*StopEvent) GetServiceName

func (m *StopEvent) GetServiceName() string

func (*StopEvent) ProtoMessage

func (*StopEvent) ProtoMessage()

func (*StopEvent) Reset

func (m *StopEvent) Reset()

func (*StopEvent) String

func (m *StopEvent) String() string

Jump to

Keyboard shortcuts

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