Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Adding more auth conversion templates #167

Merged
merged 9 commits into from
Oct 31, 2017

Conversation

BrunoBernardino
Copy link
Contributor

@BrunoBernardino BrunoBernardino commented Oct 26, 2017

This basically adds more auth conversion templates, and a scripting.js file.

Relevant Trello Card.

What this changes

  • Improve auth conversion template for Basic Auth
  • Improve test for Basic Auth conversion
  • Improve auth conversion template for OAuth 2
  • Improve test for OAuth 2 conversion
  • Add auth conversion template for OAuth 2 w/ refresh
  • Add test for OAuth 2 w/ refresh conversion
  • Add auth conversion template for API Key (Header)
  • Add test for API Key (Header) conversion
  • Add auth conversion template for API Key (Query)
  • Add test for API Key (Query) conversion
  • Add auth conversion template for Session Auth
  • Add test for Session Auth conversion
  • Add auth conversion template for Unknown Auth
  • Generate basic scripting.js
  • Improve package.json generation

Log


Adding more auth conversion templates (fe1f44a)

This adds auth conversion templates for api keys (header + query string), session, and unknown auths.

It also improves Basic and OAuth conversion templates.

It also improves and adds tests for conversion.


Marking clearer to-dos (dbb7521)


Adding more auth conversions and tests (0d5f86b)

Specifically for OAuth2, OAuth2 w/ Refresh, Session Auth, and API Key (Header and Query).

Also tweaking more tests.


Adding scripting generation and package.json improvements. (139f339)


Switching version. (b135bb5)


Skipping test that's killing Travis (df03a42)


Fixing redundant comma for convert on index (ce50077)


Renaming from interpreter to legacy-scripting-runner (1cf7e7b)

Bruno Bernardino added 2 commits October 26, 2017 16:36
This adds auth conversion templates for api keys (header + query string), session, and unknown auths.

It also improves Basic and OAuth conversion templates.

It also improves and adds tests for conversion.
Bruno Bernardino added 2 commits October 27, 2017 14:16
Specifically for OAuth2, OAuth2 w/ Refresh, Session Auth, and API Key (Header and Query).

Also tweaking more tests.
@BrunoBernardino BrunoBernardino requested review from eliangcs and removed request for bcooksey October 27, 2017 14:08
@BrunoBernardino
Copy link
Contributor Author

BrunoBernardino commented Oct 27, 2017

@bcooksey / @bryanhelmig Not a requirement, but feel free to give me your review on this PR!

@eliangcs let me know if you've got any questions on this. The numbers look scary but that's mostly a few json files with app definitions 😊 .

@BrunoBernardino BrunoBernardino changed the title WIP: Adding more auth conversion templates Adding more auth conversion templates Oct 27, 2017
Copy link
Member

@eliangcs eliangcs left a comment

Choose a reason for hiding this comment

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

Awesome work! Covers a lot of things that were ignored. I pulled and tested with a couple of WB apps, and didn't find any major problems. We could have a more complete test before we merge it, but I don't think that's necessary as zapier convert is quite minimal, to begin with, so I think we can be pretty receptive to any improvements. I just have some questions on the package.json changes and a bug on the redundant comma generated to index.js.

"watch": "rm -rf lib && node_modules/babel-cli/bin/babel.js --watch src -d lib",
"lint": "node_modules/.bin/eslint zapier.js src test",
"build": "rm -rf lib && node_modules/babel-cli/bin/babel.js src -d lib --copy-files",
"watch": "rm -rf lib && node_modules/babel-cli/bin/babel.js --watch src -d lib --copy-files",
Copy link
Member

Choose a reason for hiding this comment

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

Just want to clarify. What does --copy-files option do? I compared the results with or without --copy-files. They look the same to me.

Copy link
Contributor Author

@BrunoBernardino BrunoBernardino Oct 31, 2017

Choose a reason for hiding this comment

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

It copies the definitions/*.json files inside src/tests/utils, otherwise only the .js files are passed along, at least for me.

"lint": "node_modules/.bin/eslint zapier.js src test",
"build": "rm -rf lib && node_modules/babel-cli/bin/babel.js src -d lib --copy-files",
"watch": "rm -rf lib && node_modules/babel-cli/bin/babel.js --watch src -d lib --copy-files",
"lint": "node_modules/.bin/eslint zapier.js src",
Copy link
Member

Choose a reason for hiding this comment

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

Any reasons why we don't want to lint test code?

Copy link
Contributor Author

@BrunoBernardino BrunoBernardino Oct 31, 2017

Choose a reason for hiding this comment

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

We're still linting the test code, since it's inside src/tests/*, this wasn't doing anything as there's no /test directory.


templateContext.REQUIRES = importLines.join('\n');
lines.push(`[${varName}.key]: ${varName},`);
Copy link
Member

Choose a reason for hiding this comment

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

I think this adds a redundant comma at the end of each line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! Nice catch!

@BrunoBernardino BrunoBernardino merged commit 9b20633 into master Oct 31, 2017
@BrunoBernardino BrunoBernardino deleted the feature-convert-more-auths branch October 31, 2017 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants