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

feat: "Proxy only" providers #2131

Conversation

kishenpateldotwork
Copy link
Contributor

@kishenpateldotwork kishenpateldotwork commented May 9, 2024

Describe your changes

Allows for a general purpose solution in which we can leverage "proxy only" connections for non-public systems (weather that be via basic auth, api key+token, bearer auth, etc) by using one of the 3 "proxy-only" providers. Using the connection POST import API to create it with the necessary connection config so Nango continues to hold the credentials (vs needing to pass them in as headers / overrides into the proxy).

Providers with example use cases would be like something below:

unauthenticated-proxy-only

POST connection example:

{
  "connection_id": "some-uuid-pokemon-2",
  "provider_config_key": "unauthenticated-proxy-only",
  "connection_config": {"base_url":"https://pokeapi.co/api/v2/"}
}

Proxy example:

curl -X GET "{{nango_url}}/proxy/{{endpoint}}" \ # e.g. pokemon
     -H "Provider-Config-Key: unauthenticated-proxy-only" \
     -H "Connection-Id: some-uuid-pokemon-2"

basic-proxy-only

POST connection example:

{
  "connection_id": "some-uuid-proxy-1",
  "username": "some@email.com",
  "password": "some-password",
  "provider_config_key": "basic-proxy-only",
  "connection_config": {"base_url":"https://domain.atlassian.net/rest/api/2/"}
}

Proxy example:

curl -X GET "{{nango_url}}/proxy/{{endpoint}}" \ #e.g. field
     -H "Provider-Config-Key: basic-proxy-only" \
     -H "Connection-Id: some-uuid-proxy-2"

api-key-proxy-only

POST connection example:

{
  "connection_id": "some-uuid-api-key-proxy-3",
  "api_key": "some-api-key",
  "provider_config_key": "api-key-proxy-only",
  "connection_config": {
    "base_url":"https://api.clickup.com/api/v2/",
    "api_key_header" : "Authorization" // or some other header
  }
}

Proxy example:

// proxy example:
curl -X GET "{{nango_url}}/proxy/{{endpoint}}" \ #e.g. list/901700801220/task
     -H "Provider-Config-Key: api-key-proxy-only" \
     -H "Connection-Id: some-uuid-api-key-proxy-3"

Issue ticket number and link

https://nango-community.slack.com/archives/C04ABR352H0/p1708714582125279

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:

@kishenpateldotwork kishenpateldotwork marked this pull request as ready for review May 9, 2024 23:34
@kishenpateldotwork kishenpateldotwork changed the title "Proxy only" providers feat: "Proxy only" providers May 10, 2024
@bastienbeurier
Copy link
Member

Thank you for the thoughtful contribution @kishenpateldotwork.

Unfortunately, we are not ready to merge it. The main reason is that it's a big departure from having each integration tied to a specific API.

I agree that going this route might make sense at some point, but it has some implications that we are not ready to tackle at this point.

Also, since the proxy feature is free, it moves closer to making Nango a free proxy for making HTTP requests, which would not be sustainable.

I'm sorry that we can't merge this high-quality PR. In the future, please reach out on the community with your intentions, and we can let you know if it aligns with the roadmap.

Let me know if you have questions!

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.

None yet

2 participants