GET
request using the path /profile/1
. This path has two parts:
/profile/
: The resource type, which is static for all requests related to profile objects. This requires function level authorization.
1
: The resource reference, which is dynamic and depends on the profile is being requested. This requires object level authorization.
/profile/
, is authorized for access. It does this by cross referencing the security policies connected to the API key provided in the authorization
header.
The gateway ignores the dynamic part of the part of the path, in this case 1
, as it doesn’t have access to the necessary object-level data to make an authorization decision for this.
Lastly, the API handles object level authorization by using custom logic. This typically involves using the value of the authorization
header in combination with the ownership and authorization model specific to the API to determine if the client is authorized to read is requested record.
POST
request using the path /profile
and body data containing the object to write. The path /profile
is static and requires function level authorization. The body data contains a JSON object that has two fields:
name
: A standard object field. This requires object property authorization.
id
: An object identifier field that refers to the identity of an object, so needs to be treated differently. As such, it requires both object property authorization, like name, and also object authorization.
/profile
, is authorized for access. It does this by cross referencing the security policies connected to the API key provided in the authorization
header.
The gateway can also perform object property level authorization, by validating that the values of the body data fields, name
and id
, conform to a schema.
Lastly, the API handles object level authorization by using custom logic. This typically involves using the value of the authorization
header in combination with the ownership and authorization model specific to the API to determine if the client is authorized to write the requested data.
POST
request using the path /graphql
and body data containing a GraphQL query. The path /graphql
is static and requires function level authorization. The GraphQL query contains several elements:
profile
: An object type, referring to the type of object being requested. This requires object property authorization.id
: An object identifier field that refers to the identity of an object, so needs to be treated differently. As such, it requires both object property authorization, like name, and also object authorization.name
: A standard object field, referring to a property of the profile object type. This requires object property authorization./graphql
, is authorized for access. It does this by cross referencing the security policies connected to the API key provided in the authorization
header. Due to the nature of GraphQL using just a single endpoint, there is no need for additional path-based authorization features, only a basic security policy is required.
Another difference between this and the REST examples is in the way that the body data is authorized:
profile
, and the fields are id
and name
. The schema defined in the gateway configuration can differ from that in the upstream API, which enables fields to be restricted by default.id
and name
.authorization
header in combination with the ownership and authorization model specific to the API to determine if the client is authorized to access the requested data. This can be more complicated for GraphQL APIs, as the data presented by the schema may actually come from several different data sources.
tyk.conf
or environment variable) by setting allow_insecure_configs
to false
and then provide the public key (certificate) to the Gateway in the public_key_path
.
You’ll need to provide the private key to the Dashboard using the private_key_path
option in the appropriate configuration (tyk_analytics.conf
or environment variable). This will allow your Dashboard to sign all of its payloads using the private key.
You can easily create a public / private keypair with: