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

Convert Request, Response, CodeResponseType, TokenResponseType to ES6 classes #225

Conversation

menewman
Copy link
Contributor

Summary

Chipping away at #212 by converting four more classes:

  • Request
  • Response
  • CodeResponseType
  • TokenResponseType

(Do note that TokenResponseType's constructor simply throws a not implemented error, though. So that conversion was easy. 😉)

Linked issue(s)

A few checkboxes of #212 (but not the whole thing).

Involved parts of the project

Specifically the classes noted above, which affect pretty much everything (since Request/Response are core parts of the interface). But, there are no functional changes.

Added tests?

I did not update the tests, but these files are already covered under the existing tests, which should continue to pass after this refactoring.

OAuth2 standard

N/A

Reproduction

N/A

Copy link
Member

@jorenvandeweyer jorenvandeweyer left a comment

Choose a reason for hiding this comment

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

@menewman I got some small comments, could you please update these?

@jankapunkt PR seems fine. Could you also review this so this one can be merged?

lib/request.js Show resolved Hide resolved
lib/request.js Outdated Show resolved Hide resolved
Copy link
Member

@jankapunkt jankapunkt left a comment

Choose a reason for hiding this comment

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

There are some minor changes but I think at keast to has own property checks should be considered, even if the attack surface is rather superficial and imaginary

lib/request.js Show resolved Hide resolved
lib/request.js Outdated Show resolved Hide resolved
lib/response.js Show resolved Hide resolved
lib/request.js Show resolved Hide resolved
@jankapunkt jankapunkt merged commit 45eef09 into node-oauth:development Aug 26, 2023
6 checks passed
@jankapunkt jankapunkt mentioned this pull request Aug 29, 2023
1 task
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.

3 participants