Policies/API sync between Tyk dev portal and dashboard not working

104 Views Asked by At

I have a Tyk dashboard and developer portal running in separate Docker containers on the same docker network. I use the following docker-compose.yaml file:

version: '3.6'
services:
  tyk-portal:
    depends_on:
      - tyk-portal-mysql
    image: tykio/portal:v1.3.0
    command: --bootstrap
    networks:
      - tyk-portal
    ports:
      - 3001:3001
    environment:
      - ...

  tyk-portal-mysql:
    image: mysql:5.7
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    volumes:
      - tyk-portal-mysql-data:/var/lib/mysql
    networks:
      - tyk-portal
    ports:
      - 3306:3306  
    environment:
      - ... 

  tyk-dashboard:
    image: tykio/tyk-dashboard:v5.0
    container_name: tyk-dashboard
    environment:
      - ...
    depends_on:
      tyk-postgres:
        condition: service_healthy
    ports:
      - 3000:3000
    env_file:
      - ./confs/tyk_analytics.env
    networks:
      - tyk-portal

  tyk-postgres:
    image: postgres:latest
    container_name: tyk-postgres
    environment:
      - ...
    ports:
      - 5432:5432
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
    networks:
      - tyk-portal 

  tyk-gateway:
    image: tykio/tyk-gateway:v5.0
    container_name: tyk-gateway
    ports:
      - 8080:8080
    env_file:
      - ./confs/tyk.env
    networks:
      - tyk-portal

  tyk-redis:
    image: redis
    container_name: tyk-redis
    ports:
      - 6379:6379
    volumes:
      - redis-data:/data
    networks:
      - tyk-portal 

volumes:
  redis-data:
  tyk-portal-mysql-data:
  postgres-data:

networks:
  tyk-portal:

I imported an API definition via the Tyk dashboard and added a policy for it. The API can be accessed without any authentication. The policy also does not specify any authentication type.

In the "Providers" section of the developer portal, I added a new provider pointing to the locally running Tyk dashboard. I use "http://tyk-dashboard:3000" as the URL and the correct secret and organisation ID. When I click on "Synchronize" it claims to have been successful. I also don't see any error logs in any of the containers.

However, when I navigate to the catalogue page of the developer portal (I'm logged in as the admin user), it still says "No APIs found".

Has anyone experienced this as well? How can I list the imported API in the catalogue page?

1

There are 1 best solutions below

0
Patrick On

It turns out that the APIs authentication method can't be set to "keyless" (I used "auth token") and the policy partitioning has to be set ("Enforce access rights" in my case). With these changes, the API is finally shown in the developer portal catalogue page.