Skip to content

Commit

Permalink
chore: added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
testinnplayin committed Sep 16, 2020
1 parent 886cbb4 commit 1d01379
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 7 additions & 6 deletions doc/connectors/google_sheets_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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: '<name>'
auth_flow_id: '<auth_flow_id>'
,
...
]
Expand Down
2 changes: 0 additions & 2 deletions toucan_connectors/toucan_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1d01379

Please sign in to comment.