Code Monkey home page Code Monkey logo

Comments (16)

hbagdi avatar hbagdi commented on August 23, 2024 1

The above feature will be included in Kong 1.4 and solve this problem.
I've also started working on #29 as well.
Closing this.

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

As for the issue of synching only certain consumers, I have 2 suggestions.

This is a very common issue that comes up far too often and decK has concept of select-tags.

You can configure decK to perform a sync/diff only for a sub-set of entire Kong configuration.

Please take a look at: https://github.com/hbagdi/deck/blob/master/kong.yaml#L2

You can then manage only a subset of consumers of plugins or any entity you would like.
With this, you can have a state file to manage a single anonymous consumer.
And then the other state file can manage rest of the configuration.

from deck.

eamonnmcevoy avatar eamonnmcevoy commented on August 23, 2024

Perfect, select-tags does the trick.

For the anonymous user id, what do you think about decK setting the consumer id directly?
An alternative approach could be to have a new tag that acts like a function to fetch a consumerid based on the consumer username:

_info:
  select_tags:
  - managed_by_deck

services:

  - name: service1
    host: httpbin.org
    path: /
    protocol: http
    port: 80
    connect_timeout: 60000
    read_timeout: 60000
    write_timeout: 60000
    retries: 5
    tags:
    - managed_by_deck
    routes:
    - name: service1_route1
      paths:
      - /
      preserve-host: false
      methods:
      - GET
      protocols:
      - http
      - https
      regex_priority: 0
      strip_path: true
      tags:
      - managed_by_deck
      plugins:
      - name: key-auth
        tags:
        - managed_by_deck
        config:
          anonymous: _consumer_id(anonymous)

consumers:
- username: anonymous
  custom_id: anonymous
  tags:
  - managed_by_deck
  

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

@eamonnmcevoy That sounds like a good idea to me but it opens up a flood-gate of issues with itself as users then would like to template a lot of other things as well. If there are more use-cases for templating than this, we can come with a design for it and then see if it makes sense.

For this current issue, there are two approaches that I've in mind:

  • Fix the plugin in Kong to lookup the anonymous consumer by username in addition to id, this will not just only help deck but other methods of configuration too.
  • Populate data in Kong with deterministic UUIDs: #29, which can easily solve this.

from deck.

eamonnmcevoy avatar eamonnmcevoy commented on August 23, 2024

Good point about the templating, it could get messy.

Regarding the plugin, it seems strange to me that we need to specify an anonymous consumer at all. When first looking into this functionality I expected the anonymous field to be a boolean, or at least have the option to allow traffic for unauthenticated users.

I think #29 is a good solution.

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

Kong/kong#4972 will fix this problem.

from deck.

teunis90 avatar teunis90 commented on August 23, 2024

@hbagdi I'm running on version 2.0.0 and can still reproduce this issue:

	while processing event: {Update} failed: 400 Bad Request {"message":"schema violation (config.anonymous: expected a valid UUID)","name":"schema violation","fields":{"config":{"anonymous":"expected a valid UUID"}},"code":2}
	while processing event: {Update} failed: 400 Bad Request {"message":"schema violation (config.anonymous: expected a valid UUID)","name":"schema violation","fields":{"config":{"anonymous":"expected a valid UUID"}},"code":2}

Any suggestions on how to patch this? Will you port your fix also to the 2.x branches?

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

No. Please upgrade.

from deck.

teunis90 avatar teunis90 commented on August 23, 2024

I believe I run the last docker version available:

kong                     2.0                 13f14d790da4        12 days ago         144MB
kong                     latest              13f14d790da4        12 days ago         144MB

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

Please upgrade decK, Kong should be fine.

from deck.

teunis90 avatar teunis90 commented on August 23, 2024

I run decK from a the official Docker Hub latest image: https://hub.docker.com/r/hbagdi/deck, digest: 9fe912c36ca143dbd110b4f38610e492b987ebfeef6c0df9fa299a4a05f2ba81.

Is the container far behind? Would you be so kind to release a new version 😃

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

No, that's the latest one. Something got messed up in Kong. I'll investigate.

from deck.

teunis90 avatar teunis90 commented on August 23, 2024

@hbagdi should I create a ticket at https://github.com/Kong/kong?

from deck.

hbagdi avatar hbagdi commented on August 23, 2024

Yes, please.

from deck.

3to1null avatar 3to1null commented on August 23, 2024

I recreated this problem without DecK and created an issue in the Kong repo. Kong/kong#5551

from deck.

teunis90 avatar teunis90 commented on August 23, 2024

Thanks @3to1null

from deck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.