-
Notifications
You must be signed in to change notification settings - Fork 16
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
Test/add oauth2 cases #88
Commits on May 21, 2024
-
Refactor ESLint configuration and improve OAuth2 node functionality
- Update ESLint configuration to include Prettier plugin and adjust rules for code style consistency. - Add browser and mocha environments to ESLint configuration. - Remove unused crypto and circular reference replacer from oauth2.js. - Simplify axios POST request logic and add proxy support in OAuth2 node. - Include response headers in the message payload for better context. - Adjust tests to reflect changes in oauth2.js and reduce timeout for faster test execution. - Add new test cases for handling different grant types, network failures, custom headers, multiple scopes, and proxy settings.
Configuration menu - View commit details
-
Copy full SHA for f1f29e5 - Browse repository at this point
Copy the full SHA f1f29e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for dba9040 - Browse repository at this point
Copy the full SHA dba9040View commit details
Commits on May 23, 2024
-
Update dependencies and refactor OAuth2 node
- Updated the `oauth2.js` node to handle additional edge cases and improve error handling. - Refactored `logger.js` for better readability and consistency. - Added new test cases in `oauth2_spec.js` to cover more scenarios and ensure robustness. - Removed unused dependencies and cleaned up `package.json` and `yarn.lock` files. - Adjusted the `package.json` scripts to include a new `coverage` script for test coverage reporting.
Configuration menu - View commit details
-
Copy full SHA for ab15569 - Browse repository at this point
Copy the full SHA ab15569View commit details -
Refactor oauth2.json and oauth2.html for clarity and add debug mode
This commit introduces several changes to improve the clarity and functionality of the oauth2 configuration. In the oauth2.json locale file, the tips for debug mode, client credentials, and rejectUnauthorized have been added, and the labels have been updated to be more concise. The oauth2.html file has been updated to include a new debug mode checkbox with corresponding help information, a the labels for client credentials and rejectUnauthorized have been adjusted to match the updated locale file. Additionally, the logger.js file has been removed as it appears to be no longer needed, and the corresponding references to the logger have been added to the oauth2.js file to incorporate logging functionality directly within the OAuth2 node implementation. The debug mode can now be toggled via the node configuration, and the logger is initialized with the debug setting from the config. Lastly, the oauth2.js file has been refactored to include more descriptive logging messages that will aid in debugging and understanding the flow of the OAuth2 node's operations.
Configuration menu - View commit details
-
Copy full SHA for a217097 - Browse repository at this point
Copy the full SHA a217097View commit details -
Add refresh token support and refactor oauth2 node options
This commit introduces several changes to the oauth2 node configuration and handling of OAuth2 flows. The primary addition is the support for the refresh token grant type, which allows the node to obtai new access tokens using a refresh token. Key changes include: - Added a new `refresh_token` field in the oauth2.html file to allow users to input their refresh token. - Updated oauth2.js to handle the new refresh token flow, including generating the appropriate form data and handling the client credentials. - Refactored the `generateOptions` function in oauth2.js to improve readability and maintainability. The function now uses a mapping of grant type to specific handling functions. - Updated the logger.js to allow for an undefined `count` parameter, which means logging will not be limited unless specified. - Enhanced the localization file (oauth2.json) to include the new refresh token field. These changes aim to enhance the node-red-contrib-oauth2 package by providing a more comprehensive and user-friendly OAuth2 implementation.
Configuration menu - View commit details
-
Copy full SHA for c6f96af - Browse repository at this point
Copy the full SHA c6f96afView commit details -
Update dependencies and adjust code for compatibility
This commit updates several dependencies to their latest versions, including axios, eslint, and prettier. It also includes adjustments to the codebase to ensure compatibility with the updated dependencies. Notably, the eslint-plugin-n and eslint-plugin-jsdoc have been updated, which required changes to the eslint configuration. Additionally, the Logger.prototype.objectDump method in logger.j has been modified to handle invalid objects more gracefully.
Configuration menu - View commit details
-
Copy full SHA for fe2bcd7 - Browse repository at this point
Copy the full SHA fe2bcd7View commit details -
Remove unused 'should' require in oauth2-generate-options tests
The 'should' library was included in the oauth2-generate-options_spec.js file but was not being used. This commit removes the unnecessary require statement to clean up the code.
Configuration menu - View commit details
-
Copy full SHA for 85d90aa - Browse repository at this point
Copy the full SHA 85d90aaView commit details -
Improve error handling and remove unused URL import in oauth2.js
- Removed the unused URL import from oauth2.js. - Added URLSearchParams import for handling form data. - Wrapped the credentials retrieval in a try-catch block to handle potential errors. - Changed the response status code to 404 when credentials are not found. - Changed the response status code to 500 for server errors. - Updated the success HTML response to use proper indentation and formatting. - Changed the response status code to 400 when credentials are missing in the token exchange endpoint.
Configuration menu - View commit details
-
Copy full SHA for 9621caf - Browse repository at this point
Copy the full SHA 9621cafView commit details