-
Notifications
You must be signed in to change notification settings - Fork 30
fix(declarative): Support nested $ref patterns in dynamic stream templates (do not merge) #708
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1508,6 +1508,13 @@ definitions: | |||||
- "$ref": "#/definitions/SimpleRetriever" | ||||||
- "$ref": "#/definitions/AsyncRetriever" | ||||||
- "$ref": "#/definitions/CustomRetriever" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
incremental_sync: | ||||||
title: Incremental Sync | ||||||
description: Component used to fetch data incrementally based on a time field in the data. | ||||||
|
@@ -2414,6 +2421,13 @@ definitions: | |||||
- "$ref": "#/definitions/SimpleRetriever" | ||||||
- "$ref": "#/definitions/AsyncRetriever" | ||||||
- "$ref": "#/definitions/CustomRetriever" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
schema_filter: | ||||||
title: Schema Filter | ||||||
description: Responsible for filtering fields to be added to json schema. | ||||||
|
@@ -3214,6 +3228,13 @@ definitions: | |||||
anyOf: | ||||||
- "$ref": "#/definitions/DeclarativeStream" | ||||||
- "$ref": "#/definitions/StateDelegatingStream" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
parent_key: | ||||||
title: Parent Key | ||||||
description: The primary key of records from the parent stream that will be used during the retrieval of records for the current substream. This parent identifier field is typically a characteristic of the child records being extracted from the source API. | ||||||
|
@@ -3654,6 +3675,13 @@ definitions: | |||||
anyOf: | ||||||
- "$ref": "#/definitions/HttpRequester" | ||||||
- "$ref": "#/definitions/CustomRequester" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
decoder: | ||||||
title: HTTP Response Format | ||||||
description: Component decoding the response so records can be extracted. | ||||||
|
@@ -4202,6 +4230,13 @@ definitions: | |||||
- "$ref": "#/definitions/SimpleRetriever" | ||||||
- "$ref": "#/definitions/AsyncRetriever" | ||||||
- "$ref": "#/definitions/CustomRetriever" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
components_mapping: | ||||||
type: array | ||||||
items: | ||||||
|
@@ -4336,6 +4371,13 @@ definitions: | |||||
anyOf: | ||||||
- "$ref": "#/definitions/DeclarativeStream" | ||||||
- "$ref": "#/definitions/StateDelegatingStream" | ||||||
- type: object | ||||||
properties: | ||||||
$ref: | ||||||
type: string | ||||||
pattern: "^#/definitions/" | ||||||
required: ["$ref"] | ||||||
additionalProperties: true | ||||||
components_resolver: | ||||||
title: Components Resolver | ||||||
description: Component resolve and populates stream templates with components values. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern
^#/definitions/
only validates the prefix but doesn't prevent potentially malicious or malformed references like#/definitions/../../../sensitive/path
. Consider using a more restrictive pattern that validates the complete reference structure.Copilot uses AI. Check for mistakes.