From 62fd447dfde7b403a76eb33cbb825ac017c77369 Mon Sep 17 00:00:00 2001 From: Oleksandr Bazarnov Date: Fri, 20 Jan 2023 14:10:16 +0200 Subject: [PATCH 1/3] updated --- .../connectors/source-netsuite/Dockerfile | 2 +- .../connectors/source-netsuite/source_netsuite/source.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-netsuite/Dockerfile b/airbyte-integrations/connectors/source-netsuite/Dockerfile index 6633bd9c7308..4e301fccfbd3 100644 --- a/airbyte-integrations/connectors/source-netsuite/Dockerfile +++ b/airbyte-integrations/connectors/source-netsuite/Dockerfile @@ -35,5 +35,5 @@ COPY source_netsuite ./source_netsuite ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.2 +LABEL io.airbyte.version=0.1.3 LABEL io.airbyte.name=airbyte/source-netsuite diff --git a/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py b/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py index cb4cff8ee66f..fff528071701 100644 --- a/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py +++ b/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py @@ -21,18 +21,20 @@ class SourceNetsuite(AbstractSource): logger: logging.Logger = logging.getLogger("airbyte") def auth(self, config: Mapping[str, Any]) -> OAuth1: + # the `realm` param should be in format of: 12345_SB1 + realm = config["realm"].replace("-", "_").upper() return OAuth1( client_key=config["consumer_key"], client_secret=config["consumer_secret"], resource_owner_key=config["token_key"], resource_owner_secret=config["token_secret"], - realm=config["realm"], + realm=realm, signature_method="HMAC-SHA256", ) def base_url(self, config: Mapping[str, Any]) -> str: - realm = config["realm"] - subdomain = realm.lower().replace("_", "-") + # the subdomain should be in format of: 12345-sb1 + subdomain = config['realm'].replace('_', '-').lower() return f"https://{subdomain}.suitetalk.api.netsuite.com" def get_session(self, auth: OAuth1) -> requests.Session: From 4c078e6a1bbcbd32bf9849e07cd32ac3bb4fde90 Mon Sep 17 00:00:00 2001 From: Oleksandr Bazarnov Date: Fri, 20 Jan 2023 14:16:39 +0200 Subject: [PATCH 2/3] updated changelog --- docs/integrations/sources/netsuite.md | 60 ++++++++++++++++----------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/docs/integrations/sources/netsuite.md b/docs/integrations/sources/netsuite.md index ee62dc8d9c81..8747c21b9950 100644 --- a/docs/integrations/sources/netsuite.md +++ b/docs/integrations/sources/netsuite.md @@ -9,7 +9,7 @@ This connector implements the [SuiteTalk REST Web Services](https://docs.oracle. * Allowed access to all Account permissions options ## Airbyte OSS and Airbyte Cloud -* Realm +* Realm (Account ID) * Consumer Key * Consumer Secret * Token ID @@ -25,46 +25,55 @@ This connector implements the [SuiteTalk REST Web Services](https://docs.oracle. #### Step 2.1: Obtain Realm info 1. Login into your NetSuite [account](https://system.netsuite.com/pages/customerlogin.jsp?country=US) 2. Go to **Setup** » **Company** » **Company Information** -3. Copy your Account ID. It will looks like **1234567** if you use regular account or **1234567_SB2** if it is a Sandbox +3. Copy your Account ID (Realm). It should look like **1234567** for the `Production` env. or **1234567_SB2** - for a `Sandbox` #### Step 2.2: Enable features 1. Go to **Setup** » **Company** » **Enable Features** 2. Click on **SuiteCloud** tab -3. Scroll down to **Manage Authentication** section -4. Enable checkbox **TOKEN-BASED AUTHENTICATION** -5. Save changes +3. Scroll down to **SuiteScript** section +4. Enable checkbox for `CLIENT SUITESCRIPT` and `SERVER SUITESCRIPT` +5. Scroll down to **Manage Authentication** section +6. Enable checkbox `TOKEN-BASED AUTHENTICATION` +7. Scroll down to **SuiteTalk (Web Services)** +8. Enable checkbox `REST WEB SERVISES` +9. Save the changes #### Step 2.3: Create Integration (obtain Consumer Key and Consumer Secret) 1. Go to **Setup** » **Integration** » **Manage Integrations** » **New** -2. Fill the **Name** field. *It is a just description of integration* -3. **State** will keep **enabled** -4. Enable checkbox **Token-Based Authentication** on *Authentication* section +2. Fill the **Name** field (we recommend to put `airbyte-rest-integration` for a name) +3. Make sure the **State** is `enabled` +4. Enable checkbox `Token-Based Authentication` in **Authentication** section 5. Save changes -6. After that, **Consumer Key** and **Consumer Secret** will be showed once, copy them. -#### Step 2.4: Setup Role +6. After that, **Consumer Key** and **Consumer Secret** will be showed once (copy them to the safe place) +#### Step 2.4: Setup Role 1. Go to **Setup** » **Users/Roles** » **Manage Roles** » **New** -2. Fill the **Name** field. +2. Fill the **Name** field (we recommend to put `airbyte-integration-role` for a name) 3. Scroll down to **Permissions** tab -4. You need to select manually each record on selection lists and give at least **Read-only** level access on the next tabs: (Permissions, Reports, Lists, Setup, Custom Records). You strongly need to be careful and attentive on this point. -5. -#### Step 2.5: Setup User -1. Go to **Setup** » **Users/Roles** » **Manage Users** -2. In column _Name_ click on the user’s name you want to give access -3. Then click on **Edit** button under the user’s name +4. (REQUIRED) Click on `Transactions` and manually `add` all the dropdown entities with either `full` or `view` access level. +5. (REQUIRED) Click on `Reports` and manually `add` all the dropdown entities with either `full` or `view` access level. +6. (REQUIRED) Click on `Lists` and manually `add` all the dropdown entities with either `full` or `view` access level. +7. (REQUIRED) Click on `Setup` and manually `add` all the dropdown entities with either `full` or `view` access level. +* Make sure you've done all `REQUIRED` steps correctly, to avoid sync issues in the future. +* Please edit these params again when you `rename` or `customise` any `Object` in Netsuite for `airbyte-integration-role` to reflect such changes. + +#### Step 2.5: Setup User +1. Go to **Setup** » **Users/Roles** » **Manage Users** +2. In column `Name` click on the user’s name you want to give access to the `airbyte-integration-role` +3. Then click on **Edit** button under the user’s name 4. Scroll down to **Access** tab at the bottom -5. Select from dropdown list the role which you created in step 2.4 +5. Select from dropdown list the `airbyte-integration-role` role which you created in step 2.4 6. Save changes #### Step 2.6: Create Access Token for role 1. Go to **Setup** » **Users/Roles** » **Access Tokens** » **New** 2. Select an **Application Name** -3. Under **User** select the user you assigned the _Role_ in the step **2.4** -4. Inside **Role** select the one you gave to the user in the step **2.5** -5. Under **Token Name** you can give a descriptive name to the Token you are creating -6. Save changes -7. After that, **Token ID** and **Token Secret** will be showed once, copy them. +3. Under **User** select the user you assigned the `airbyte-integration-role` in the step **2.4** +4. Inside **Role** select the one you gave to the user in the step **2.5** +5. Under **Token Name** you can give a descriptive name to the Token you are creating (we recommend to put `airbyte-rest-integration-token` for a name) +6. Save changes +7. After that, **Token ID** and **Token Secret** will be showed once (copy them to the safe place) #### Step 2.7: Summary You have copied next parameters -* Realm (Account ID) +* Realm (Account ID) * Consumer Key * Consumer Secret * Token ID @@ -105,7 +114,7 @@ The NetSuite source connector supports the following [sync modes](https://docs.a ## Supported Streams -- Streams are generated based on `ROLE` and `USER` access to them as well as `Account` settings, make sure you're using `Admin` or any other custom `ROLE` granted to the Access Token, having the access to the NetSuite objects for data sync. +- Streams are generated based on `ROLE` and `USER` access to them as well as `Account` settings, make sure you're using the correct role assigned in our case `airbyte-integration-role` or any other custom `ROLE` granted to the Access Token, having the access to the NetSuite objects for data sync, please refer to the **Setup guide** > **Step 2.4** and **Setup guide** > **Step 2.5** ## Performance considerations @@ -116,5 +125,6 @@ The connector is restricted by Netsuite [Concurrency Limit per Integration](http | Version | Date | Pull Request | Subject | | :------ | :--------- | :------------------------------------------------------- | :-------------------------- | +| 0.1.3 | 2023-01-20 | [21645](https://github.com/airbytehq/airbyte/pull/21645) | Minor issues fix, Setup Guide corrections for public docs | | 0.1.1 | 2022-09-28 | [17304](https://github.com/airbytehq/airbyte/pull/17304) | Migrate to per-stream state | | 0.1.0 | 2022-09-15 | [16093](https://github.com/airbytehq/airbyte/pull/16093) | Initial Alpha release | From 96760486b254515734b7791d212fa68234973135 Mon Sep 17 00:00:00 2001 From: Octavia Squidington III Date: Fri, 20 Jan 2023 22:29:51 +0000 Subject: [PATCH 3/3] auto-bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- airbyte-config/init/src/main/resources/seed/source_specs.yaml | 2 +- .../connectors/source-netsuite/source_netsuite/source.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index e7dfad1c3c12..09cccc9afda5 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -1099,7 +1099,7 @@ - name: Netsuite sourceDefinitionId: 4f2f093d-ce44-4121-8118-9d13b7bfccd0 dockerRepository: airbyte/source-netsuite - dockerImageTag: 0.1.2 + dockerImageTag: 0.1.3 documentationUrl: https://docs.airbyte.com/integrations/sources/netsuite icon: netsuite.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index dc9f71b621a7..1a239c21a78d 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -9374,7 +9374,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-netsuite:0.1.2" +- dockerImage: "airbyte/source-netsuite:0.1.3" spec: documentationUrl: "https://docsurl.com" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py b/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py index fff528071701..a129e6fc5771 100644 --- a/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py +++ b/airbyte-integrations/connectors/source-netsuite/source_netsuite/source.py @@ -34,7 +34,7 @@ def auth(self, config: Mapping[str, Any]) -> OAuth1: def base_url(self, config: Mapping[str, Any]) -> str: # the subdomain should be in format of: 12345-sb1 - subdomain = config['realm'].replace('_', '-').lower() + subdomain = config["realm"].replace("_", "-").lower() return f"https://{subdomain}.suitetalk.api.netsuite.com" def get_session(self, auth: OAuth1) -> requests.Session: