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

oAuth flow: Add input fields parameter. #7280

Closed
wants to merge 3 commits into from

Conversation

avida
Copy link
Contributor

@avida avida commented Oct 22, 2021

What

Part of #6971

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions
  • Connector added to connector index like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Connector Generator

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@avida avida requested review from sherifnada, cgardens and ChristopheDuong and removed request for cgardens October 22, 2021 13:05
@github-actions github-actions bot added area/api Related to the api area/core area/documentation Improvements or additions to documentation area/protocol CDK Connector Development Kit labels Oct 22, 2021
@avida avida requested review from bazarnov and eliziario October 22, 2021 13:05
@avida avida temporarily deployed to more-secrets October 22, 2021 13:06 Inactive
@avida
Copy link
Contributor Author

avida commented Oct 22, 2021

This is backend part for oAuth input parameters, UI changes will come in separate PR later

Copy link
Contributor

@cgardens cgardens left a comment

Choose a reason for hiding this comment

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

cool!

@@ -256,6 +256,19 @@ definitions:
type: array
items:
type: string
oauthFlowInputFields:
Copy link
Contributor

Choose a reason for hiding this comment

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

can we snake case this please

Copy link
Contributor

Choose a reason for hiding this comment

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

also this pattern seems a little bit weird to me. what we really want is to just describe another object that happens to be a subset of the connector spec. would it make any sense to just define a separate json schema instead of doing the pointers. the downside is it adds complexity in mapping from one object to the next.

@sherifnada dunno if you had strong opinions on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's definitely a lot simpler to authorize that way since it also allows us to decouple oauth flow params from connector params (if in the future a user needs to input something required only for oauth and not for the connector to operate then we have no way to do it currently). But I can see that approach being complicated for the UI to implement especially if a connector supports more than just oauth.

@jamakase do you have any thoughts on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we snake case this please

Ive made it to look similar to other fields in section: oauthFlowInitParameters, oauthFlowOutputParameters. Not sure if I should rename those fields cause it would require changing a lot of code and connectors specs.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sherifnada I have already provided all my concerns in slack that I am not a fan of current implementation :) What if in the future some fields should be part of oauth flow, but they are not required to be part of connectionConfigration? The current config won't allow such changes and we would need to add patches within the current schema for such approach what is not that good I think.

@cgardens cgardens added area/platform issues related to the platform and removed area/core labels Oct 23, 2021
@sherifnada sherifnada requested a review from jrhizor October 25, 2021 06:14
@sherifnada
Copy link
Contributor

@jrhizor it seems like you an @jamakase had a different preference for how this should be structured? Right now it's a list of pointers into fields in the config, but I believe you mentioned in slack a preference for having a separate "sub-spec"? IMO from a UX standpoint it's ideal if the user only had to enter their info once, but I can also see that having multiple specs is more extensible as it allows specifying params exclusive to oauth and not the connector as a whole

@avida avida temporarily deployed to more-secrets October 25, 2021 06:30 Inactive
@avida
Copy link
Contributor Author

avida commented Oct 25, 2021

but I can also see that having multiple specs is more extensible as it allows specifying params exclusive to oauth and not the connector as a whole

If we dont like list of pointers approach (which is completely fine from my point of view) we could use custom metadata keywords for existing spec instead of using one more jsonschema .

@avida avida temporarily deployed to more-secrets October 25, 2021 10:02 Inactive
@jamakase
Copy link
Contributor

@jrhizor it seems like you an @jamakase had a different preference for how this should be structured? Right now it's a list of pointers into fields in the config, but I believe you mentioned in slack a preference for having a separate "sub-spec"? IMO from a UX standpoint it's ideal if the user only had to enter their info once, but I can also see that having multiple specs is more extensible as it allows specifying params exclusive to oauth and not the connector as a whole

My opinion is that our current UI doesn't match our needs actually. We don't want to provide duplicate fields for sure, but the problem is that we may also have additional fields + I think it could make sense to split form into something that is auth specific and something that is connection itself specific ( date of start, some other additional props ). Just like IntellIj does for db connection.

I think, we should try to plan schema correctly, so it support all our future needs and if necessary I could help @avida with any required changes into his PR that will be required to no display duplicate fields. If we have 2 specs - I do not thnk it will be a big deal to merge them properly.

@avida
Copy link
Contributor Author

avida commented Oct 27, 2021

@cgardens @jamakase @sherifnada @jrhizor Guys, what is the status of this discussion? Do you have any updates? This issue blocks a lot of oAuth implementations.

@sherifnada
Copy link
Contributor

@avida @ChristopheDuong is working on resolving this asap, let's focus on connectors not blocked by this in the meantime

@avida
Copy link
Contributor Author

avida commented Nov 12, 2021

Chris is working on it

@avida avida closed this Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/protocol area/server CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth Flow: new authSpecifications supporting field references from connector config as dependency
5 participants