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

fix(integrations): update base_url for gong-oauth #1770

Merged
merged 11 commits into from
Aug 8, 2024

Conversation

hassan254-prog
Copy link
Collaborator

Describe your changes

Gong recently made changes to their API. Gong-oauth now uses api_base_url_for_customer, which varies for each customer, as its base_url for proxy requests. This parameter is returned in the response of generate-customer-token when exchanging code for an access token.

Issue ticket number and link

Checklist before requesting a review (skip if just adding/editing APIs & templates)

  • I added tests, otherwise the reason is:
  • I added observability, otherwise the reason is:
  • I added analytics, otherwise the reason is:

@khaliqgant
Copy link
Member

@hassan254-prog should this still be in draft?

@hassan254-prog
Copy link
Collaborator Author

Robin had suggested I place it in draft just in case there is more work to it.

@tconlin
Copy link
Contributor

tconlin commented Mar 11, 2024

@hassan254-prog Will this automatically work for all customers? Will there ever be a situation where a sync will fail because a customer does not yet have api_base_url_for_customer defined?

@hassan254-prog
Copy link
Collaborator Author

@tconlin , according to this thread, whenever the code is exchanged for an access token during authorization, as part of data residency support, the api_base_url_for_customer will be generated and returned in response. Have you gotten the chance to test this?

@tconlin
Copy link
Contributor

tconlin commented Mar 14, 2024

@rguldener Can we bring this out of drafts?

@rguldener
Copy link
Member

@rguldener Can we bring this out of drafts?

Sure! I only suggested draft initially because there might have been more work needed. Feel free to move this forward.

@tconlin tconlin marked this pull request as ready for review March 15, 2024 15:49
@@ -753,7 +755,7 @@ gong-oauth:
disable_pkce: true
token_request_auth_method: basic
proxy:
base_url: https://api.gong.io
base_url: ${connectionConfig.api_base_url_for_customer}
Copy link
Member

@bastienbeurier bastienbeurier Mar 15, 2024

Choose a reason for hiding this comment

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

I'm concerned this will break existing connections that don't have the api_base_url_for_customer field populated in the connection config.

Is there a way to fall back to https://api.gong.io?

Would something like ${connectionConfig.api_base_url_for_customer || 'https://api.gong.io} work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bastienbeurier , I will do some test on this and see if the platform will handle such case. Incase of any changes to the platform, I will add them to this pull request. Thank you.

Copy link
Member

Choose a reason for hiding this comment

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

For reference, I checked that no one was using Gong in prod at the moment.

Copy link
Collaborator

@TBonnin TBonnin left a comment

Choose a reason for hiding this comment

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

is it still the case that nobody uses gong, because that's a breaking change. otherwise look good to me

@hassan254-prog
Copy link
Collaborator Author

@TBonnin , I don't have much context on this, but the last time we checked with @bastienbeurier , it was okay to merge. Could you please check if the number has changed before merging? Thank you!

@TBonnin TBonnin self-requested a review July 12, 2024 20:09
@TBonnin
Copy link
Collaborator

TBonnin commented Jul 12, 2024

@TBonnin , I don't have much context on this, but the last time we checked with @bastienbeurier , it was okay to merge. Could you please check if the number has changed before merging? Thank you!

I see 12 accounts using gong-auth in prod environments (5 have connections). We are gonna need a strategy so we don't break their integrations cc @bastienbeurier for visibility

@bastienbeurier
Copy link
Member

@TBonnin , I don't have much context on this, but the last time we checked with @bastienbeurier , it was okay to merge. Could you please check if the number has changed before merging? Thank you!

I see 12 accounts using gong-auth in prod environments (5 have connections). We are gonna need a strategy so we don't break their integrations cc @bastienbeurier for visibility

I also see production usage for it.

@hassan254-prog @TBonnin @khaliqgant Is there a way to have a fallback system to avoid a breaking change?

Something like ${connectionConfig.api_base_url_for_customer || 'https://api.gong.io'}

@TBonnin
Copy link
Collaborator

TBonnin commented Jul 24, 2024

Something like ${connectionConfig.api_base_url_for_customer || 'https://api.gong.io'}

I don't think we support this syntax in providers.yaml @khaliqgant might be able to confirm.

Could we populate the connection config for existing gong-auth connections with the default url? Might require synchronization between doing that and releasing this change though.

@khaliqgant
Copy link
Member

khaliqgant commented Jul 25, 2024

Something like ${connectionConfig.api_base_url_for_customer || 'https://api.gong.io'}

I don't think we support this syntax in providers.yaml @khaliqgant might be able to confirm.

No we don't but the idea was brought up in the past but decided against it to not have too much code like syntax in yaml which might prove difficult to maintain.

Copy link

gitguardian bot commented Aug 2, 2024

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
8205899 Triggered Generic Password 2bb094f docker-compose.yaml View secret
8205899 Triggered Generic Password 2bb094f dev/docker-compose.dev.yaml View secret
8205899 Triggered Generic Password 2bb094f dev/docker-compose.dev.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@hassan254-prog hassan254-prog changed the title feat(integrations):api support for gong-oauth fix(integrations): update base_url for gong-oauth Aug 2, 2024
packages/shared/providers.yaml Show resolved Hide resolved
@bodinsamuel bodinsamuel enabled auto-merge (squash) August 5, 2024 12:41
@bodinsamuel bodinsamuel merged commit f67df26 into NangoHQ:master Aug 8, 2024
19 of 22 checks passed
@@ -1124,7 +1126,7 @@ gong-oauth:
disable_pkce: true
token_request_auth_method: basic
proxy:
base_url: https://api.gong.io
base_url: ${connectionConfig.api_base_url_for_customer} || https://api.gong.io
Copy link
Member

Choose a reason for hiding this comment

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

@bodinsamuel unless I missed something this won’t work without #1873?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah wasn't aware of this, thanks 👌🏻

bodinsamuel pushed a commit that referenced this pull request Aug 9, 2024
## Describe your changes
Continuing from this,
#1770 (comment). We
need to have a fallback incase `api_base_url_for_customer` field is not
populated in the connection configuration. I have also added a unit test
for this..

---------

Co-authored-by: Khaliq <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants