Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins scoped to consumers groups are shown as global #1005

Closed
aldredb opened this issue Aug 17, 2023 · 0 comments · Fixed by Kong/go-database-reconciler#134 or #1380
Closed

Plugins scoped to consumers groups are shown as global #1005

aldredb opened this issue Aug 17, 2023 · 0 comments · Fixed by Kong/go-database-reconciler#134 or #1380
Assignees
Milestone

Comments

@aldredb
Copy link

aldredb commented Aug 17, 2023

I have rate limiting advanced plugin attached to a consumer group (see deck file below). When performing deck sync, the plugin is shown as global instead. I used deck v1.26.0 against Kong EE 3.4.0.0. This is confusing and potentially misleading

deck sync --headers "Kong-Admin-Token:admin"
creating consumer Jane
creating consumer Jill
creating consumer Amal
creating consumer Joe
creating consumer-group fun-group
creating consumer-group Gold
creating service mockbin_service
creating key-auth sword for consumer Jill
creating key-auth sword for consumer Joe
creating key-auth sword for consumer Jane
creating key-auth sword for consumer Amal
creating route mockbin_route
creating consumer-group-consumer Jane
creating consumer-group-consumer Amal
creating consumer-group-consumer Joe
creating plugin key-auth for service mockbin_service
creating plugin rate-limiting-advanced (global)
_format_version: "3.0"
consumer_groups:
- name: Gold
  plugins:
  - config:
      consumer_groups: null
      dictionary_name: kong_rate_limiting_counters
      disable_penalty: false
      enforce_consumer_groups: false
      error_code: 429
      error_message: API rate limit exceeded
      header_name: null
      hide_client_headers: false
      identifier: consumer
      limit:
      - 5
      namespace: IyKX8pI4hLLR1CYozJxZo0LAkVQawgsx
      path: null
      redis:
        cluster_addresses: null
        connect_timeout: null
        database: 0
        host: null
        keepalive_backlog: null
        keepalive_pool_size: 30
        password: null
        port: null
        read_timeout: null
        send_timeout: null
        sentinel_addresses: null
        sentinel_master: null
        sentinel_password: null
        sentinel_role: null
        sentinel_username: null
        server_name: null
        ssl: false
        ssl_verify: false
        timeout: 2000
        username: null
      retry_after_jitter_max: 0
      strategy: local
      sync_rate: -1
      window_size:
      - 30
      window_type: sliding
    name: rate-limiting-advanced
- name: fun-group
consumers:
- groups:
  - name: Gold
  keyauth_credentials:
  - key: AmalPassword
  username: Amal
- custom_id: Jane
  groups:
  - name: fun-group
  keyauth_credentials:
  - key: JanePassword
  username: Jane
- custom_id: Jill
  keyauth_credentials:
  - key: JillPassword
  username: Jill
- custom_id: Joe
  groups:
  - name: fun-group
  keyauth_credentials:
  - key: JoePassword
  username: Joe
services:
- connect_timeout: 60000
  enabled: true
  host: mockbin.org
  name: mockbin_service
  path: /request
  plugins:
  - config:
      anonymous: null
      hide_credentials: false
      key_in_body: false
      key_in_header: true
      key_in_query: true
      key_names:
      - apikey
      run_on_preflight: true
    enabled: true
    name: key-auth
    protocols:
    - grpc
    - grpcs
    - http
    - https
    - ws
    - wss
  port: 8000
  protocol: http
  read_timeout: 60000
  retries: 5
  routes:
  - https_redirect_status_code: 426
    name: mockbin_route
    path_handling: v0
    paths:
    - /mockbin
    preserve_host: false
    protocols:
    - http
    - https
    regex_priority: 0
    request_buffering: true
    response_buffering: true
    strip_path: true
  write_timeout: 60000

Prashansa-K added a commit to Kong/go-database-reconciler that referenced this issue Aug 26, 2024
Prior to this fix, deck was reporting the plugins as global
even if a consumer-group was attached to them. This was only
a output problem, not a association problem. The fix
checks if a consumer-group exists or not before reporting
any plugin as global.

Fixes: Kong/deck#1005
@Prashansa-K Prashansa-K self-assigned this Aug 26, 2024
Prashansa-K added a commit to Kong/go-database-reconciler that referenced this issue Aug 27, 2024
* fix: plugin shown as global despite a consumer-group present

Prior to this fix, deck was reporting the plugins as global
even if a consumer-group was attached to them. This was only
a output problem, not a association problem. The fix
checks if a consumer-group exists or not before reporting
any plugin as global.

Fixes: Kong/deck#1005

* chore: moved to table-driven tests for plugin console function
Prashansa-K added a commit that referenced this issue Aug 27, 2024
This version of go-database-reconciler has the fix
that ensures that plugins are not shown as global
if they have a consumer group attached.
Earlier, they were wrongly shown as global, despite
the actual associations working fine.

Fixes #1005
Prashansa-K added a commit that referenced this issue Aug 28, 2024
This version of go-database-reconciler has the fix
that ensures that plugins are not shown as global
if they have a consumer group attached.
Earlier, they were wrongly shown as global, despite
the actual associations working fine.

Fixes #1005
Prashansa-K added a commit that referenced this issue Aug 28, 2024
This version of go-database-reconciler has the fix
that ensures that plugins are not shown as global
if they have a consumer group attached.
Earlier, they were wrongly shown as global, despite
the actual associations working fine.

Fixes #1005
@Prashansa-K Prashansa-K added this to the next milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants