Skip to content

Revert "Merging to release-5.8: [TT-5588] [OAS] gateway apiKey import generates unnecessary object (#7270)" #7298

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

Conversation

radkrawczyk
Copy link
Contributor

@radkrawczyk radkrawczyk commented Aug 12, 2025

User description

TT-5588
Summary [OAS] gateway apiKey import generates unnecessary object
Type Bug Bug
Status In Dev
Points N/A
Labels codilime_refined

Reverts #7291


PR Type

Bug fix, Tests


Description

Revert exclusion of AuthSources from JSON.
Restore JSON inline serialization for Token.AuthSources.
Remove test asserting non-serialization of AuthSources.
Keep token fill logic and assertions intact.


Diagram Walkthrough

flowchart LR
  Token["Token struct"]
  JSONTag["JSON tag for AuthSources"]
  Tests["Security tests"]
  Token -- "AuthSources json:',inline'" --> JSONTag
  Tests -- "remove non-serialization round-trip" --> JSONTag
Loading

File Walkthrough

Relevant files
Bug fix
security.go
Restore inline JSON serialization for AuthSources               

apidef/oas/security.go

  • Change Token.AuthSources tag to json:",inline".
  • Re-enable JSON serialization of embedded AuthSources.
+1/-1     
Tests
security_test.go
Remove test asserting AuthSources non-serialization           

apidef/oas/security_test.go

  • Remove JSON round-trip test for AuthSources.
  • Drop encoding/json import no longer used.
+0/-15   

@buger
Copy link
Member

buger commented Aug 12, 2025

I'm a bot and I 👍 this PR title. 🤖

Copy link
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

Copy link
Contributor

API Changes

--- prev.txt	2025-08-12 11:15:47.625045057 +0000
+++ current.txt	2025-08-12 11:15:43.311019208 +0000
@@ -4505,7 +4505,7 @@
 	Enabled bool `bson:"enabled" json:"enabled"` // required
 
 	// AuthSources contains the configuration for authentication sources.
-	AuthSources `bson:",inline" json:"-"`
+	AuthSources `bson:",inline" json:",inline"`
 
 	// EnableClientCertificate allows to create dynamic keys based on certificates.
 	//

Copy link

@MaciekMis MaciekMis merged commit 9707113 into release-5.8 Aug 12, 2025
38 checks passed
@MaciekMis MaciekMis deleted the revert-7291-merge/release-5.8/8b4fa8e74dfd920488cf4580066186e749c6c6e7 branch August 12, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants