diff --git a/.github/workflows/publish-command.yml b/.github/workflows/publish-command.yml index 29e11c7f7dac1..70ad45ae32579 100644 --- a/.github/workflows/publish-command.yml +++ b/.github/workflows/publish-command.yml @@ -84,6 +84,7 @@ jobs: SENDGRID_INTEGRATION_TEST_CREDS: ${{ secrets.SENDGRID_INTEGRATION_TEST_CREDS }} SHOPIFY_INTEGRATION_TEST_CREDS: ${{ secrets.SHOPIFY_INTEGRATION_TEST_CREDS }} SLACK_TEST_CREDS: ${{ secrets.SLACK_TEST_CREDS }} + SOURCE_OKTA_TEST_CREDS: ${{ secrets.SOURCE_OKTA_TEST_CREDS }} SOURCE_SLACK_TEST_CREDS: ${{ secrets.SOURCE_SLACK_TEST_CREDS }} SMARTSHEETS_TEST_CREDS: ${{ secrets.SMARTSHEETS_TEST_CREDS }} SNOWFLAKE_INTEGRATION_TEST_CREDS: ${{ secrets.SNOWFLAKE_INTEGRATION_TEST_CREDS }} diff --git a/.github/workflows/test-command.yml b/.github/workflows/test-command.yml index 4a9df05e8b759..0ee95c1758f4f 100644 --- a/.github/workflows/test-command.yml +++ b/.github/workflows/test-command.yml @@ -88,6 +88,7 @@ jobs: SENDGRID_INTEGRATION_TEST_CREDS: ${{ secrets.SENDGRID_INTEGRATION_TEST_CREDS }} SHOPIFY_INTEGRATION_TEST_CREDS: ${{ secrets.SHOPIFY_INTEGRATION_TEST_CREDS }} SLACK_TEST_CREDS: ${{ secrets.SLACK_TEST_CREDS }} + SOURCE_OKTA_TEST_CREDS: ${{ secrets.SOURCE_OKTA_TEST_CREDS }} SOURCE_SLACK_TEST_CREDS: ${{ secrets.SOURCE_SLACK_TEST_CREDS }} SMARTSHEETS_TEST_CREDS: ${{ secrets.SMARTSHEETS_TEST_CREDS }} SNOWFLAKE_INTEGRATION_TEST_CREDS: ${{ secrets.SNOWFLAKE_INTEGRATION_TEST_CREDS }} diff --git a/airbyte-integrations/connectors/source-okta/.dockerignore b/airbyte-integrations/connectors/source-okta/.dockerignore new file mode 100644 index 0000000000000..a25bb38f53b27 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/.dockerignore @@ -0,0 +1,7 @@ +* +!Dockerfile +!Dockerfile.test +!main.py +!source_okta +!setup.py +!secrets diff --git a/airbyte-integrations/connectors/source-okta/CHANGELOG.md b/airbyte-integrations/connectors/source-okta/CHANGELOG.md new file mode 100644 index 0000000000000..a3e34b0f7dff0 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 +Initial Release +Added the following incremental streams: +- Groups +- Logs +- Users diff --git a/airbyte-integrations/connectors/source-okta/Dockerfile b/airbyte-integrations/connectors/source-okta/Dockerfile new file mode 100644 index 0000000000000..011008b6d1fb8 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.7-slim + +# Bash is installed for more convenient debugging. +RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* + +WORKDIR /airbyte/integration_code +COPY source_okta ./source_okta +COPY main.py ./ +COPY setup.py ./ +RUN pip install . + +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] + +LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.name=airbyte/source-okta diff --git a/airbyte-integrations/connectors/source-okta/README.md b/airbyte-integrations/connectors/source-okta/README.md new file mode 100644 index 0000000000000..f44007dba37c0 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/README.md @@ -0,0 +1,129 @@ +# Okta Source + +This is the repository for the Okta source connector, written in Python. +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/okta). + +## Local development + +### Prerequisites +**To iterate on this connector, make sure to complete this prerequisites section.** + +#### Build & Activate Virtual Environment and install dependencies +From this connector directory, create a virtual environment: +``` +python -m venv .venv +``` + +This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your +development environment of choice. To activate it from the terminal, run: +``` +source .venv/bin/activate +pip install -r requirements.txt +``` +If you are in an IDE, follow your IDE's instructions to activate the virtualenv. + +Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is +used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`. +If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything +should work as you expect. + +#### Building via Gradle +You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow. + +To build using Gradle, from the Airbyte repository root, run: +``` +./gradlew :airbyte-integrations:connectors:source-okta:build +``` + +#### Create credentials +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/okta) +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_okta/spec.json` file. +Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. +See `integration_tests/sample_config.json` for a sample config file. + +**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source okta test creds` +and place them into `secrets/config.json`. + +### Locally running the connector +``` +python main.py spec +python main.py check --config secrets/config.json +python main.py discover --config secrets/config.json +python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json +``` + +### Locally running the connector docker image + +#### Build +First, make sure you build the latest Docker image: +``` +docker build . -t airbyte/source-okta:dev +``` + +You can also build the connector image via Gradle: +``` +./gradlew :airbyte-integrations:connectors:source-okta:airbyteDocker +``` +When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in +the Dockerfile. + +#### Run +Then run any of the connector commands as follows: +``` +docker run --rm airbyte/source-okta:dev spec +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-okta:dev check --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-okta:dev discover --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-okta:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json +``` +## Testing +Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named. +First install test dependencies into your virtual environment: +``` +pip install .[tests] +``` +### Unit Tests +To run unit tests locally, from the connector directory run: +``` +python -m pytest unit_tests +``` + +### Integration Tests +There are two types of integration tests: Acceptance Tests (Airbyte's test suite for all source connectors) and custom integration tests (which are specific to this connector). +#### Custom Integration tests +Place custom tests inside `integration_tests/` folder, then, from the connector root, run +``` +python -m pytest integration_tests +``` +#### Acceptance Tests +Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](source-acceptance-tests.md) for more information. +If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. +To run your integration tests with acceptance tests, from the connector root, run +``` +python -m pytest integration_tests -p integration_tests.acceptance +``` +To run your integration tests with docker + +### Using gradle to run tests +All commands should be run from airbyte project root. +To run unit tests: +``` +./gradlew :airbyte-integrations:connectors:source-okta:unitTest +``` +To run acceptance and custom integration tests: +``` +./gradlew :airbyte-integrations:connectors:source-okta:integrationTest +``` + +## Dependency Management +All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development. +We split dependencies between two groups, dependencies that are: +* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. +* required for the testing need to go to `TEST_REQUIREMENTS` list + +### Publishing a new version of the connector +You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? +1. Make sure your changes are passing unit and integration tests. +1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)). +1. Create a Pull Request. +1. Pat yourself on the back for being an awesome contributor. +1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master. diff --git a/airbyte-integrations/connectors/source-okta/acceptance-test-config.yml b/airbyte-integrations/connectors/source-okta/acceptance-test-config.yml new file mode 100644 index 0000000000000..be1d3a324cb68 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/acceptance-test-config.yml @@ -0,0 +1,18 @@ +connector_image: airbyte/source-okta:dev +tests: + spec: + - spec_path: "source_okta/spec.json" + connection: + - config_path: "secrets/config.json" + status: "succeed" + - config_path: "integration_tests/invalid_config.json" + status: "failed" + discovery: + - config_path: "secrets/config.json" + basic_read: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + validate_output_from_all_streams: yes + full_refresh: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-okta/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-okta/acceptance-test-docker.sh new file mode 100755 index 0000000000000..1425ff74f1511 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/acceptance-test-docker.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /tmp:/tmp \ + -v $(pwd):/test_input \ + airbyte/source-acceptance-test \ + --acceptance-test-config /test_input diff --git a/airbyte-integrations/connectors/source-okta/build.gradle b/airbyte-integrations/connectors/source-okta/build.gradle new file mode 100644 index 0000000000000..9201c83fc54c1 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'airbyte-python' + id 'airbyte-docker' + id 'airbyte-source-acceptance-test' +} + +airbytePython { + moduleDirectory 'source_okta' +} + +dependencies { + implementation files(project(':airbyte-integrations:bases:source-acceptance-test').airbyteDocker.outputs) +} diff --git a/airbyte-integrations/connectors/source-okta/integration_tests/__init__.py b/airbyte-integrations/connectors/source-okta/integration_tests/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/airbyte-integrations/connectors/source-okta/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-okta/integration_tests/acceptance.py new file mode 100644 index 0000000000000..f94044326bfc5 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/integration_tests/acceptance.py @@ -0,0 +1,11 @@ +import pytest + +pytest_plugins = ("source_acceptance_test.plugin",) + + +@pytest.fixture(scope="session", autouse=True) +def connector_setup(): + """This fixture is a placeholder for external resources that acceptance test might require.""" + # TODO: setup test dependencies + yield + # TODO: clean up test dependencies diff --git a/airbyte-integrations/connectors/source-okta/integration_tests/catalog.json b/airbyte-integrations/connectors/source-okta/integration_tests/catalog.json new file mode 100644 index 0000000000000..f9452748f05ee --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/integration_tests/catalog.json @@ -0,0 +1,34 @@ +{ + "streams": [ + { + "stream": { + "name": "groups", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + }, + { + "stream": { + "name": "logs", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["published"], + "primary_key": [["uuid"]] + }, + { + "stream": { + "name": "users", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + } + ] +} diff --git a/airbyte-integrations/connectors/source-okta/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-okta/integration_tests/configured_catalog.json new file mode 100644 index 0000000000000..d2ceffe68762f --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/integration_tests/configured_catalog.json @@ -0,0 +1,470 @@ +{ + "streams": [ + { + "stream": { + "name": "users", + "json_schema": { + "properties": { + "_links": { + "additionalProperties": { + "type": [ + "object", + "null" + ] + }, + "type": [ + "object", + "null" + ] + }, + "activated": { + "format": "date-time", + "type": "string" + }, + "created": { + "format": "date-time", + "type": "string" + }, + "credentials": { + "properties": { + "password": { + "properties": { + "hash": { + "properties": { + "algorithm": { + "enum": [ + "BCRYPT", + "SHA-512", + "SHA-256", + "SHA-1", + "MD5" + ], + "type": [ + "string", + "null" + ] + }, + "salt": { + "type": [ + "string", + "null" + ] + }, + "saltOrder": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": [ + "string", + "null" + ] + }, + "workFactor": { + "type": [ + "integer", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "hook": { + "properties": { + "type": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "value": { + "format": "password", + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "provider": { + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "ACTIVE_DIRECTORY", + "FEDERATION", + "LDAP", + "OKTA", + "SOCIAL", + "IMPORT" + ], + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "recovery_question": { + "properties": { + "answer": { + "type": [ + "string", + "null" + ] + }, + "question": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "lastLogin": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + }, + "passwordChanged": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "profile": { + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "costCenter": { + "type": [ + "string", + "null" + ] + }, + "countryCode": { + "type": [ + "string", + "null" + ] + }, + "department": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "division": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "employeeNumber": { + "type": [ + "string", + "null" + ] + }, + "firstName": { + "type": [ + "string", + "null" + ] + }, + "honorificPrefix": { + "type": [ + "string", + "null" + ] + }, + "honorificSuffix": { + "type": [ + "string", + "null" + ] + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "locale": { + "type": [ + "string", + "null" + ] + }, + "login": { + "type": [ + "string", + "null" + ] + }, + "manager": { + "type": [ + "string", + "null" + ] + }, + "managerId": { + "type": [ + "string", + "null" + ] + }, + "middleName": { + "type": [ + "string", + "null" + ] + }, + "mobilePhone": { + "type": [ + "string", + "null" + ] + }, + "nickName": { + "type": [ + "string", + "null" + ] + }, + "organization": { + "type": [ + "string", + "null" + ] + }, + "postalAddress": { + "type": [ + "string", + "null" + ] + }, + "preferredLanguage": { + "type": [ + "string", + "null" + ] + }, + "primaryPhone": { + "type": [ + "string", + "null" + ] + }, + "profileUrl": { + "type": [ + "string", + "null" + ] + }, + "secondEmail": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] + }, + "streetAddress": { + "type": [ + "string", + "null" + ] + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "userType": { + "type": [ + "string", + "null" + ] + }, + "zipCode": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "status": { + "enum": [ + "ACTIVE", + "DEPROVISIONED", + "LOCKED_OUT", + "PASSWORD_EXPIRED", + "PROVISIONED", + "RECOVERY", + "STAGED", + "SUSPENDED" + ], + "type": "string" + }, + "statusChanged": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "type": { + "properties": { + "id": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + } + }, + "type": "object" + }, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + }, + { + "stream": { + "name": "groups", + "json_schema": { + "properties": { + "_links": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + }, + "created": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "lastMembershipUpdated": { + "format": "date-time", + "type": "string" + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + }, + "objectClass": { + "items": { + "type": ["string", "null"] + }, + "type": ["array", "null"] + }, + "profile": { + "properties": { + "description": { + "type": ["string", "null"] + }, + "name": { + "type": ["string", "null"] + } + }, + "type": "object" + }, + "type": { + "enum": [ + "OKTA_GROUP", + "APP_GROUP", + "BUILT_IN" + ], + "type": "string" + } + }, + "type": "object" + }, + "supported_sync_modes": ["full_refresh", "incremental"] + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + } + ] +} diff --git a/airbyte-integrations/connectors/source-okta/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-okta/integration_tests/invalid_config.json new file mode 100644 index 0000000000000..6322da62450f4 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/integration_tests/invalid_config.json @@ -0,0 +1,4 @@ +{ + "base_url": "invalid url", + "token": "invalid token" +} diff --git a/airbyte-integrations/connectors/source-okta/main.py b/airbyte-integrations/connectors/source-okta/main.py new file mode 100644 index 0000000000000..5de24b12e4263 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/main.py @@ -0,0 +1,31 @@ +# MIT License +# +# Copyright (c) 2020 Airbyte +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +import sys + +from airbyte_cdk.entrypoint import launch +from source_okta import SourceOkta + +if __name__ == "__main__": + source = SourceOkta() + launch(source, sys.argv[1:]) diff --git a/airbyte-integrations/connectors/source-okta/requirements.txt b/airbyte-integrations/connectors/source-okta/requirements.txt new file mode 100644 index 0000000000000..0411042aa0911 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/requirements.txt @@ -0,0 +1,2 @@ +-e ../../bases/source-acceptance-test +-e . diff --git a/airbyte-integrations/connectors/source-okta/sample_files/catalog.json b/airbyte-integrations/connectors/source-okta/sample_files/catalog.json new file mode 100644 index 0000000000000..f9452748f05ee --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/sample_files/catalog.json @@ -0,0 +1,34 @@ +{ + "streams": [ + { + "stream": { + "name": "groups", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + }, + { + "stream": { + "name": "logs", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["published"], + "primary_key": [["uuid"]] + }, + { + "stream": { + "name": "users", + "json_schema": {} + }, + "sync_mode": "incremental", + "destination_sync_mode": "overwrite", + "cursor_field": ["lastUpdated"], + "primary_key": [["id"]] + } + ] +} diff --git a/airbyte-integrations/connectors/source-okta/setup.py b/airbyte-integrations/connectors/source-okta/setup.py new file mode 100644 index 0000000000000..5f5b5e63a6850 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/setup.py @@ -0,0 +1,47 @@ +# MIT License +# +# Copyright (c) 2020 Airbyte +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +from setuptools import find_packages, setup + +MAIN_REQUIREMENTS = [ + "airbyte-cdk~=0.1", + "pendulum==1.2.0", +] + +TEST_REQUIREMENTS = [ + "pytest~=6.1", + "source-acceptance-test", +] + +setup( + name="source_okta", + description="Source implementation for Okta.", + author="Airbyte", + author_email="contact@airbyte.io", + packages=find_packages(), + install_requires=MAIN_REQUIREMENTS, + package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]}, + extras_require={ + "tests": TEST_REQUIREMENTS, + }, +) diff --git a/airbyte-integrations/connectors/source-okta/source_okta/__init__.py b/airbyte-integrations/connectors/source-okta/source_okta/__init__.py new file mode 100644 index 0000000000000..c0977ddc873c0 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/__init__.py @@ -0,0 +1,27 @@ +""" +MIT License + +Copyright (c) 2020 Airbyte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" + +from .source import SourceOkta + +__all__ = ["SourceOkta"] diff --git a/airbyte-integrations/connectors/source-okta/source_okta/schemas/groups.json b/airbyte-integrations/connectors/source-okta/source_okta/schemas/groups.json new file mode 100644 index 0000000000000..d86663c48ae92 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/schemas/groups.json @@ -0,0 +1,51 @@ +{ + "properties": { + "_links": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + }, + "created": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "lastMembershipUpdated": { + "format": "date-time", + "type": "string" + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + }, + "objectClass": { + "items": { + "type": ["string", "null"] + }, + "type": ["array", "null"] + }, + "profile": { + "properties": { + "description": { + "type": ["string", "null"] + }, + "name": { + "type": ["string", "null"] + } + }, + "type": "object" + }, + "type": { + "enum": [ + "OKTA_GROUP", + "APP_GROUP", + "BUILT_IN" + ], + "type": "string" + } + }, + "type": "object" +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-okta/source_okta/schemas/logs.json b/airbyte-integrations/connectors/source-okta/source_okta/schemas/logs.json new file mode 100644 index 0000000000000..1ff208b2b088c --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/schemas/logs.json @@ -0,0 +1,315 @@ +{ + "properties": { + "actor": { + "properties": { + "alternateId": { + "type": ["string", "null"] + }, + "detail": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + }, + "displayName": { + "type": ["string", "null"] + }, + "id": { + "type": ["string", "null"] + }, + "type": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "authenticationContext": { + "properties": { + "authenticationProvider": { + "enum": [ + "OKTA_AUTHENTICATION_PROVIDER", + "ACTIVE_DIRECTORY", + "LDAP", + "FEDERATION", + "SOCIAL", + "FACTOR_PROVIDER" + ], + "type": ["string", "null"] + }, + "authenticationStep": { + "type": ["integer", "null"] + }, + "credentialProvider": { + "enum": [ + "OKTA_AUTHENTICATION_PROVIDER", + "OKTA_CREDENTIAL_PROVIDER", + "RSA", + "SYMANTEC", + "GOOGLE", + "DUO", + "YUBIKEY" + ], + "type": ["string", "null"] + }, + "credentialType": { + "enum": [ + "OTP", + "SMS", + "PASSWORD", + "ASSERTION", + "IWA", + "EMAIL", + "OAUTH2", + "JWT" + ], + "type": ["string", "null"] + }, + "externalSessionId": { + "type": ["string", "null"] + }, + "interface": { + "type": ["string", "null"] + }, + "issuer": { + "properties": { + "id": { + "type": ["string", "null"] + }, + "type": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + } + }, + "type": ["object", "null"] + }, + "client": { + "properties": { + "device": { + "type": ["string", "null"] + }, + "geographicalContext": { + "properties": { + "city": { + "type": ["string", "null"] + }, + "country": { + "type": ["string", "null"] + }, + "geolocation": { + "properties": { + "lat": { + "format": "double", + "type": ["number", "null"] + }, + "lon": { + "format": "double", + "type": ["number", "null"] + } + }, + "type": ["object", "null"] + }, + "postalCode": { + "type": ["string", "null"] + }, + "state": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "id": { + "type": ["string", "null"] + }, + "ipAddress": { + "type": ["string", "null"] + }, + "userAgent": { + "properties": { + "browser": { + "type": ["string", "null"] + }, + "os": { + "type": ["string", "null"] + }, + "rawUserAgent": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "zone": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "debugContext": { + "properties": { + "debugData": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + } + }, + "type": ["object", "null"] + }, + "displayMessage": { + "type": ["string", "null"] + }, + "eventType": { + "type": "string" + }, + "legacyEventType": { + "type": ["string", "null"] + }, + "outcome": { + "properties": { + "reason": { + "type": ["string", "null"] + }, + "result": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "published": { + "format": "date-time", + "type": "string" + }, + "request": { + "properties": { + "ipChain": { + "items": { + "properties": { + "geographicalContext": { + "properties": { + "city": { + "type": ["string", "null"] + }, + "country": { + "type": ["string", "null"] + }, + "geolocation": { + "properties": { + "lat": { + "format": "double", + "type": ["number", "null"] + }, + "lon": { + "format": "double", + "type": ["number", "null"] + } + }, + "type": ["object", "null"] + }, + "postalCode": { + "type": ["string", "null"] + }, + "state": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "ip": { + "type": ["string", "null"] + }, + "source": { + "type": ["string", "null"] + }, + "version": { + "type": "string" + } + }, + "type": ["object", "null"] + }, + "type": ["array", "null"] + } + }, + "type": ["object", "null"] + }, + "securityContext": { + "properties": { + "asNumber": { + "type": ["integer", "null"] + }, + "asOrg": { + "type": ["string", "null"] + }, + "domain": { + "type": ["string", "null"] + }, + "isProxy": { + "type": ["boolean", "null"] + }, + "isp": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "severity": { + "enum": [ + "DEBUG", + "INFO", + "WARN", + "ERROR" + ], + "type": "string" + }, + "target": { + "items": { + "properties": { + "alternateId": { + "type": ["string", "null"] + }, + "detailEntry": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + }, + "displayName": { + "type": ["string", "null"] + }, + "id": { + "type": ["string", "null"] + }, + "type": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "type": ["array", "null"] + }, + "transaction": { + "properties": { + "detail": { + "additionalProperties": { + "type": ["object", "null"] + }, + "type": ["object", "null"] + }, + "id": { + "type": ["string", "null"] + }, + "type": { + "type": ["string", "null"] + } + }, + "type": ["object", "null"] + }, + "uuid": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-okta/source_okta/schemas/users.json b/airbyte-integrations/connectors/source-okta/source_okta/schemas/users.json new file mode 100644 index 0000000000000..6c4a67e72e1a3 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/schemas/users.json @@ -0,0 +1,395 @@ +{ + "properties": { + "_links": { + "additionalProperties": { + "type": [ + "object", + "null" + ] + }, + "type": [ + "object", + "null" + ] + }, + "activated": { + "format": "date-time", + "type": "string" + }, + "created": { + "format": "date-time", + "type": "string" + }, + "credentials": { + "properties": { + "password": { + "properties": { + "hash": { + "properties": { + "algorithm": { + "enum": [ + "BCRYPT", + "SHA-512", + "SHA-256", + "SHA-1", + "MD5" + ], + "type": [ + "string", + "null" + ] + }, + "salt": { + "type": [ + "string", + "null" + ] + }, + "saltOrder": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": [ + "string", + "null" + ] + }, + "workFactor": { + "type": [ + "integer", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "hook": { + "properties": { + "type": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "value": { + "format": "password", + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "provider": { + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "ACTIVE_DIRECTORY", + "FEDERATION", + "LDAP", + "OKTA", + "SOCIAL", + "IMPORT" + ], + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "recovery_question": { + "properties": { + "answer": { + "type": [ + "string", + "null" + ] + }, + "question": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "lastLogin": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "lastUpdated": { + "format": "date-time", + "type": "string" + }, + "passwordChanged": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "profile": { + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "costCenter": { + "type": [ + "string", + "null" + ] + }, + "countryCode": { + "type": [ + "string", + "null" + ] + }, + "department": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "division": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "employeeNumber": { + "type": [ + "string", + "null" + ] + }, + "firstName": { + "type": [ + "string", + "null" + ] + }, + "honorificPrefix": { + "type": [ + "string", + "null" + ] + }, + "honorificSuffix": { + "type": [ + "string", + "null" + ] + }, + "lastName": { + "type": [ + "string", + "null" + ] + }, + "locale": { + "type": [ + "string", + "null" + ] + }, + "login": { + "type": [ + "string", + "null" + ] + }, + "manager": { + "type": [ + "string", + "null" + ] + }, + "managerId": { + "type": [ + "string", + "null" + ] + }, + "middleName": { + "type": [ + "string", + "null" + ] + }, + "mobilePhone": { + "type": [ + "string", + "null" + ] + }, + "nickName": { + "type": [ + "string", + "null" + ] + }, + "organization": { + "type": [ + "string", + "null" + ] + }, + "postalAddress": { + "type": [ + "string", + "null" + ] + }, + "preferredLanguage": { + "type": [ + "string", + "null" + ] + }, + "primaryPhone": { + "type": [ + "string", + "null" + ] + }, + "profileUrl": { + "type": [ + "string", + "null" + ] + }, + "secondEmail": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] + }, + "streetAddress": { + "type": [ + "string", + "null" + ] + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "userType": { + "type": [ + "string", + "null" + ] + }, + "zipCode": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "status": { + "enum": [ + "ACTIVE", + "DEPROVISIONED", + "LOCKED_OUT", + "PASSWORD_EXPIRED", + "PROVISIONED", + "RECOVERY", + "STAGED", + "SUSPENDED" + ], + "type": "string" + }, + "statusChanged": { + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "type": { + "properties": { + "id": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + } + }, + "type": "object" +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-okta/source_okta/source.py b/airbyte-integrations/connectors/source-okta/source_okta/source.py new file mode 100644 index 0000000000000..5bea8795f2f2e --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/source.py @@ -0,0 +1,183 @@ +# MIT License +# +# Copyright (c) 2020 Airbyte +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +import re +from abc import ABC, abstractmethod +from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple +from urllib import parse + +import requests +import pendulum +from airbyte_cdk.sources import AbstractSource +from airbyte_cdk.sources.streams import Stream +from airbyte_cdk.sources.streams.http import HttpStream +from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator + + +class OktaStream(HttpStream, ABC): + page_size = 200 + + def __init__(self, url_base: str, *args, **kwargs): + super().__init__(*args, **kwargs) + # Inject custom url base to the stream + self._url_base = url_base + + @property + def url_base(self) -> str: + return self._url_base + + def next_page_token( + self, + response: requests.Response + ) -> Optional[Mapping[str, Any]]: + # Follow the next page cursor + # https://developer.okta.com/docs/reference/api-overview/#pagination + link_regex = r'<(.+?)>; rel="(.+?)"[,\s]*' + raw_links = response.headers['link'] + for link, cursor_type in re.findall(link_regex, raw_links): + if cursor_type == 'next': + parsed_link = parse.urlparse(link) + query_params = dict(parse.parse_qsl(parsed_link.query)) + return query_params + return None + + def request_params( + self, + stream_state: Mapping[str, Any], + stream_slice: Mapping[str, any] = None, + next_page_token: Mapping[str, Any] = None, + ) -> MutableMapping[str, Any]: + return { + 'limit': self.page_size, + **(next_page_token or {}), + } + + def parse_response( + self, + response: requests.Response, + **kwargs, + ) -> Iterable[Mapping]: + yield from response.json() + + def backoff_time(self, response: requests.Response) -> Optional[float]: + # The rate limit resets on the timestamp indicated + # https://developer.okta.com/docs/reference/rate-limits + if response.status_code == requests.codes.TOO_MANY_REQUESTS: + next_reset_epoch = int(response.headers['x-rate-limit-reset']) + next_reset = pendulum.from_timestamp(next_reset_epoch) + next_reset_duration = pendulum.utcnow().diff(next_reset) + return next_reset_duration.seconds + + +class IncrementalOktaStream(OktaStream, ABC): + @property + @abstractmethod + def cursor_field(self) -> str: + pass + + def get_updated_state( + self, + current_stream_state: MutableMapping[str, Any], + latest_record: Mapping[str, Any] + ) -> Mapping[str, Any]: + lowest_date = str(pendulum.datetime.min) + return { + self.cursor_field: max( + latest_record.get(self.cursor_field, lowest_date), + current_stream_state.get(self.cursor_field, lowest_date), + ) + } + + def request_params(self, stream_state=None, **kwargs): + stream_state = stream_state or {} + params = super().request_params(stream_state=stream_state, **kwargs) + latest_entry = stream_state.get(self.cursor_field) + if latest_entry: + params['filter'] = f'{self.cursor_field} gt {latest_entry}' + return params + + +class Groups(IncrementalOktaStream): + cursor_field = "lastUpdated" + primary_key = "id" + + def path(self, **kwargs) -> str: + return "groups" + + +class Logs(IncrementalOktaStream): + cursor_field = "published" + primary_key = "uuid" + + def path(self, **kwargs) -> str: + return "logs" + + +class Users(IncrementalOktaStream): + cursor_field = "lastUpdated" + primary_key = "id" + + def path(self, **kwargs) -> str: + return "users" + + +class SourceOkta(AbstractSource): + def initialize_authenticator(self, config: Mapping[str, Any]) -> TokenAuthenticator: + return TokenAuthenticator(config['token'], auth_method='SSWS') + + def get_url_base(self, config: Mapping[str, Any]) -> str: + return parse.urljoin(config['base_url'], '/api/v1/') + + def check_connection(self, logger, config) -> Tuple[bool, any]: + try: + auth = self.initialize_authenticator(config) + base_url = self.get_url_base(config) + url = parse.urljoin(base_url, 'users') + + response = requests.get( + url, + params={'limit': 1}, + headers=auth.get_auth_header(), + ) + + if response.status_code == requests.codes.ok: + return True, None + + return False, response.json() + except Exception: + return False, 'Failed to authenticate with the provided credentials' + + def streams(self, config: Mapping[str, Any]) -> List[Stream]: + auth = self.initialize_authenticator(config) + url_base = self.get_url_base(config) + + initialization_params = { + 'authenticator': auth, + 'url_base': url_base, + } + + return [ + Groups(**initialization_params), + Logs(**initialization_params), + Users(**initialization_params), + ] diff --git a/airbyte-integrations/connectors/source-okta/source_okta/spec.json b/airbyte-integrations/connectors/source-okta/source_okta/spec.json new file mode 100644 index 0000000000000..4f5d7d4bae63b --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/source_okta/spec.json @@ -0,0 +1,24 @@ +{ + "documentationUrl": "https://docs.airbyte.io/integrations/sources/okta", + "connectionSpecification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Okta Spec", + "type": "object", + "required": ["token", "base_url"], + "additionalProperties": false, + "properties": { + "token": { + "type": "string", + "title": "API Token", + "description": "A Okta token. See the docs for instructions on how to generate it.", + "airbyte_secret": true + }, + "base_url": { + "type": "string", + "title": "Base URL", + "description": "The Okta base URL.", + "airbyte_secret": true + } + } + } +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-okta/unit_tests/unit_test.py b/airbyte-integrations/connectors/source-okta/unit_tests/unit_test.py new file mode 100644 index 0000000000000..f03f99f7c46e7 --- /dev/null +++ b/airbyte-integrations/connectors/source-okta/unit_tests/unit_test.py @@ -0,0 +1,25 @@ +# MIT License +# +# Copyright (c) 2020 Airbyte +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +def test_example_method(): + assert True diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 41d62a5e3b648..ac08f4c87cff4 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -64,6 +64,7 @@ * [Mixpanel](integrations/sources/mixpanel.md) * [Mongo DB](integrations/sources/mongodb.md) * [MySQL](integrations/sources/mysql.md) + * [Okta](integrations/sources/okta.md) * [Oracle DB](integrations/sources/oracle.md) * [Plaid](integrations/sources/plaid.md) * [PokéAPI](integrations/sources/pokeapi.md) diff --git a/docs/integrations/README.md b/docs/integrations/README.md index ab2e2b2f26720..dde38e5631686 100644 --- a/docs/integrations/README.md +++ b/docs/integrations/README.md @@ -45,6 +45,7 @@ Airbyte uses a grading system for connectors to help users understand what to ex |[Mixpanel](./sources/mixpanel.md)| Beta | |[Mongo DB](./sources/mongodb.md)| Alpha | |[MySQL](./sources/mysql.md)| Certified | +|[Okta](./sources/okta.md)| Beta | |[Oracle DB](./sources/oracle.md)| Certified | |[Plaid](./sources/plaid.md)| Alpha | |[PokéAPI](./sources/pokeapi.md)| Beta | diff --git a/docs/integrations/sources/okta.md b/docs/integrations/sources/okta.md new file mode 100644 index 0000000000000..0d5ac54e68950 --- /dev/null +++ b/docs/integrations/sources/okta.md @@ -0,0 +1,56 @@ +# Okta + +## Sync overview + +This source can sync data for the [Okta API](https://developer.okta.com/docs/reference/). It supports both Full Refresh and Incremental syncs. You can choose if this connector will copy only the new or updated data, or all rows in the tables and columns you set up for replication, every time a sync is run. + +### Output schema + +This Source is capable of syncing the following core Streams: + +* [Users](https://developer.okta.com/docs/reference/api/users/#list-users) +* [Groups](https://developer.okta.com/docs/reference/api/groups/#list-groups) +* [System Log](https://developer.okta.com/docs/reference/api/system-log/#get-started) + +### Data type mapping + +| Integration Type | Airbyte Type | Notes | +| :--- | :--- | :--- | +| `string` | `string` | | +| `number` | `number` | | +| `array` | `array` | | +| `object` | `object` | | + +### Features + +| Feature | Supported?\(Yes/No\) | Notes | +| :--- | :--- | :--- | +| Full Refresh Sync | Yes | | +| Incremental Sync | Yes | | +| Namespaces | No | | + +### Performance considerations + +The connector is restricted by normal Okta [requests limitation](https://developer.okta.com/docs/reference/rate-limits/). + +## Getting started + +### Requirements + +* Okta API Token + +### Setup guide + +In order to pull data out of your Okta instance, you need to create an [API Token](https://developer.okta.com/docs/guides/create-an-api-token/overview/). + +{% hint style="info" %} +Different Okta APIs require different admin privilege levels. API tokens inherit the privilege level of the admin account used to create them +{% endhint %} + +1. Sign in to your Okta organization as a user with [administrator privileges](https://help.okta.com/en/prod/okta_help_CSH.htm#ext_Security_Administrators) +2. Access the API page: In the Admin Console, select API from the Security menu and then select the Tokens tab. +3. Click Create Token. +4. Name your token and click Create Token. +5. Record the token value. This is the only opportunity to see it and record it. +8. In Airbyte, create a Okta source. +9. You can now pull data from your Okta instance! diff --git a/tools/bin/ci_credentials.sh b/tools/bin/ci_credentials.sh index 9ffd6f5e128b5..16241130c9d8b 100755 --- a/tools/bin/ci_credentials.sh +++ b/tools/bin/ci_credentials.sh @@ -62,6 +62,7 @@ write_standard_creds source-marketo-singer "$SOURCE_MARKETO_SINGER_INTEGRATION_T write_standard_creds source-microsoft-teams "$MICROSOFT_TEAMS_TEST_CREDS" write_standard_creds source-mixpanel-singer "$MIXPANEL_INTEGRATION_TEST_CREDS" write_standard_creds source-quickbooks-singer "$QUICKBOOKS_TEST_CREDS" +write_standard_creds source-okta "$SOURCE_OKTA_TEST_CREDS" write_standard_creds source-recharge "$RECHARGE_INTEGRATION_TEST_CREDS" write_standard_creds source-recurly "$SOURCE_RECURLY_INTEGRATION_TEST_CREDS" write_standard_creds source-redshift "$AWS_REDSHIFT_INTEGRATION_TEST_CREDS"