Is it possible to manage policies through the Gateway API?


#1

The following is stated in the docs:

The Tyk Gateway API is capable of:

  • Managing session objects (key generation)
  • Managing and listing policies
  • Managing and listing API Definitions (only when not using the Dashboard)
  • Hot reloads / reloading a cluster configuration
  • OAuth client creation (only when not using the Dashboard)

Source: https://tyk.io/docs/tyk-rest-api/

However, neither the Gateway API swagger documentation nor the docs give any details on how to do this. Policies are not treated as a resource. Is this a hidden feature or am I missing something?


#2

Hi Juan

There are details on how to list policies through the Rest API in the documentation here:

https://tyk.io/docs/security/security-policies/policies-guide/#configuring-community-edition-to-use-a-policy-list

hope this helps,

Darragh


#3

Thank you for the reply Darragh. The referenced document has information on how to configure a standalone Tyk gateway to pick up the policies from a file in the filesystem. I did not see any reference to a way to list policies through the Rest API.


#4

Hi Juan
We had further discussion and there now a ticket for this https://github.com/TykTechnologies/tyk/issues/2379 so CE free users will have rest api access.


#5

Yaara, How would these ID’s be obtained otherwise? Can they be set manually in the file, or is this something that the gateway generates (like in the case of the Pro version)? For example, can I just make something up, like `adimistrator’ so I can add that to the JWT generation process?

Thanks,