Comments (16)
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.
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.
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.
@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.
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.
Kong/kong#4972 will fix this problem.
from deck.
@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.
No. Please upgrade.
from deck.
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.
Please upgrade decK, Kong should be fine.
from deck.
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.
No, that's the latest one. Something got messed up in Kong. I'll investigate.
from deck.
@hbagdi should I create a ticket at https://github.com/Kong/kong?
from deck.
Yes, please.
from deck.
I recreated this problem without DecK and created an issue in the Kong repo. Kong/kong#5551
from deck.
Thanks @3to1null
from deck.
Related Issues (20)
- deck file render - env substition does not work with string values HOT 4
- deck gateway dump with RS256 JWT consumer secrets cannot be synced without modification
- How to manage deletion of services and routes in distributed configuration HOT 2
- render adding "regex_priority" key to expression route resulting sync to fails
- deck always update rate-limiter plugin config even no changes HOT 1
- Missing Docker image for v1.36.0 HOT 1
- README update download version from 1.8 to latest
- Deck sees blacklist/whitelist in plugins as diffs when run against Kong 2.X
- Please update go version to 1.21.9 or 1.22.2 HOT 3
- Cannot upload new Certificate to Kong using decK HOT 1
- Deck convert from 2.x to 3.x does not handle the escape characters in the regex paths HOT 3
- decK colours do not work correctly in non-tty environment
- OpenAPI 3.1 support for `deck file` commands HOT 3
- Add `deck file echo --selector=...` command HOT 4
- deck file lint: `Error: accepts 1 arg(s), received 0` HOT 4
- Require better validation for patch files for deck file patch command
- Ignore/support _comments and _ignore HOT 2
- Add degraphql entity support
- Send analytics on a best-effort basis
- `service` field under a plugin should be ignored for nested routes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deck.