Get desktop application:
View/edit binary Protocol Buffers messages
Dispatcher is the service interface that must be implemented by the target language.
Dispatch is an RPC method that accepts and returns an Object.
Object 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.
HookType is an enumeration that identifies the plugin hook type.
HookName is the plugin name.
Request relates to 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.
Session stores information about the current key/user that’s used for authentication.
Metadata is a dynamic filed that contains the metadata.
Spec contains information about API definition, including APIID, OrgID and config_data.
Response relates to the ResponseObject used by response hooks. The fields are populated with the upstream HTTP response data. All the field contents can be modified.
DispatchEvent dispatches an event to the target language.
Event is represented as a JSON payload.
Payload represents the JSON payload.
EventReply is the response for event.
(message has no fields)
AccessDefinition is 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.
Used in:
ApiName is the name of the API that the session request relates to.
ApiId is the ID of the API that the session request relates to.
Versions is a list of allowed API versions, e.g. `"versions": [ "Default" ]`.
AllowedUrls is a 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.
AccessSpec defines an API's URL (endpoint) and associated list of allowed methods.
Used in:
Url is a URL (endpoint) belonging to the API associated with the request session.
Methods is a list of allowed methods for the URL (endpoint), e.g. 'methods': [ 'GET'. 'POST', 'PUT', 'PATCH' ] The list of methods are case sensitive.
BasicAuthData contains a hashed password and the name of the hashing algorithm used.
Used in:
Password is a hashed password.
Hash is the name of the hashing algorithm used to hash the password, e.g. bcrypt, Argon2.
Header is a reponse header that contains multiple associated values.
Used in:
Key represents the name of the header.
Values is a list of values for a given header content.
HookType is an enumeration that identifies the type of plugin.
Used in:
Unknown is used for error checking and handling of an unrecognised hook type.
Pre is 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.
Post is 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.
PostKeyAuth is 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.
CustomKeyCheck is executed for performing customised authentication.
Response is 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.
JWTData is 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.
Used in:
Secret is the shared secret.
MiniRequestObject is used for middleware calls and contains important fields like headers, parameters, body and URL.
Used in:
Headers is a read-only field for reading headers injected by previous middleware.
SetHeaders is a map of header key values to append to the request.
DeleteHeaders is a list of header names to be removed from the request.
Body is the request body.
Url is the request URL.
Params is a read only map of request params.
AddParams is a map of parameter keys and values to add to the request.
ExtendedParams allows a parameter to have multiple values, currently unsupported.
DeleteParams is a list of parameter keys to be removed from the request.
ReturnOverrides override the response for the request, see ReturnOverrides.
Method is the request method, eg GET, POST, etc.
RequestUri is the raw unprocessed request URL, including query string and fragments.
Scheme is the URL scheme, e.g. http or https.
RawBody is the raw request body.
Monitor allows API endpoint users, stakeholders or an organisation to be notified by webhook when certain quota limits have been reached for their session token.
Used in:
TriggerLimits is a list of quota percentage limits, defined in descending order.
ResponseObject is used by response hooks. All fields are modifiable.
Used in:
StatusCode is the HTTP status code received from the upstream.
RawBody represents the raw bytes of HTTP response body.
Body represents the HTTP response body. Excluded when the raw_body contains invalid UTF-8 characters.
Headers represents the headers received from upstream.
MultivalueHeaders is a list of headers. Useful when header has multiple values. See Header.
ReturnOverrides is 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.
Used in:
ResponseCode overrides the upstream response status code.
ResponseError overrides the upstream response error message.
Headers overrides the upstream response headers.
OverrideError overrides the upstream error response with response_error when set to true.
ResponseBody is an alias of response_error that contains the response body.
SessionState is 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.
Used in:
LastCheck is deprecated.
Allowance is deprecated, replaced by rate.
Rate is the number of requests that are allowed in the specified rate limiting window.
Per is the duration of the rate window, in seconds.
Expires is an epoch that defines when the key should expire.
QuotaMax is the maximum number of requests allowed during the quota period.
QuotaRenews is an epoch that defines when the quota renews.
QuotaRemaining is the number of requests remaining for this user’s quota (unrelated to rate limit).
QuotaRenewalRate is 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.
AccessRights 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.
OrgId represents 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.
OauthClientId is the OAuth client ID that is set if the token is generated by an OAuth client during an OAuth authorisation flow.
OauthKeys maps an OAuth client ID with a corresponding access token value. Currently unsupported and under development.
BasicAuthData contains a hashed password and the name of the hashing algorithm used.
JwtData is 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.
HmacEnabled is set to `true` to indicate 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.
HmacSecret represents the HMAC secret.
IsInactive when set to true, indicates that access is denied.
ApplyPolicyId represents the policy ID that is bound to the token. Deprecated use apply_policies instead.
DataExpires is 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).
Monitor represents the quota monitor settings, currently unsupported in gRPC sessions.
EnableDetailedRecording should be set to true to have Tyk store the inbound request and outbound response data in HTTP Wire format as part of the analytics data.
Metadata represents 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.
Tags is a 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.
Alias is an identifier for the token for use in analytics, to allow easier tracing of hashed and unhashed tokens.
LastUpdated is a timestamp that represents the time the session was last updated. With *PostAuth* hooks this is a UNIX timestamp.
IdExtractorDeadline is a 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.
SessionLifetime is a 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.
ApplyPolicies is a list of IDs for the policies that are bound to the token.
Certificate is the client certificate used to authenticate the request. Exists in the session instance if mTLS is configured for the API. Currently unsupported.
MaxQueryDepth relates to 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.
StringSlice is a list of strings.
Items is a list of string items.