From da787d7acc8910e5f6b1fd8108fc1fc1505b0b29 Mon Sep 17 00:00:00 2001 From: Harry Bagdi Date: Sun, 15 Sep 2019 18:53:31 -0700 Subject: [PATCH] fix(dump) skip Developer Portal credentials in Kong Enterprise Kong Enterprise Developer Portal exposes the credentials (basic/key) of Developers on the Admin API, but doesn't expose the consumers causing issues during export. The root cause here is in Kong Enterprise but to help out decK users, I'm going to put a work-around into decK. The fix here is that for any basic and key auth credential, if the associated consumer is not found by decK, it will not be exported. Fix #75 --- dump/dump.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump/dump.go b/dump/dump.go index 5d0a3c321..277c09519 100644 --- a/dump/dump.go +++ b/dump/dump.go @@ -75,7 +75,7 @@ func GetState(client *kong.Client, config Config) (*state.KongState, error) { if err != nil { // key could belong to a consumer which is not part // of this sub-set of the entire data-base - if err == state.ErrNotFound && len(config.SelectorTags) > 0 { + if err == state.ErrNotFound { continue } return nil, errors.Wrapf(err, @@ -129,7 +129,7 @@ func GetState(client *kong.Client, config Config) (*state.KongState, error) { if err != nil { // key could belong to a consumer which is not part // of this sub-set of the entire data-base - if err == state.ErrNotFound && len(config.SelectorTags) > 0 { + if err == state.ErrNotFound { continue } return nil, errors.Wrapf(err,