-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[low code connectors] perform schema validation of the input config against the declarative language schema #15543
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1efe2f0
draft: first pass at complete schema language generation and factory …
brianjlai 30a73ae
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 5ca8e9e
actually a working validator and fixes to the schema that went uncaught
brianjlai 385a593
remove extra spike file
brianjlai a29c048
fix formatting file
brianjlai 41eea30
pr feedback and a little bit of refactoring
brianjlai e232f09
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 1111da5
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 2d71d85
fix some types that were erroneously marked as invalid schema
brianjlai 65a7bd0
some comments
brianjlai 8d3d1fc
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 561a285
add jsonschemamixin to interfaces
brianjlai 5d2e722
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 2c3f720
Merge branch 'master' into brian/low_code_validate_schema
brianjlai 6ef9e10
update changelog
brianjlai 3612789
bump version
brianjlai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
airbyte-cdk/python/airbyte_cdk/sources/declarative/auth/declarative_authenticator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
from dataclasses import dataclass | ||
|
||
from airbyte_cdk.sources.streams.http.requests_native_auth.abstract_token import AbstractHeaderAuthenticator | ||
from dataclasses_jsonschema import JsonSchemaMixin | ||
|
||
|
||
@dataclass | ||
class DeclarativeAuthenticator(JsonSchemaMixin): | ||
""" | ||
Interface used to associate which authenticators can be used as part of the declarative framework | ||
""" | ||
|
||
|
||
@dataclass | ||
class NoAuth(AbstractHeaderAuthenticator, DeclarativeAuthenticator, JsonSchemaMixin): | ||
@property | ||
def auth_header(self) -> str: | ||
return "" | ||
|
||
@property | ||
def token(self) -> str: | ||
return "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is where it gets particularly fun. This whole recursive function is necessary to retain the existing structure of any declarative components that must be expanded, without losing the shape of the container they are in. We basically retrieve the underlying type and use that as the next recursive call. And once we have unpacked the underlying classes, we package it back into its original container. I added a handful of tests to verify this was where the subclass replacement became less than trivial.
Happy to discuss this part more since this was something I realized we needed midway through.