_format_version: "1.1"

services:
  - name: auth-v1
    url: http://auth:9999/
    routes:
      - name: auth-v1-route
        strip_path: true
        paths:
          - /auth/v1/
    plugins:
      - name: cors

  - name: auth-v1-admin
    url: http://auth:9999/admin/
    routes:
      - name: auth-v1-admin-route
        strip_path: true
        paths:
          - /auth/v1/admin/
    plugins:
      - name: key-auth
        config:
          hide_credentials: true
      - name: acl
        config:
          allow:
            - admin

consumers:
  - username: service_role
    keyauth_credentials:
      - key: ${SUPABASE_SERVICE_ROLE_KEY}
    acls:
      - group: admin

  - username: anon
    keyauth_credentials:
      - key: ${SUPABASE_ANON_KEY}
