Skip to content

CDK: When running a connector, inputting an invalid config should not print the full config #5796

Closed
@sherifnada

Description

@sherifnada

Current Behavior

If I input an invalid config for a connector I see the following output:

(.venv) ➜  source-google-search-console git:(gaart/5235-source-google-search-console) ✗ python main.py check --config secrets/config.json
Traceback (most recent call last):
  File "/Users/sherifnada/code/airbyte/airbyte-integrations/connectors/source-google-search-console/.venv/lib/python3.7/site-packages/airbyte_cdk/sources/utils/schema_helpers.py", line 143, in check_config_against_spec_or_exit
    validate(instance=config, schema=spec_schema)
  File "/Users/sherifnada/code/airbyte/airbyte-integrations/connectors/source-google-search-console/.venv/lib/python3.7/site-packages/jsonschema/validators.py", line 934, in validate
    raise error
jsonschema.exceptions.ValidationError: 'site_urls' is a required property

Failed validating 'required' in schema:
    {'$schema': 'http://json-schema.org/draft-07/schema#',
     'additionalProperties': False,
     'properties': {'client_id': {'airbyte_secret': True,
                                  'description': 'Input this field if you '
                                                 'want authorize through '
                                                 'personal account',
                                  'type': 'string'},
                    'client_secret': {'airbyte_secret': True,
                                      'description': 'Input this field if '
                                                     'you want authorize '
                                                     'through personal '
                                                     'account',
                                      'type': 'string'},
  1 {
                    'refresh_token': {'airbyte_secret': True,
                                      'description': 'Input this field if '
                                                     'you want authorize '
                                                     'through personal '
                                                     'account',
                                      'type': 'string'},
                    'service_account_info': {'description': 'Input this '
                                                            'field if you '
                                                            'want '
                                                            'authorize '
                                                            'through '
                                                            'service '
                                                            'account',
                                             'examples': ['{ "type": '
                                                          '"service_account", '
                                                          '"project_id": '
                                                          'YOUR_PROJECT_ID, '
                                                          '"private_key_id": '
                                                          'YOUR_PRIVATE_KEY, '
                                                          '... }'],
                                             'type': 'string'},
                    'site_urls': {'description': 'Website URLs property; '
                                                 'do not include the '
                                                 'domain-level property in '
                                                 'the list',
                                  'examples': ['https://example1.com',
                                               'https://example2.com'],
                                  'type': 'array'},
                    'start_date': {'description': 'The date from which '
                                                  "you'd like to replicate "
  1 {
                                                  'data in the format '
                                                  'YYYY-MM-DD.',
                                   'examples': ['2021-03-01'],
                                   'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
  1 {
                                   'type': 'string'}},
     'required': ['site_urls', 'start_date'],
     'title': 'Google Search Console Spec',
     'type': 'object'}
  1 {

On instance:
    {'client_id': 'REDACTED',
     'client_secret': 'REDACTED',
     'refresh_token': 'REDACTED',
     'site_url': 'https://airbyte.io',
     'start_date': '2021-05-01'}

Expected Behavior

The actual config should not be printed because it could print secrets to the console/logs

Metadata

Metadata

Assignees

Labels

CDKConnector Development Kitarea/connectorsConnector related issuestype/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions