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

Consolidate oauth2 provider type #194

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

WilliamBergamin
Copy link
Contributor

Summary

This PR aims to address this comment that asks to consolidate ManifestOAuth2ProviderSchema and OAuth2ProviderDefinitionArgs

I've left a TODO comment that mentiones that some work regarding the type system could be done once more then one Provider types are present.

testing

  1. Open an app with an OAuth2 provider such as deno-simple-survey
  2. replace the "deno-slack-sdk/" value with "https://raw.githubusercontent.com/slackapi/deno-slack-sdk/consolidate-Oauth2ProviderType/src/"
  3. Run the app
  4. Everything should work as expected

Requirements

@WilliamBergamin WilliamBergamin added the semver:patch requires a patch version number bump label Aug 3, 2023
@WilliamBergamin WilliamBergamin self-assigned this Aug 3, 2023
@WilliamBergamin WilliamBergamin requested a review from a team as a code owner August 3, 2023 19:15
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #194 (e331dbc) into main (738d367) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #194   +/-   ##
=======================================
  Coverage   99.24%   99.24%           
=======================================
  Files          56       56           
  Lines        2125     2125           
  Branches      136      136           
=======================================
  Hits         2109     2109           
  Misses         15       15           
  Partials        1        1           
Files Changed Coverage Δ
src/providers/oauth2/mod.ts 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

};

/**
* TODO: The type system here could be improved one more then one provider type (CUSTOM) is available
* provider_name, authorization_url, token_url, identity_config and authorization_url_extras
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory these should be required but I fear that making these fields required might break some apps

Copy link
Contributor

Choose a reason for hiding this comment

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

How did you determine that these fields are required? Checked the backend schema or some other way?
Can you confirm that not providing these fields works? I.e. can you deploy an app and pass manifest validation if you remove these fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comments for each of those field mentioned that they we required for CUSTOM provider types, I am assuming they are true

But since those fields are currently not required I don't think we can make them required without potentially breaking apps

Copy link
Contributor

Choose a reason for hiding this comment

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

"Breaking" from a static-type-check perspective, that is true, however, if the backend requires these fields anyways, then that is much less a concern, I think, because no real app would be able to define a provider without them.

That's why I think we should test this out on a real app 😄

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

Left some questions!

};

/**
* TODO: The type system here could be improved one more then one provider type (CUSTOM) is available
* provider_name, authorization_url, token_url, identity_config and authorization_url_extras
Copy link
Contributor

Choose a reason for hiding this comment

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

How did you determine that these fields are required? Checked the backend schema or some other way?
Can you confirm that not providing these fields works? I.e. can you deploy an app and pass manifest validation if you remove these fields?

@WilliamBergamin WilliamBergamin marked this pull request as draft August 8, 2023 16:16
@WilliamBergamin
Copy link
Contributor Author

Converted this PR into draft since changes surrounding OAuth providers may be coming and we don't want to paint ourselves into a corner 🎨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch requires a patch version number bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants