From 1d01379dc7492b615a687ad5af777eff2e75d511 Mon Sep 17 00:00:00 2001 From: testinnplayin Date: Wed, 16 Sep 2020 15:16:35 +0200 Subject: [PATCH] chore: added documentation --- doc/connectors/google_sheets_2.md | 13 +++++++------ toucan_connectors/toucan_connector.py | 2 -- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/connectors/google_sheets_2.md b/doc/connectors/google_sheets_2.md index ee4c438a0..bb6e82c4c 100644 --- a/doc/connectors/google_sheets_2.md +++ b/doc/connectors/google_sheets_2.md @@ -4,16 +4,16 @@ * `type`: `"GoogleSheets2"` * `name`: str, required -* `auth_flow`: str +* `_auth_flow`: str * `auth_flow_id`: str -* `baseroute`: str -* `secrets`: dict +* `_baseroute`: str +* `hidden_properties`: GoogleSheets2HiddenProperties -The `auth_flow` property marks this as being a connector that uses the connector_oauth_manager for the oauth dance. +The `_auth_flow` property marks this as being a connector that uses the connector_oauth_manager for the oauth dance. It is hidden from being rendered in the front but appears in the front as a flag for initiating the oauth dance. It is a static *flag*. -The `baseroute` is fixed and is 'https://sheets.googleapis.com/v4/spreadsheets/'. +The `_baseroute` is fixed and is 'https://sheets.googleapis.com/v4/spreadsheets/'. It too is hidden from being rendered in the front. It is a static *non-flag* -The `secrets` dictionary contains the `access_token` and a `refresh_token` (if there is one). Though `secrets` is optional during the initial creation of the connector, it is necessary for when the user wants to make requests to the connector. If there is no `access_token`, an Exception is thrown. +The `hidden_properties` propertie contains the `access_token` and a `refresh_token` (if there is one) in a class called `GoogleSheets2HiddenProperties`. Though `hidden_properties` is optional during the initial creation of the connector, it is necessary for when the user wants to make requests to the connector. If there is no `access_token`, an Exception is thrown. This is a dynamic *non-flag* property. The `auth_flow_id` property is like an identifier that is used to identify the secrets associated with the connector. @@ -22,6 +22,7 @@ The `auth_flow_id` property is like an identifier that is used to identify the s DATA_PROVIDERS: [ type: 'GoogleSheets' name: '' + auth_flow_id: '' , ... ] diff --git a/toucan_connectors/toucan_connector.py b/toucan_connectors/toucan_connector.py index 3cbf2c726..1b94d4be8 100644 --- a/toucan_connectors/toucan_connector.py +++ b/toucan_connectors/toucan_connector.py @@ -204,8 +204,6 @@ def __init_subclass__(cls): raise TypeError(f'{cls.__name__} has no {e} attribute.') if 'bearer_integration' in cls.__fields__: cls.bearer_integration = cls.__fields__['bearer_integration'].default - if '_auth_flow' in cls.__fields__: - cls._auth_flow = cls.__fields__['_auth_flow'].default def bearer_oauth_get_endpoint( self,