coprocess

package
v2.9.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

README

Coprocess - PoC

This feature makes it possible to write Tyk middleware using your favorite languages.

Proto files

To change the proto files and update the bindings, see proto/ and proto/update_bindings.sh.

Python support

Python support is available, more notes here.

Lua support

Lua support is available as well. Notes here.

gRPC support

Tyk provides support for gRPC, you may use any of the gRPC supported languages (e.g. Ruby, Java, etc.). Check the gRPC support README.

ID Extractor & auth cache

The ID extractor is a very useful mechanism that will let you cache your authentication IDs and prevent certain requests from hitting your CP backend. It takes a set of rules from your API configuration (the rules are set per API).

A sample usage will look like this:

"custom_middleware": {
  "pre": [
    {
      "name": "MyPreMiddleware",
      "require_session": false
    }
  ],
  "id_extractor": {
    "extract_from": "header",
    "extract_with": "value",
    "extractor_config": {
      "header_name": "Authorization"
    }
  },
  "driver": "grpc"
},

Tyk provides a set of ID extractors that aim to cover the most common use cases, a very simple one is the value extractor.

Interoperability

This feature implements an in-process message passing mechanism, based on Protocol Buffers, any supported languages should provide a function to receive, unmarshal and process this kind of messages.

The main interoperability task is achieved by using cgo as a bridge between a supported language -like Python- and the Go codebase.

Your C bridge function must accept and return a CoProcessMessage data structure like the one described in api.h, where p_data is a pointer to the serialized data and length indicates the length of it.

struct CoProcessMessage {
  void* p_data;
  int length;
};

The unpacked data will hold the actual CoProcessObject data structure, where HookType represents the hook type (see below), Request represents the HTTP request and Session is the Tyk session data.

The Spec field holds the API specification data, like organization ID, API ID, etc.

type CoProcessObject struct {
	HookType string
	Request  CoProcessMiniRequestObject
	Session  SessionState
	Metadata map[string]string
	Spec     map[string]string
}

Coprocess Dispatcher

coprocess.Dispatcher describes a very simple interface for implementing the dispatcher logic, the required methods are: Dispatch, DispatchEvent and Reload.

Dispatch accepts a pointer to a struct CoProcessObject (as described above) and must return an object of the same type. This method will be called for every configured hook, on every request. Traditionally this method will perform a single function call on the target language side (like Python_DispatchHook in coprocess_python), and the corresponding logic will be handled from there (mostly because different languages have different ways of loading, referencing or calling middlewares).

DispatchEvent provides a way of dispatching Tyk events to a target language. This method doesn't return any variables but does receive a JSON-encoded object containing the event data. For extensibility purposes, this method doesn't use Protocol Buffers, the input is a []byte, the target language will take this (as a char) and perform the JSON decoding operation.

Reload is called when triggering a hot reload, this method could be useful for reloading scripts or modules in the target language.

Coprocess Dispatcher - Hooks

This component is in charge of dispatching your HTTP requests to the custom middlewares, in the right order. The dispatcher follows the standard middleware chain logic and provides a simple mechanism for "hooking" your custom middleware behavior, the supported hooks are:

Pre: gets executed before any authentication information is extracted from the header or parameter list of the request.

Post: gets executed after the authentication, validation, throttling, and quota-limiting middleware has been executed, just before the request is proxied upstream. Use this to post-process a request before sending it to your upstream API.

PostKeyAuth: gets executed right after the autentication process.

CustomAuthCheck: gets executed as a custom authentication middleware, instead of the standard ones provided by Tyk. Use this to provide your own authentication mechanism.

Coprocess Gateway API

coprocess_api.go provides a bridge between the gateway API and C, any function that needs to be exported should have the export keyword:

//export TykTriggerEvent
func TykTriggerEvent( CEventName *C.char, CPayload *C.char ) {
  eventName := C.GoString(CEventName)
  payload := C.GoString(CPayload)

  FireSystemEvent(tykcommon.TykEvent(eventName), EventMetaDefault{
    Message: payload,
  })
}

You should also expect a header file declaration of this function in api.h, like this:

#ifndef TYK_COPROCESS_API
#define TYK_COPROCESS_API
extern void TykTriggerEvent(char* event_name, char* payload);
#endif

The language binding will include this header file (or declare the function inline) and perform the necessary steps to call it with the appropriate arguments (like a ffi mechanism could do). As a reference, this is how this could be achieved if you're building a Cython module:

cdef extern:
  void TykTriggerEvent(char* event_name, char* payload);

def call():
  event_name = 'my event'.encode('utf-8')
  payload = 'my payload'.encode('utf-8')
  TykTriggerEvent( event_name, payload )

Basic usage

The intended way of using a Coprocess middleware is to specify it as part of an API definition:

"custom_middleware": {
  "pre": [
      {
          "name": "MyPreMiddleware",  
          "require_session": false
      },
      {
          "name": "AnotherPreMiddleware",
          "require_session": false
      }
  ],
  "post": [
    {
      "name": "MyPostMiddleware",
      "require_session": false
    }
  ],
  "post_key_auth": [
    {
      "name": "MyPostKeyAuthMiddleware",
      "require_session": true
    }
  ],
  "auth_check": {
    "name": "MyAuthCheck"
  },
  "driver": "python"
}

It's important to note that all hook types support chaining except the custom auth check (auth_check).

Build notes

It's possible to use a build tag:

go build -tags 'coprocess python'
go build -tags 'coprocess somelanguage'

Each language should implement a CoProcessInit function, this will be called from the main function when the coprocess build tag is used.

Using the coprocess build tag with no language tag will fail.

A standard build is still possible:

go build

coprocess_dummy.go provides a dummy CoProcessInit function that will be called if you perform a standard Tyk build. This file will be ignored when using the coprocess build tag, as we expect it to be implemented by a language.

Tests

You must use the coprocess build tag to run the tests:

go test -tags 'coprocess'
go test -run CoProcess -tags 'coprocess'

References

Trello note

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HookType_name = map[int32]string{
	0: "Unknown",
	1: "Pre",
	2: "Post",
	3: "PostKeyAuth",
	4: "CustomKeyCheck",
}
View Source
var HookType_value = map[string]int32{
	"Unknown":        0,
	"Pre":            1,
	"Post":           2,
	"PostKeyAuth":    3,
	"CustomKeyCheck": 4,
}

Functions

func RegisterDispatcherServer

func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer)

Types

type AccessDefinition

type AccessDefinition struct {
	ApiName              string        `protobuf:"bytes,1,opt,name=api_name,json=apiName,proto3" json:"api_name,omitempty"`
	ApiId                string        `protobuf:"bytes,2,opt,name=api_id,json=apiId,proto3" json:"api_id,omitempty"`
	Versions             []string      `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"`
	AllowedUrls          []*AccessSpec `protobuf:"bytes,4,rep,name=allowed_urls,json=allowedUrls,proto3" json:"allowed_urls,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*AccessDefinition) Descriptor

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

func (*AccessDefinition) GetAllowedUrls

func (m *AccessDefinition) GetAllowedUrls() []*AccessSpec

func (*AccessDefinition) GetApiId

func (m *AccessDefinition) GetApiId() string

func (*AccessDefinition) GetApiName

func (m *AccessDefinition) GetApiName() string

func (*AccessDefinition) GetVersions

func (m *AccessDefinition) GetVersions() []string

func (*AccessDefinition) ProtoMessage

func (*AccessDefinition) ProtoMessage()

func (*AccessDefinition) Reset

func (m *AccessDefinition) Reset()

func (*AccessDefinition) String

func (m *AccessDefinition) String() string

func (*AccessDefinition) XXX_DiscardUnknown

func (m *AccessDefinition) XXX_DiscardUnknown()

func (*AccessDefinition) XXX_Marshal

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

func (*AccessDefinition) XXX_Merge

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

func (*AccessDefinition) XXX_Size

func (m *AccessDefinition) XXX_Size() int

func (*AccessDefinition) XXX_Unmarshal

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

type AccessSpec

type AccessSpec struct {
	Url                  string   `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Methods              []string `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AccessSpec) Descriptor

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

func (*AccessSpec) GetMethods

func (m *AccessSpec) GetMethods() []string

func (*AccessSpec) GetUrl

func (m *AccessSpec) GetUrl() string

func (*AccessSpec) ProtoMessage

func (*AccessSpec) ProtoMessage()

func (*AccessSpec) Reset

func (m *AccessSpec) Reset()

func (*AccessSpec) String

func (m *AccessSpec) String() string

func (*AccessSpec) XXX_DiscardUnknown

func (m *AccessSpec) XXX_DiscardUnknown()

func (*AccessSpec) XXX_Marshal

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

func (*AccessSpec) XXX_Merge

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

func (*AccessSpec) XXX_Size

func (m *AccessSpec) XXX_Size() int

func (*AccessSpec) XXX_Unmarshal

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

type BasicAuthData

type BasicAuthData struct {
	Password             string   `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
	Hash                 string   `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BasicAuthData) Descriptor

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

func (*BasicAuthData) GetHash

func (m *BasicAuthData) GetHash() string

func (*BasicAuthData) GetPassword

func (m *BasicAuthData) GetPassword() string

func (*BasicAuthData) ProtoMessage

func (*BasicAuthData) ProtoMessage()

func (*BasicAuthData) Reset

func (m *BasicAuthData) Reset()

func (*BasicAuthData) String

func (m *BasicAuthData) String() string

func (*BasicAuthData) XXX_DiscardUnknown

func (m *BasicAuthData) XXX_DiscardUnknown()

func (*BasicAuthData) XXX_Marshal

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

func (*BasicAuthData) XXX_Merge

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

func (*BasicAuthData) XXX_Size

func (m *BasicAuthData) XXX_Size() int

func (*BasicAuthData) XXX_Unmarshal

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

type Dispatcher

type Dispatcher interface {
	// Dispatch takes and returns a pointer to a CoProcessMessage struct, see coprocess/api.h for details. This is used by CP bindings.
	Dispatch(*Object) (*Object, error)

	// DispatchEvent takes an event JSON, as bytes. Doesn't return.
	DispatchEvent([]byte)

	// DispatchObject takes and returns a coprocess.Object pointer, this is used by gRPC.
	DispatchObject(*Object) (*Object, error)

	// LoadModules is called the first time a CP binding starts. Used by Lua.
	LoadModules()

	// HandleMiddlewareCache is called when a bundle has been loaded and the dispatcher needs to cache its contents. Used by Lua.
	HandleMiddlewareCache(*apidef.BundleManifest, string)

	// Reload is called when a hot reload is triggered. Used by all the CPs.
	Reload()
}

Dispatcher defines a basic interface for the CP dispatcher, check PythonDispatcher for reference.

type DispatcherClient

type DispatcherClient interface {
	Dispatch(ctx context.Context, in *Object, opts ...grpc.CallOption) (*Object, error)
	DispatchEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*EventReply, error)
}

DispatcherClient is the client API for Dispatcher service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDispatcherClient

func NewDispatcherClient(cc *grpc.ClientConn) DispatcherClient

type DispatcherServer

type DispatcherServer interface {
	Dispatch(context.Context, *Object) (*Object, error)
	DispatchEvent(context.Context, *Event) (*EventReply, error)
}

DispatcherServer is the server API for Dispatcher service.

type Event

type Event struct {
	Payload              string   `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Event) Descriptor

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

func (*Event) GetPayload

func (m *Event) GetPayload() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

func (*Event) XXX_DiscardUnknown

func (m *Event) XXX_DiscardUnknown()

func (*Event) XXX_Marshal

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

func (*Event) XXX_Merge

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

func (*Event) XXX_Size

func (m *Event) XXX_Size() int

func (*Event) XXX_Unmarshal

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

type EventReply

type EventReply struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*EventReply) Descriptor

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

func (*EventReply) ProtoMessage

func (*EventReply) ProtoMessage()

func (*EventReply) Reset

func (m *EventReply) Reset()

func (*EventReply) String

func (m *EventReply) String() string

func (*EventReply) XXX_DiscardUnknown

func (m *EventReply) XXX_DiscardUnknown()

func (*EventReply) XXX_Marshal

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

func (*EventReply) XXX_Merge

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

func (*EventReply) XXX_Size

func (m *EventReply) XXX_Size() int

func (*EventReply) XXX_Unmarshal

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

type HookType

type HookType int32
const (
	HookType_Unknown        HookType = 0
	HookType_Pre            HookType = 1
	HookType_Post           HookType = 2
	HookType_PostKeyAuth    HookType = 3
	HookType_CustomKeyCheck HookType = 4
)

func (HookType) EnumDescriptor

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

func (HookType) String

func (x HookType) String() string

type JWTData

type JWTData struct {
	Secret               string   `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*JWTData) Descriptor

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

func (*JWTData) GetSecret

func (m *JWTData) GetSecret() string

func (*JWTData) ProtoMessage

func (*JWTData) ProtoMessage()

func (*JWTData) Reset

func (m *JWTData) Reset()

func (*JWTData) String

func (m *JWTData) String() string

func (*JWTData) XXX_DiscardUnknown

func (m *JWTData) XXX_DiscardUnknown()

func (*JWTData) XXX_Marshal

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

func (*JWTData) XXX_Merge

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

func (*JWTData) XXX_Size

func (m *JWTData) XXX_Size() int

func (*JWTData) XXX_Unmarshal

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

type MiniRequestObject

type MiniRequestObject struct {
	Headers              map[string]string `` /* 155-byte string literal not displayed */
	SetHeaders           map[string]string `` /* 179-byte string literal not displayed */
	DeleteHeaders        []string          `protobuf:"bytes,3,rep,name=delete_headers,json=deleteHeaders,proto3" json:"delete_headers,omitempty"`
	Body                 string            `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	Url                  string            `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`
	Params               map[string]string `` /* 153-byte string literal not displayed */
	AddParams            map[string]string `` /* 176-byte string literal not displayed */
	ExtendedParams       map[string]string `` /* 191-byte string literal not displayed */
	DeleteParams         []string          `protobuf:"bytes,9,rep,name=delete_params,json=deleteParams,proto3" json:"delete_params,omitempty"`
	ReturnOverrides      *ReturnOverrides  `protobuf:"bytes,10,opt,name=return_overrides,json=returnOverrides,proto3" json:"return_overrides,omitempty"`
	Method               string            `protobuf:"bytes,11,opt,name=method,proto3" json:"method,omitempty"`
	RequestUri           string            `protobuf:"bytes,12,opt,name=request_uri,json=requestUri,proto3" json:"request_uri,omitempty"`
	Scheme               string            `protobuf:"bytes,13,opt,name=scheme,proto3" json:"scheme,omitempty"`
	RawBody              []byte            `protobuf:"bytes,14,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*MiniRequestObject) Descriptor

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

func (*MiniRequestObject) GetAddParams

func (m *MiniRequestObject) GetAddParams() map[string]string

func (*MiniRequestObject) GetBody

func (m *MiniRequestObject) GetBody() string

func (*MiniRequestObject) GetDeleteHeaders

func (m *MiniRequestObject) GetDeleteHeaders() []string

func (*MiniRequestObject) GetDeleteParams

func (m *MiniRequestObject) GetDeleteParams() []string

func (*MiniRequestObject) GetExtendedParams

func (m *MiniRequestObject) GetExtendedParams() map[string]string

func (*MiniRequestObject) GetHeaders

func (m *MiniRequestObject) GetHeaders() map[string]string

func (*MiniRequestObject) GetMethod

func (m *MiniRequestObject) GetMethod() string

func (*MiniRequestObject) GetParams

func (m *MiniRequestObject) GetParams() map[string]string

func (*MiniRequestObject) GetRawBody

func (m *MiniRequestObject) GetRawBody() []byte

func (*MiniRequestObject) GetRequestUri

func (m *MiniRequestObject) GetRequestUri() string

func (*MiniRequestObject) GetReturnOverrides

func (m *MiniRequestObject) GetReturnOverrides() *ReturnOverrides

func (*MiniRequestObject) GetScheme

func (m *MiniRequestObject) GetScheme() string

func (*MiniRequestObject) GetSetHeaders

func (m *MiniRequestObject) GetSetHeaders() map[string]string

func (*MiniRequestObject) GetUrl

func (m *MiniRequestObject) GetUrl() string

func (*MiniRequestObject) ProtoMessage

func (*MiniRequestObject) ProtoMessage()

func (*MiniRequestObject) Reset

func (m *MiniRequestObject) Reset()

func (*MiniRequestObject) String

func (m *MiniRequestObject) String() string

func (*MiniRequestObject) XXX_DiscardUnknown

func (m *MiniRequestObject) XXX_DiscardUnknown()

func (*MiniRequestObject) XXX_Marshal

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

func (*MiniRequestObject) XXX_Merge

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

func (*MiniRequestObject) XXX_Size

func (m *MiniRequestObject) XXX_Size() int

func (*MiniRequestObject) XXX_Unmarshal

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

type Monitor

type Monitor struct {
	TriggerLimits        []float64 `protobuf:"fixed64,1,rep,packed,name=trigger_limits,json=triggerLimits,proto3" json:"trigger_limits,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Monitor) Descriptor

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

func (*Monitor) GetTriggerLimits

func (m *Monitor) GetTriggerLimits() []float64

func (*Monitor) ProtoMessage

func (*Monitor) ProtoMessage()

func (*Monitor) Reset

func (m *Monitor) Reset()

func (*Monitor) String

func (m *Monitor) String() string

func (*Monitor) XXX_DiscardUnknown

func (m *Monitor) XXX_DiscardUnknown()

func (*Monitor) XXX_Marshal

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

func (*Monitor) XXX_Merge

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

func (*Monitor) XXX_Size

func (m *Monitor) XXX_Size() int

func (*Monitor) XXX_Unmarshal

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

type Object

type Object struct {
	HookType             HookType           `protobuf:"varint,1,opt,name=hook_type,json=hookType,proto3,enum=coprocess.HookType" json:"hook_type,omitempty"`
	HookName             string             `protobuf:"bytes,2,opt,name=hook_name,json=hookName,proto3" json:"hook_name,omitempty"`
	Request              *MiniRequestObject `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
	Session              *SessionState      `protobuf:"bytes,4,opt,name=session,proto3" json:"session,omitempty"`
	Metadata             map[string]string  `` /* 157-byte string literal not displayed */
	Spec                 map[string]string  `` /* 149-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*Object) Descriptor

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

func (*Object) GetHookName

func (m *Object) GetHookName() string

func (*Object) GetHookType

func (m *Object) GetHookType() HookType

func (*Object) GetMetadata

func (m *Object) GetMetadata() map[string]string

func (*Object) GetRequest

func (m *Object) GetRequest() *MiniRequestObject

func (*Object) GetSession

func (m *Object) GetSession() *SessionState

func (*Object) GetSpec

func (m *Object) GetSpec() map[string]string

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) Reset

func (m *Object) Reset()

func (*Object) String

func (m *Object) String() string

func (*Object) XXX_DiscardUnknown

func (m *Object) XXX_DiscardUnknown()

func (*Object) XXX_Marshal

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

func (*Object) XXX_Merge

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

func (*Object) XXX_Size

func (m *Object) XXX_Size() int

func (*Object) XXX_Unmarshal

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

type ReturnOverrides

type ReturnOverrides struct {
	ResponseCode         int32             `protobuf:"varint,1,opt,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"`
	ResponseError        string            `protobuf:"bytes,2,opt,name=response_error,json=responseError,proto3" json:"response_error,omitempty"`
	Headers              map[string]string `` /* 155-byte string literal not displayed */
	OverrideError        bool              `protobuf:"varint,4,opt,name=override_error,json=overrideError,proto3" json:"override_error,omitempty"`
	ResponseBody         string            `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ReturnOverrides) Descriptor

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

func (*ReturnOverrides) GetHeaders

func (m *ReturnOverrides) GetHeaders() map[string]string

func (*ReturnOverrides) GetOverrideError

func (m *ReturnOverrides) GetOverrideError() bool

func (*ReturnOverrides) GetResponseBody

func (m *ReturnOverrides) GetResponseBody() string

func (*ReturnOverrides) GetResponseCode

func (m *ReturnOverrides) GetResponseCode() int32

func (*ReturnOverrides) GetResponseError

func (m *ReturnOverrides) GetResponseError() string

func (*ReturnOverrides) ProtoMessage

func (*ReturnOverrides) ProtoMessage()

func (*ReturnOverrides) Reset

func (m *ReturnOverrides) Reset()

func (*ReturnOverrides) String

func (m *ReturnOverrides) String() string

func (*ReturnOverrides) XXX_DiscardUnknown

func (m *ReturnOverrides) XXX_DiscardUnknown()

func (*ReturnOverrides) XXX_Marshal

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

func (*ReturnOverrides) XXX_Merge

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

func (*ReturnOverrides) XXX_Size

func (m *ReturnOverrides) XXX_Size() int

func (*ReturnOverrides) XXX_Unmarshal

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

type SessionState

type SessionState struct {
	LastCheck               int64                        `protobuf:"varint,1,opt,name=last_check,json=lastCheck,proto3" json:"last_check,omitempty"`
	Allowance               float64                      `protobuf:"fixed64,2,opt,name=allowance,proto3" json:"allowance,omitempty"`
	Rate                    float64                      `protobuf:"fixed64,3,opt,name=rate,proto3" json:"rate,omitempty"`
	Per                     float64                      `protobuf:"fixed64,4,opt,name=per,proto3" json:"per,omitempty"`
	Expires                 int64                        `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"`
	QuotaMax                int64                        `protobuf:"varint,6,opt,name=quota_max,json=quotaMax,proto3" json:"quota_max,omitempty"`
	QuotaRenews             int64                        `protobuf:"varint,7,opt,name=quota_renews,json=quotaRenews,proto3" json:"quota_renews,omitempty"`
	QuotaRemaining          int64                        `protobuf:"varint,8,opt,name=quota_remaining,json=quotaRemaining,proto3" json:"quota_remaining,omitempty"`
	QuotaRenewalRate        int64                        `protobuf:"varint,9,opt,name=quota_renewal_rate,json=quotaRenewalRate,proto3" json:"quota_renewal_rate,omitempty"`
	AccessRights            map[string]*AccessDefinition `` /* 186-byte string literal not displayed */
	OrgId                   string                       `protobuf:"bytes,11,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	OauthClientId           string                       `protobuf:"bytes,12,opt,name=oauth_client_id,json=oauthClientId,proto3" json:"oauth_client_id,omitempty"`
	OauthKeys               map[string]string            `` /* 177-byte string literal not displayed */
	BasicAuthData           *BasicAuthData               `protobuf:"bytes,14,opt,name=basic_auth_data,json=basicAuthData,proto3" json:"basic_auth_data,omitempty"`
	JwtData                 *JWTData                     `protobuf:"bytes,15,opt,name=jwt_data,json=jwtData,proto3" json:"jwt_data,omitempty"`
	HmacEnabled             bool                         `protobuf:"varint,16,opt,name=hmac_enabled,json=hmacEnabled,proto3" json:"hmac_enabled,omitempty"`
	HmacSecret              string                       `protobuf:"bytes,17,opt,name=hmac_secret,json=hmacSecret,proto3" json:"hmac_secret,omitempty"`
	IsInactive              bool                         `protobuf:"varint,18,opt,name=is_inactive,json=isInactive,proto3" json:"is_inactive,omitempty"`
	ApplyPolicyId           string                       `protobuf:"bytes,19,opt,name=apply_policy_id,json=applyPolicyId,proto3" json:"apply_policy_id,omitempty"`
	DataExpires             int64                        `protobuf:"varint,20,opt,name=data_expires,json=dataExpires,proto3" json:"data_expires,omitempty"`
	Monitor                 *Monitor                     `protobuf:"bytes,21,opt,name=monitor,proto3" json:"monitor,omitempty"`
	EnableDetailedRecording bool                         `` /* 134-byte string literal not displayed */
	Metadata                map[string]string            `` /* 158-byte string literal not displayed */
	Tags                    []string                     `protobuf:"bytes,24,rep,name=tags,proto3" json:"tags,omitempty"`
	Alias                   string                       `protobuf:"bytes,25,opt,name=alias,proto3" json:"alias,omitempty"`
	LastUpdated             string                       `protobuf:"bytes,26,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	IdExtractorDeadline     int64                        `protobuf:"varint,27,opt,name=id_extractor_deadline,json=idExtractorDeadline,proto3" json:"id_extractor_deadline,omitempty"`
	SessionLifetime         int64                        `protobuf:"varint,28,opt,name=session_lifetime,json=sessionLifetime,proto3" json:"session_lifetime,omitempty"`
	ApplyPolicies           []string                     `protobuf:"bytes,29,rep,name=apply_policies,json=applyPolicies,proto3" json:"apply_policies,omitempty"`
	Certificate             string                       `protobuf:"bytes,30,opt,name=certificate,proto3" json:"certificate,omitempty"`
	XXX_NoUnkeyedLiteral    struct{}                     `json:"-"`
	XXX_unrecognized        []byte                       `json:"-"`
	XXX_sizecache           int32                        `json:"-"`
}

func (*SessionState) Descriptor

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

func (*SessionState) GetAccessRights

func (m *SessionState) GetAccessRights() map[string]*AccessDefinition

func (*SessionState) GetAlias

func (m *SessionState) GetAlias() string

func (*SessionState) GetAllowance

func (m *SessionState) GetAllowance() float64

func (*SessionState) GetApplyPolicies

func (m *SessionState) GetApplyPolicies() []string

func (*SessionState) GetApplyPolicyId

func (m *SessionState) GetApplyPolicyId() string

func (*SessionState) GetBasicAuthData

func (m *SessionState) GetBasicAuthData() *BasicAuthData

func (*SessionState) GetCertificate

func (m *SessionState) GetCertificate() string

func (*SessionState) GetDataExpires

func (m *SessionState) GetDataExpires() int64

func (*SessionState) GetEnableDetailedRecording

func (m *SessionState) GetEnableDetailedRecording() bool

func (*SessionState) GetExpires

func (m *SessionState) GetExpires() int64

func (*SessionState) GetHmacEnabled

func (m *SessionState) GetHmacEnabled() bool

func (*SessionState) GetHmacSecret

func (m *SessionState) GetHmacSecret() string

func (*SessionState) GetIdExtractorDeadline

func (m *SessionState) GetIdExtractorDeadline() int64

func (*SessionState) GetIsInactive

func (m *SessionState) GetIsInactive() bool

func (*SessionState) GetJwtData

func (m *SessionState) GetJwtData() *JWTData

func (*SessionState) GetLastCheck

func (m *SessionState) GetLastCheck() int64

func (*SessionState) GetLastUpdated

func (m *SessionState) GetLastUpdated() string

func (*SessionState) GetMetadata

func (m *SessionState) GetMetadata() map[string]string

func (*SessionState) GetMonitor

func (m *SessionState) GetMonitor() *Monitor

func (*SessionState) GetOauthClientId

func (m *SessionState) GetOauthClientId() string

func (*SessionState) GetOauthKeys

func (m *SessionState) GetOauthKeys() map[string]string

func (*SessionState) GetOrgId

func (m *SessionState) GetOrgId() string

func (*SessionState) GetPer

func (m *SessionState) GetPer() float64

func (*SessionState) GetQuotaMax

func (m *SessionState) GetQuotaMax() int64

func (*SessionState) GetQuotaRemaining

func (m *SessionState) GetQuotaRemaining() int64

func (*SessionState) GetQuotaRenewalRate

func (m *SessionState) GetQuotaRenewalRate() int64

func (*SessionState) GetQuotaRenews

func (m *SessionState) GetQuotaRenews() int64

func (*SessionState) GetRate

func (m *SessionState) GetRate() float64

func (*SessionState) GetSessionLifetime

func (m *SessionState) GetSessionLifetime() int64

func (*SessionState) GetTags

func (m *SessionState) GetTags() []string

func (*SessionState) ProtoMessage

func (*SessionState) ProtoMessage()

func (*SessionState) Reset

func (m *SessionState) Reset()

func (*SessionState) String

func (m *SessionState) String() string

func (*SessionState) XXX_DiscardUnknown

func (m *SessionState) XXX_DiscardUnknown()

func (*SessionState) XXX_Marshal

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

func (*SessionState) XXX_Merge

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

func (*SessionState) XXX_Size

func (m *SessionState) XXX_Size() int

func (*SessionState) XXX_Unmarshal

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

type StringSlice

type StringSlice struct {
	Items                []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StringSlice) Descriptor

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

func (*StringSlice) GetItems

func (m *StringSlice) GetItems() []string

func (*StringSlice) ProtoMessage

func (*StringSlice) ProtoMessage()

func (*StringSlice) Reset

func (m *StringSlice) Reset()

func (*StringSlice) String

func (m *StringSlice) String() string

func (*StringSlice) XXX_DiscardUnknown

func (m *StringSlice) XXX_DiscardUnknown()

func (*StringSlice) XXX_Marshal

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

func (*StringSlice) XXX_Merge

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

func (*StringSlice) XXX_Size

func (m *StringSlice) XXX_Size() int

func (*StringSlice) XXX_Unmarshal

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

type UnimplementedDispatcherServer

type UnimplementedDispatcherServer struct {
}

UnimplementedDispatcherServer can be embedded to have forward compatible implementations.

func (*UnimplementedDispatcherServer) Dispatch

func (*UnimplementedDispatcherServer) DispatchEvent

func (*UnimplementedDispatcherServer) DispatchEvent(ctx context.Context, req *Event) (*EventReply, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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