Skip to content

Merging to release-5.8: [TT-12238] Javascript regex issue on OAS API (#7904)#7994

Open
probelabs[bot] wants to merge 7 commits intorelease-5.8from
merge/release-5.8/ab9e5e1283983175494b28cb1ec042851db4d428/TT-12238
Open

Merging to release-5.8: [TT-12238] Javascript regex issue on OAS API (#7904)#7994
probelabs[bot] wants to merge 7 commits intorelease-5.8from
merge/release-5.8/ab9e5e1283983175494b28cb1ec042851db4d428/TT-12238

Conversation

@probelabs
Copy link
Copy Markdown
Contributor

@probelabs probelabs bot commented Apr 13, 2026

Cherry-pick of ab9e5e1283983175494b28cb1ec042851db4d428 from master to release-5.8 requires manual resolution.

Conflicts detected: 3

  • gateway/api.go

Tips:

  • Check out this branch locally and run: git cherry-pick -x ab9e5e1283983175494b28cb1ec042851db4d428
  • Resolve conflicts (including submodules if any), then push back to this branch.

Original commit: ab9e5e1

    Cherry-pick failed with conflicts and requires manual resolution.
    This empty commit exists to allow opening a draft PR.
@probelabs probelabs bot added the needs-manual-cherry-pick Cherry-pick has conflicts label Apr 13, 2026
@MaciekMis MaciekMis closed this Apr 13, 2026
@MaciekMis MaciekMis reopened this Apr 13, 2026
@MaciekMis MaciekMis marked this pull request as ready for review April 13, 2026 10:37
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@radkrawczyk radkrawczyk reopened this Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

API Changes

--- prev.txt	2026-04-17 08:04:25.462424155 +0000
+++ current.txt	2026-04-17 08:04:20.745475696 +0000
@@ -12196,13 +12196,6 @@
     the version definition and ensures that required fields have appropriate
     values.
 
-func RestoreUnicodeEscapesInError(err error) error
-    RestoreUnicodeEscapesInError takes an error and applies the
-    RestoreUnicodeEscapesInRegexp transformation to its message. For example,
-    it converts RE2-compatible escapes like `\x{0041}` back to `\u0041`. It
-    returns a new error with the transformed message. If the input error is nil,
-    it returns nil.
-
 func SetAsDefault(versionName string) option.Option[apidef.VersionDefinition]
     SetAsDefault creates an option that marks a specific version as the default.
     This sets the Default field in the VersionDefinition to the specified
@@ -12219,35 +12212,6 @@
 
 TYPES
 
-type DataBytesModifier struct {
-	// Has unexported fields.
-}
-
-func NewDataBytesModifier(data []byte) *DataBytesModifier
-
-func (d *DataBytesModifier) Data(data []byte)
-
-func (d *DataBytesModifier) Reset()
-
-func (d *DataBytesModifier) RestoreUnicodeEscapesFromRE2()
-    RestoreUnicodeEscapesFromRE2 translates RE2-compatible hexadecimal escape
-    sequences (`\x{XXXX}`) back to their original ECMA-262 compliant Unicode
-    escape sequence representation (`\uXXXX`). This function is typically used
-    when exporting an API definition or any other data structure where regex
-    patterns were previously sanitized for internal use with Go's RE2 engine.
-    It ensures that external consumers of the data receive the regex patterns in
-    their original, more widely supported format.
-
-func (d *DataBytesModifier) Result() []byte
-
-func (d *DataBytesModifier) TransformUnicodeEscapesToRE2()
-    TransformUnicodeEscapesToRE2 transforms ECMA-262 compliant Unicode escape
-    sequences (`\uXXXX`) into a format that is compatible with Go's RE2 regex
-    engine (`\x{XXXX}`). This is necessary because RE2 does not support the `\u`
-    escape sequence but does support hexadecimal escapes, which can represent
-    any Unicode code point. The function returns a new byte array with the
-    transformed pattern.
-
 type VersionParameter int
     VersionParameter represents the type of parameter used in API version
     configuration. It defines the possible parameters that can be used when
@@ -12469,6 +12433,36 @@
 	// Has unexported fields.
 }
 
+# Package: ./pkg/schema
+
+package schema // import "github.com/TykTechnologies/tyk/pkg/schema"
+
+
+FUNCTIONS
+
+func RestoreUnicodeEscapesFromRE2(str string) string
+func RestoreUnicodeEscapesFromRE2Manipulation(schema *openapi3.Schema)
+func RestoreUnicodeEscapesInError(err error) error
+func TransformUnicodeEscapesToRE2Manipulation(schema *openapi3.Schema)
+
+TYPES
+
+type Manipulation func(schema *openapi3.Schema)
+
+type Manipulations []Manipulation
+
+type Visitor struct {
+	// Has unexported fields.
+}
+
+func NewVisitor() *Visitor
+
+func (v *Visitor) AddSchemaManipulation(manipulation Manipulation)
+
+func (v *Visitor) ProcessOAS(doc *oas.OAS)
+
+func (v *Visitor) ProcessSchema(schemaRef *openapi3.SchemaRef)
+
 # Package: ./regexp
 
 package regexp // import "github.com/TykTechnologies/tyk/regexp"

@radkrawczyk radkrawczyk reopened this Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@radkrawczyk radkrawczyk reopened this Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@MaciekMis MaciekMis closed this Apr 16, 2026
@MaciekMis MaciekMis reopened this Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@radkrawczyk radkrawczyk reopened this Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

radkrawczyk and others added 3 commits April 17, 2026 07:43
…b28cb1ec042851db4d428/TT-12238

# Conflicts:
#	gateway/mw_oas_validate_request.go
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Jira Linter Failed

Commit: 0f6cd12
Failed at: 2026-04-17 08:03:26 UTC

The Jira linter failed to validate your PR. Please check the error details below:

🔍 Click to view error details
failed to get Jira issue: failed to fetch Jira issue TT-12238: Issue does not exist or you do not have permission to see it.: request failed. Please analyze the request body for more details. Status code: 404

Next Steps

  • Ensure your branch name contains a valid Jira ticket ID (e.g., ABC-123)
  • Verify your PR title matches the branch's Jira ticket ID
  • Check that the Jira ticket exists and is accessible

This comment will be automatically deleted once the linter passes.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
91.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-manual-cherry-pick Cherry-pick has conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants