Skip to content

Conversation

Prashansa-K
Copy link
Contributor

@Prashansa-K Prashansa-K commented Sep 25, 2025

This feature introduces a flag to be used with sync
command to skip-hashing of basic-auth credential
passwords when using with Konnect.
An info field is also added for the same.

Linked PRs:
Kong/go-kong#576
Kong/go-database-reconciler#342

For #1747

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.76%. Comparing base (c9e1aa8) to head (8bfe81a).

Files with missing lines Patch % Lines
cmd/common.go 0.00% 13 Missing ⚠️
cmd/gateway_apply.go 0.00% 3 Missing ⚠️
cmd/gateway_sync.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1765      +/-   ##
==========================================
- Coverage   32.79%   32.76%   -0.03%     
==========================================
  Files          73       73              
  Lines        8093     8112      +19     
==========================================
+ Hits         2654     2658       +4     
- Misses       5273     5289      +16     
+ Partials      166      165       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"thus gaining some performance with large configs.\n"+
"Usage of this flag without apt select-tags and default-lookup-tags can be problematic.\n"+
"This flag is not valid with Konnect.")
syncCmd.Flags().BoolVar(&dumpConfig.SkipHashForBasicAuth, "skip-hash-for-basic-auth",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not want this flag for gateway apply?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in cases where the basic auth has been synced before without the flag, using this flag leads to no diff and so no action - that is expected, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. That is expected.
The GET /basic-auth endpoint doesn't have any skip-hash param. So, there's no way of knowing if the returned password is a hash or not. Earlier too we didn't compare for passwords while syncing/diffing. So, I am retaining the same behaviour.

@Prashansa-K Prashansa-K force-pushed the feat/basic-auth-skip-hash branch from 067bc53 to 15b64a5 Compare September 29, 2025 07:00
@Prashansa-K Prashansa-K force-pushed the feat/basic-auth-skip-hash branch from 4baf58a to c14ff4f Compare September 29, 2025 07:57
return true
}

if targetContent.Info != nil && targetContent.Info.SkipHashForBasicAuth {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this block necessary? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants