Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-genesys: new connector #2136

Merged
merged 4 commits into from
Nov 12, 2024
Merged

source-genesys: new connector #2136

merged 4 commits into from
Nov 12, 2024

Conversation

Alex-Bair
Copy link
Contributor

@Alex-Bair Alex-Bair commented Nov 11, 2024

Description:

This PR introduces a new connector source-genesys with two streams.

The main changes in this PR are:

  • Update estuary-cdk to support the OAuth2 client credentials grant type flow as detailed per the OAuth 2.0 standard.
    • Since Genesys API URLs have a cloud region dependent domain, the user will have to select which domain is used for their Genesys Cloud deployment. Our current OAuth2 flow that shows a nice "Authenticate with OAuth" button in the UI doesn't support using URLs that contain user-configured domains. Genesys requires OAuth2 for authorization, so I added the capability to use the client credentials grant type flow for OAuth2 to support these use cases where a URL within the OAuth flow must contain a user-configured value.
  • Create the new source-genesys connector with the following two streams:
    1. users - snapshot
    2. conversations- incremental
      a. The asynchronous analytics job endpoint is used for incremental updates. It is not updated in real-time, and data availability can be delayed by hours to a full day (ex: the delay's been ~13 hours during my testing). However, this is the only reliable way to get updated conversations, so it's used.
      b. The query endpoint is updated in real-time, but is only appropriate for retrieving conversations when they're created - we can't ask this endpoint for updated conversations. An implementation using this query endpoint is left in a previous commit in case we want to use it later if/when the CDK can support delayed streams or multiple cursors per stream.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

Documentation will need created for source-genesys. I'll link the doc creation PR once it is ready.

Notes for reviewers:

Tested on a local stack. Confirmed:

  • Authorization with the OAuth2 client credentials flow works.
  • users snapshots work as intended and retrieve all expected data.
  • conversations backfills and incremental replication work as intended and retrieve all expected data.

I used a trial Genesys account for initial testing & setup. Since these trial accounts expire after a month, I did not include a capture snapshot.


This change is Reviewable

Currently, only the OAuth2 Authorization Code grant type flow is
supported. Upcoming SaaS connectors require more flexibility & can use
different OAuth2 grant type flows. For example, the Genesys connector
needs a user-configured domain to perform authentication and get an
access token. Our current OAuth2 framework only supports access token
URLs that don't contain user-configured values, and adding that support
would be a larger effort than we want to take on right now. With the
Client Credentials grant type flow, we can inject a user-configured
value in the access token URL at runtime to support this use case.
@Alex-Bair Alex-Bair marked this pull request as ready for review November 11, 2024 21:53
@Alex-Bair Alex-Bair added the change:planned This is a planned change label Nov 11, 2024
@Alex-Bair Alex-Bair linked an issue Nov 11, 2024 that may be closed by this pull request
@Alex-Bair Alex-Bair force-pushed the bair/source-genesys branch 2 times, most recently from a94e1e0 to 330204e Compare November 12, 2024 02:04
source-genesys/test.flow.yaml Outdated Show resolved Hide resolved
source-genesys/source_genesys/api.py Show resolved Hide resolved
source-genesys/source_genesys/api.py Outdated Show resolved Hide resolved
This is a minimal connector for Genesys, containing just the `users`
and `conversations` streams.

`users` is a simple snapshot since there is no way to request updated
users.

`conversations` is incremental and leverage two different endpoints. A
real-time endpoint is used to get created conversations incrementally.
This real-time endpoint is not appropriate to get updates
(we can only specify time ranges for created conversations), so we also
attempt to use the delayed, asynchronous analytics job endpoint to get
conversations that have ended in the last day. This is not meant to
capture all ended conversations as there are scenarios where we would
miss capturing these updates (ex: no conversations are created for a
while but conversations are ended), and a backfill will be required to
fully capture all ended conversations.
The code for retrieving conversations in real-time from the query
endpoint is left in the previous commit in case we want to add this
functionality later when the CDK has the capability to have a delayed
stream / a second cursor.
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alex-Bair Alex-Bair merged commit 0cfda62 into main Nov 12, 2024
73 of 78 checks passed
@Alex-Bair Alex-Bair deleted the bair/source-genesys branch November 12, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:planned This is a planned change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new connector: source-genesys
2 participants