-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DX-1084] Add documentation to protobuf source code files for review #6251
base: master
Are you sure you want to change the base?
Conversation
API Changes --- prev.txt 2024-05-30 17:21:38.886341262 +0000
+++ current.txt 2024-05-30 17:21:35.550273882 +0000
@@ -6283,12 +6283,23 @@
TYPES
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"`
+
+ // The name of the API that the session request relates to
+ ApiName string `protobuf:"bytes,1,opt,name=api_name,json=apiName,proto3" json:"api_name,omitempty"`
+ // The ID of the API that the session request relates to
+ ApiId string `protobuf:"bytes,2,opt,name=api_id,json=apiId,proto3" json:"api_id,omitempty"`
+ // List of allowed API versions, e.g. `"versions": [ "Default" ]`
+ Versions []string `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"`
+ // List of AccessSpec instances. Each instance defines a URL (endpoint)
+ // with an associated allowed list of methods. If all URLs (endpoints) are allowed then the
+ // attribute is not set.
AllowedUrls []*AccessSpec `protobuf:"bytes,4,rep,name=allowed_urls,json=allowedUrls,proto3" json:"allowed_urls,omitempty"`
// Has unexported fields.
}
+ Defined as an attribute within a SessionState instance. Contains the allowed
+ versions and URLs (endpoints) for the API that the session request relates
+ to. Each URL (endpoint) specifies an associated list of allowed methods.
+ See also AccessSpec
func (*AccessDefinition) Descriptor() ([]byte, []int)
Deprecated: Use AccessDefinition.ProtoReflect.Descriptor instead.
@@ -6310,10 +6321,15 @@
func (x *AccessDefinition) String() string
type AccessSpec struct {
- Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
+
+ // A URL (endpoint) belonging to the API associated with the request session
+ Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
+ // List of allowed methods for the URL (endpoint), e.g. 'methods': [ 'GET'. 'POST', 'PUT', 'PATCH' ]
+ // The list of methods are case sensitive
Methods []string `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"`
// Has unexported fields.
}
+ Defines an API's URL (endpoint) and associated list of allowed methods
func (*AccessSpec) Descriptor() ([]byte, []int)
Deprecated: Use AccessSpec.ProtoReflect.Descriptor instead.
@@ -6331,10 +6347,14 @@
func (x *AccessSpec) String() string
type BasicAuthData struct {
+
+ // A hashed password
Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
- Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
+ // Name of the hashing algorithm used to hash the password, e.g. bcrypt, Argon2
+ Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
// Has unexported fields.
}
+ Contains a hashed password and the name of the hashing algorithm used
func (*BasicAuthData) Descriptor() ([]byte, []int)
Deprecated: Use BasicAuthData.ProtoReflect.Descriptor instead.
@@ -6374,7 +6394,9 @@
PythonDispatcher for reference.
type DispatcherClient interface {
+ // Accepts and returns an Object
Dispatch(ctx context.Context, in *Object, opts ...grpc.CallOption) (*Object, error)
+ // Dispatches an event to the target language
DispatchEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*EventReply, error)
}
DispatcherClient is the client API for Dispatcher service.
@@ -6385,7 +6407,9 @@
func NewDispatcherClient(cc grpc.ClientConnInterface) DispatcherClient
type DispatcherServer interface {
+ // Accepts and returns an Object
Dispatch(context.Context, *Object) (*Object, error)
+ // Dispatches an event to the target language
DispatchEvent(context.Context, *Event) (*EventReply, error)
}
DispatcherServer is the server API for Dispatcher service. All
@@ -6393,9 +6417,12 @@
compatibility
type Event struct {
+
+ // The JSON payload
Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// Has unexported fields.
}
+ An event is represented as a JSON payload
func (*Event) Descriptor() ([]byte, []int)
Deprecated: Use Event.ProtoReflect.Descriptor instead.
@@ -6413,6 +6440,7 @@
type EventReply struct {
// Has unexported fields.
}
+ Response for event
func (*EventReply) Descriptor() ([]byte, []int)
Deprecated: Use EventReply.ProtoReflect.Descriptor instead.
@@ -6426,10 +6454,14 @@
func (x *EventReply) String() string
type Header struct {
- Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+
+ // The header name
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+ // * List of values representing the header content
Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
// Has unexported fields.
}
+ A reponse header that contains multiple associated values
func (*Header) Descriptor() ([]byte, []int)
Deprecated: Use Header.ProtoReflect.Descriptor instead.
@@ -6447,14 +6479,35 @@
func (x *Header) String() string
type HookType int32
+ Plugin hooks
+
+ Used to identify the type of plugin
const (
- HookType_Unknown HookType = 0
- HookType_Pre HookType = 1
- HookType_Post HookType = 2
- HookType_PostKeyAuth HookType = 3
+ // Use for error checking and handling of an unrecognised hook type.
+ HookType_Unknown HookType = 0
+ // Executed before request sent to upstream target and before any
+ // authentication information is extracted from the header or
+ // parameter list of the request. Applies to both keyless and protected
+ // APIs.
+ HookType_Pre HookType = 1
+ // Executed after 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 upstream API. This is only called
+ // when using protected APIs.
+ HookType_Post HookType = 2
+ // Executed after 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 upstream API. This is only called
+ // when using protected APIs.
+ HookType_PostKeyAuth HookType = 3
+ // Executed for performing customised authentication.
HookType_CustomKeyCheck HookType = 4
- HookType_Response HookType = 5
+ // Executed after the upstream API replies. The arguments passed to this hook include
+ // both the request and response data. Use this to modify the HTTP response before it’s
+ // sent to the client. This hook also receives the request object, the session object,
+ // the metadata and API definition associated with the request.
+ HookType_Response HookType = 5
)
func (HookType) Descriptor() protoreflect.EnumDescriptor
@@ -6470,9 +6523,13 @@
func (HookType) Type() protoreflect.EnumType
type JWTData struct {
+
+ // The shared secret
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
// Has unexported fields.
}
+ Added to sessions where a Tyk key (embedding a shared secret) is used as the
+ public key for signing the JWT. This message contains the shared secret
func (*JWTData) Descriptor() ([]byte, []int)
Deprecated: Use JWTData.ProtoReflect.Descriptor instead.
@@ -6488,22 +6545,39 @@
func (x *JWTData) String() string
type MiniRequestObject struct {
- Headers map[string]string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- SetHeaders map[string]string `protobuf:"bytes,2,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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 `protobuf:"bytes,6,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- AddParams map[string]string `protobuf:"bytes,7,rep,name=add_params,json=addParams,proto3" json:"add_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- ExtendedParams map[string]string `protobuf:"bytes,8,rep,name=extended_params,json=extendedParams,proto3" json:"extended_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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"`
+
+ // A read-only field for reading headers injected by previous middleware
+ Headers map[string]string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Map of header key values to append to the request
+ SetHeaders map[string]string `protobuf:"bytes,2,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // List of header names to be removed from the request
+ DeleteHeaders []string `protobuf:"bytes,3,rep,name=delete_headers,json=deleteHeaders,proto3" json:"delete_headers,omitempty"`
+ // Request body
+ Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
+ // Request URL
+ Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`
+ // Read only map of request params
+ Params map[string]string `protobuf:"bytes,6,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Map of parameter keys and values to add to the request
+ AddParams map[string]string `protobuf:"bytes,7,rep,name=add_params,json=addParams,proto3" json:"add_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Allows a parameter to have multiple values, currently unsupported
+ ExtendedParams map[string]string `protobuf:"bytes,8,rep,name=extended_params,json=extendedParams,proto3" json:"extended_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // List of parameter keys to be removed from the request
+ DeleteParams []string `protobuf:"bytes,9,rep,name=delete_params,json=deleteParams,proto3" json:"delete_params,omitempty"`
+ // Override the response for the request, see ReturnOverrides
+ ReturnOverrides *ReturnOverrides `protobuf:"bytes,10,opt,name=return_overrides,json=returnOverrides,proto3" json:"return_overrides,omitempty"`
+ // Request method, eg GET, POST, etc
+ Method string `protobuf:"bytes,11,opt,name=method,proto3" json:"method,omitempty"`
+ // The raw unprocessed request URL, including query string and fragments
+ RequestUri string `protobuf:"bytes,12,opt,name=request_uri,json=requestUri,proto3" json:"request_uri,omitempty"`
+ // The URL scheme, e.g. http or https
+ Scheme string `protobuf:"bytes,13,opt,name=scheme,proto3" json:"scheme,omitempty"`
+ // The raw request body
+ RawBody []byte `protobuf:"bytes,14,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"`
// Has unexported fields.
}
+ Used for middleware calls and contains important fields like headers,
+ parameters, body and URL.
func (*MiniRequestObject) Descriptor() ([]byte, []int)
Deprecated: Use MiniRequestObject.ProtoReflect.Descriptor instead.
@@ -6545,9 +6619,14 @@
func (x *MiniRequestObject) String() string
type Monitor struct {
+
+ // List of quota percentage limits, defined in descending order
TriggerLimits []float64 `protobuf:"fixed64,1,rep,packed,name=trigger_limits,json=triggerLimits,proto3" json:"trigger_limits,omitempty"`
// Has unexported fields.
}
+ Monitors allow API endpoint users, stakeholders or an organisation to be
+ notified by webhook when certain quota limits have been reached for their
+ session token.
func (*Monitor) Descriptor() ([]byte, []int)
Deprecated: Use Monitor.ProtoReflect.Descriptor instead.
@@ -6563,15 +6642,28 @@
func (x *Monitor) String() string
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 `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- Spec map[string]string `protobuf:"bytes,6,rep,name=spec,proto3" json:"spec,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- Response *ResponseObject `protobuf:"bytes,7,opt,name=response,proto3" json:"response,omitempty"`
- // Has unexported fields.
-}
+
+ // The plugin hook type
+ HookType HookType `protobuf:"varint,1,opt,name=hook_type,json=hookType,proto3,enum=coprocess.HookType" json:"hook_type,omitempty"`
+ // The plugin name
+ HookName string `protobuf:"bytes,2,opt,name=hook_name,json=hookName,proto3" json:"hook_name,omitempty"`
+ // The main request data structure used by rich plugins. It’s used for middleware calls
+ // and contains important fields like headers, parameters, body and URL
+ Request *MiniRequestObject `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
+ // Stores information about the current key/user that’s used for authentication
+ Session *SessionState `protobuf:"bytes,4,opt,name=session,proto3" json:"session,omitempty"`
+ // Contains the metadata. This is a dynamic field
+ Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Contains information about API definition, including APIID, OrgID and config_data
+ Spec map[string]string `protobuf:"bytes,6,rep,name=spec,proto3" json:"spec,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // The ResponseObject is used by response hooks. The fields are populated with the upstream HTTP
+ // response data. All the field contents can be modified.
+ Response *ResponseObject `protobuf:"bytes,7,opt,name=response,proto3" json:"response,omitempty"`
+ // Has unexported fields.
+}
+ Wraps a MiniRequestObject and contains additional fields that are useful for
+ users that implement their own request dispatchers, like the middleware hook
+ type and name
func (*Object) Descriptor() ([]byte, []int)
Deprecated: Use Object.ProtoReflect.Descriptor instead.
@@ -6599,13 +6691,20 @@
func (x *Object) String() string
type ResponseObject struct {
- StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
- RawBody []byte `protobuf:"bytes,2,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"`
- Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
- Headers map[string]string `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- MultivalueHeaders []*Header `protobuf:"bytes,5,rep,name=multivalue_headers,json=multivalueHeaders,proto3" json:"multivalue_headers,omitempty"`
+
+ // HTTP status code received from the upstream
+ StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
+ // Raw bytes of HTTP response body
+ RawBody []byte `protobuf:"bytes,2,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"`
+ // HTTP response body. Excluded when the raw_body contains invalid UTF-8 characters
+ Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
+ // Headers received from the upstream
+ Headers map[string]string `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // A list of headers. Useful when header has multiple values. See Header
+ MultivalueHeaders []*Header `protobuf:"bytes,5,rep,name=multivalue_headers,json=multivalueHeaders,proto3" json:"multivalue_headers,omitempty"`
// Has unexported fields.
}
+ Used by response hooks. All fields are modifiable
func (*ResponseObject) Descriptor() ([]byte, []int)
Deprecated: Use ResponseObject.ProtoReflect.Descriptor instead.
@@ -6629,13 +6728,23 @@
func (x *ResponseObject) String() string
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 `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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"`
+
+ // Override upstream response status code
+ ResponseCode int32 `protobuf:"varint,1,opt,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"`
+ // Override upstream response error message
+ ResponseError string `protobuf:"bytes,2,opt,name=response_error,json=responseError,proto3" json:"response_error,omitempty"`
+ // Override upstream response headers
+ Headers map[string]string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // If true then override upstream error response with response_error
+ OverrideError bool `protobuf:"varint,4,opt,name=override_error,json=overrideError,proto3" json:"override_error,omitempty"`
+ // Alias of response_error, contains the response body
+ ResponseBody string `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"`
// Has unexported fields.
}
+ Used to override the response for a given HTTP request
+
+ When returned within an Object for a given HTTP request, the upstream
+ reponse is replaced with the fields encapsulated within ReturnOverrides
func (*ReturnOverrides) Descriptor() ([]byte, []int)
Deprecated: Use ReturnOverrides.ProtoReflect.Descriptor instead.
@@ -6659,39 +6768,99 @@
func (x *ReturnOverrides) String() string
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 `protobuf:"bytes,10,rep,name=access_rights,json=accessRights,proto3" json:"access_rights,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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 `protobuf:"bytes,13,rep,name=oauth_keys,json=oauthKeys,proto3" json:"oauth_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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 `protobuf:"varint,22,opt,name=enable_detailed_recording,json=enableDetailedRecording,proto3" json:"enable_detailed_recording,omitempty"`
- Metadata map[string]string `protobuf:"bytes,23,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- 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"`
- MaxQueryDepth int64 `protobuf:"varint,31,opt,name=max_query_depth,json=maxQueryDepth,proto3" json:"max_query_depth,omitempty"`
- // Has unexported fields.
-}
+
+ // Deprecated
+ LastCheck int64 `protobuf:"varint,1,opt,name=last_check,json=lastCheck,proto3" json:"last_check,omitempty"`
+ // Deprecated, replaced by rate
+ Allowance float64 `protobuf:"fixed64,2,opt,name=allowance,proto3" json:"allowance,omitempty"`
+ // The number of requests that are allowed in the specified rate limiting window
+ Rate float64 `protobuf:"fixed64,3,opt,name=rate,proto3" json:"rate,omitempty"`
+ // The duration of the rate window, in seconds
+ Per float64 `protobuf:"fixed64,4,opt,name=per,proto3" json:"per,omitempty"`
+ // An epoch that defines when the key should expire
+ Expires int64 `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"`
+ // The maximum number of requests allowed during the quota period
+ QuotaMax int64 `protobuf:"varint,6,opt,name=quota_max,json=quotaMax,proto3" json:"quota_max,omitempty"`
+ // An epoch that defines when the quota renews
+ QuotaRenews int64 `protobuf:"varint,7,opt,name=quota_renews,json=quotaRenews,proto3" json:"quota_renews,omitempty"`
+ // The number of requests remaining for this user’s quota (unrelated to rate
+ // limit)
+ QuotaRemaining int64 `protobuf:"varint,8,opt,name=quota_remaining,json=quotaRemaining,proto3" json:"quota_remaining,omitempty"`
+ // The time in seconds during which the quota is valid.
+ // So for 1000 requests per hour, this value would be 3600 while quota_max and
+ // quota_remaining would be 1000
+ QuotaRenewalRate int64 `protobuf:"varint,9,opt,name=quota_renewal_rate,json=quotaRenewalRate,proto3" json:"quota_renewal_rate,omitempty"`
+ // Maps the session's API ID to an AccessDefinition. The AccessDefinition defines the access rights for the API in terms
+ // of allowed: versions and URLs(endpoints). Each URL (endpoint) has a list of allowed methods.
+ AccessRights map[string]*AccessDefinition `protobuf:"bytes,10,rep,name=access_rights,json=accessRights,proto3" json:"access_rights,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // The organisation the session user belongs to. This can be used in conjunction with the org_id
+ // setting in the API Definition object to have tokens owned by organisations
+ OrgId string `protobuf:"bytes,11,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
+ // OAuth client ID that is set if the token is generated by an OAuth client during an
+ // OAuth authorisation flow
+ OauthClientId string `protobuf:"bytes,12,opt,name=oauth_client_id,json=oauthClientId,proto3" json:"oauth_client_id,omitempty"`
+ // Maps an OAuth client ID with a corresponding access token value. Currently unsupported and under development
+ OauthKeys map[string]string `protobuf:"bytes,13,rep,name=oauth_keys,json=oauthKeys,proto3" json:"oauth_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Contains a hashed password and the name of the hashing algorithm used
+ BasicAuthData *BasicAuthData `protobuf:"bytes,14,opt,name=basic_auth_data,json=basicAuthData,proto3" json:"basic_auth_data,omitempty"`
+ // Added to sessions where a Tyk key (embedding a shared secret) is used as the public key
+ // for signing the JWT. The JWT token's KID header value references the ID of a Tyk key
+ JwtData *JWTData `protobuf:"bytes,15,opt,name=jwt_data,json=jwtData,proto3" json:"jwt_data,omitempty"`
+ // When set to `true` this indicates generation of a HMAC signature using the secret provided in `hmac_secret`.
+ // If the generated signature matches the signature provided in the Authorizaton header then authentication of
+ // the request has passed
+ HmacEnabled bool `protobuf:"varint,16,opt,name=hmac_enabled,json=hmacEnabled,proto3" json:"hmac_enabled,omitempty"`
+ // The HMAC secret
+ HmacSecret string `protobuf:"bytes,17,opt,name=hmac_secret,json=hmacSecret,proto3" json:"hmac_secret,omitempty"`
+ // Access is denied when this is set to true
+ IsInactive bool `protobuf:"varint,18,opt,name=is_inactive,json=isInactive,proto3" json:"is_inactive,omitempty"`
+ // The policy ID that is bound to the token. Deprecated use apply_policies instead
+ ApplyPolicyId string `protobuf:"bytes,19,opt,name=apply_policy_id,json=applyPolicyId,proto3" json:"apply_policy_id,omitempty"`
+ // A value, in seconds, that defines when data generated by the session token expires in
+ // the analytics DB (must be using Pro edition and MongoDB)
+ DataExpires int64 `protobuf:"varint,20,opt,name=data_expires,json=dataExpires,proto3" json:"data_expires,omitempty"`
+ // Quota monitor settings, currently unsupported in gRPC sessions
+ Monitor *Monitor `protobuf:"bytes,21,opt,name=monitor,proto3" json:"monitor,omitempty"`
+ // Set this value to true to have Tyk store the inbound request and outbound
+ // response data in HTTP Wire format as part of the analytics data
+ EnableDetailedRecording bool `protobuf:"varint,22,opt,name=enable_detailed_recording,json=enableDetailedRecording,proto3" json:"enable_detailed_recording,omitempty"`
+ // Meta data to be included as part of the session that can be used in other
+ // middleware such as transforms and header injection to embed user-specific
+ // data into a request, or alternatively to query the providence of a key
+ Metadata map[string]string `protobuf:"bytes,23,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // List of tags to embed into analytics data when the request completes. If a policy
+ // has tags, those tags take precedence and are used instead
+ Tags []string `protobuf:"bytes,24,rep,name=tags,proto3" json:"tags,omitempty"`
+ // Identifier for the token for use in analytics, to allow easier tracing of hashed
+ // and unhashed tokens
+ Alias string `protobuf:"bytes,25,opt,name=alias,proto3" json:"alias,omitempty"`
+ // A timestamp that represents the time the session was last updated.
+ // With *PostAuth* hooks this is a UNIX timestamp
+ LastUpdated string `protobuf:"bytes,26,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
+ // UNIX timestamp that signifies when a cached key or ID will expire.
+ // This relates to custom authentication, where authenticated keys can be cached to save repeated requests
+ // to the gRPC server.
+ IdExtractorDeadline int64 `protobuf:"varint,27,opt,name=id_extractor_deadline,json=idExtractorDeadline,proto3" json:"id_extractor_deadline,omitempty"`
+ // UNIX timestamp that denotes when the key will automatically expire.
+ // Any·subsequent API request made using the key will be rejected.
+ // Overrides the global session lifetime.
+ SessionLifetime int64 `protobuf:"varint,28,opt,name=session_lifetime,json=sessionLifetime,proto3" json:"session_lifetime,omitempty"`
+ // List of IDs for the policies that are bound to the token
+ ApplyPolicies []string `protobuf:"bytes,29,rep,name=apply_policies,json=applyPolicies,proto3" json:"apply_policies,omitempty"`
+ // The client certificate used to authenticate the request. Exists in the session instance if mTLS is configured
+ // for the API. Currently unsupported
+ Certificate string `protobuf:"bytes,30,opt,name=certificate,proto3" json:"certificate,omitempty"`
+ // For graphQL APIs, if the session key has a maximum query depth limit defined then it is included in the
+ // session instance. Currently unsupported and under development
+ MaxQueryDepth int64 `protobuf:"varint,31,opt,name=max_query_depth,json=maxQueryDepth,proto3" json:"max_query_depth,omitempty"`
+ // Has unexported fields.
+}
+ Created for every authenticated request and stored in Redis.
+
+ Used to track the activity of a given key in different ways, mainly by the
+ built-in Tyk middleware such as the quota middleware or the rate limiter.
+ A GRPC plugin is able to create a SessionState object and store it in the
+ same way built-in authentication mechanisms do
func (*SessionState) Descriptor() ([]byte, []int)
Deprecated: Use SessionState.ProtoReflect.Descriptor instead.
@@ -6767,9 +6936,12 @@
func (x *SessionState) String() string
type StringSlice struct {
+
+ // List of string items
Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
// Has unexported fields.
}
+ List of strings
func (*StringSlice) Descriptor() ([]byte, []int)
Deprecated: Use StringSlice.ProtoReflect.Descriptor instead. |
PR Description updated to latest commit (2bd312e) |
💥 CI tests failed 🙈git-statediff --git a/coprocess/coprocess_common.pb.go b/coprocess/coprocess_common.pb.go
index bdc0686..ccd0561 100644
--- a/coprocess/coprocess_common.pb.go
+++ b/coprocess/coprocess_common.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_mini_request_object.pb.go b/coprocess/coprocess_mini_request_object.pb.go
index 07136e3..184464b 100644
--- a/coprocess/coprocess_mini_request_object.pb.go
+++ b/coprocess/coprocess_mini_request_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_object.pb.go b/coprocess/coprocess_object.pb.go
index b3b4cd1..6fab2b8 100644
--- a/coprocess/coprocess_object.pb.go
+++ b/coprocess/coprocess_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_object_grpc.pb.go b/coprocess/coprocess_object_grpc.pb.go
index 8b48ff7..8423d03 100644
--- a/coprocess/coprocess_object_grpc.pb.go
+++ b/coprocess/coprocess_object_grpc.pb.go
@@ -8,6 +8,7 @@ package coprocess
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/coprocess/coprocess_response_object.pb.go b/coprocess/coprocess_response_object.pb.go
index 87283f3..3970c8b 100644
--- a/coprocess/coprocess_response_object.pb.go
+++ b/coprocess/coprocess_response_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_return_overrides.pb.go b/coprocess/coprocess_return_overrides.pb.go
index ddee20b..f3e8454 100644
--- a/coprocess/coprocess_return_overrides.pb.go
+++ b/coprocess/coprocess_return_overrides.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_session_state.pb.go b/coprocess/coprocess_session_state.pb.go
index b542cc3..b1cbd61 100644
--- a/coprocess/coprocess_session_state.pb.go
+++ b/coprocess/coprocess_session_state.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const ( Please look at the run or in the Checks tab. |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
@dcs3spp CI is failing on this, also a lot to review. Can you follow godoc style comments in proto files, as discussed previously? |
💥 CI tests failed 🙈git-statediff --git a/coprocess/coprocess_common.pb.go b/coprocess/coprocess_common.pb.go
index bdc0686..ccd0561 100644
--- a/coprocess/coprocess_common.pb.go
+++ b/coprocess/coprocess_common.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_mini_request_object.pb.go b/coprocess/coprocess_mini_request_object.pb.go
index 07136e3..184464b 100644
--- a/coprocess/coprocess_mini_request_object.pb.go
+++ b/coprocess/coprocess_mini_request_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_object.pb.go b/coprocess/coprocess_object.pb.go
index b3b4cd1..6fab2b8 100644
--- a/coprocess/coprocess_object.pb.go
+++ b/coprocess/coprocess_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_object_grpc.pb.go b/coprocess/coprocess_object_grpc.pb.go
index 8b48ff7..8423d03 100644
--- a/coprocess/coprocess_object_grpc.pb.go
+++ b/coprocess/coprocess_object_grpc.pb.go
@@ -8,6 +8,7 @@ package coprocess
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/coprocess/coprocess_response_object.pb.go b/coprocess/coprocess_response_object.pb.go
index 87283f3..3970c8b 100644
--- a/coprocess/coprocess_response_object.pb.go
+++ b/coprocess/coprocess_response_object.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_return_overrides.pb.go b/coprocess/coprocess_return_overrides.pb.go
index ddee20b..f3e8454 100644
--- a/coprocess/coprocess_return_overrides.pb.go
+++ b/coprocess/coprocess_return_overrides.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/coprocess/coprocess_session_state.pb.go b/coprocess/coprocess_session_state.pb.go
index b542cc3..b1cbd61 100644
--- a/coprocess/coprocess_session_state.pb.go
+++ b/coprocess/coprocess_session_state.pb.go
@@ -7,10 +7,11 @@
package coprocess
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const ( Please look at the run or in the Checks tab. |
@titpetric I have updated comment style and fixed previous CI linting error. There is an error relating to Sonar Cloud? |
Quality Gate passedIssues Measures |
DX-1084
Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist