-
Notifications
You must be signed in to change notification settings - Fork 1
Add OAuth2 parameters #75
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
Conversation
…ters - Added new OAuth2 configuration parameters to `qbo.ts`, including `clientId`, `clientSecret`, `companyId`, `refreshToken`, and `tokenEndpoint`. - Updated the Zod schema validation to require the new parameters, ensuring proper validation of environment variables. These changes improve the application's integration with the QBO API by providing necessary authentication details and enhancing configuration management.
…ters - Added QuickBooks Online (QBO) configuration parameters to the `.env.example` file, including `QBO_API_URL`, `QBO_CLIENT_ID`, `QBO_CLIENT_SECRET`, `QBO_COMPANY_ID`, `QBO_REFRESH_TOKEN`, and `QBO_TOKEN_ENDPOINT`. - This update enhances the application's environment setup for QBO integration by providing necessary configuration details for OAuth2 authentication. These changes improve the clarity and usability of the environment configuration for developers working with the QBO API.
📝 Walkthrough""" WalkthroughThe changes introduce OAuth2-related environment variables for QuickBooks Online (QBO) integration in the Changes
Sequence Diagram(s)sequenceDiagram
participant EnvFile as .env.example / .env.test
participant Config as qboConfig/qboSchema
participant App as Application
EnvFile->>Config: Provides OAuth2 env vars (clientId, clientSecret, etc.)
Config->>App: Supplies validated QBO configuration (OAuth2 or bearer token)
App->>QBO API: Authenticates using OAuth2 credentials or bearer token
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🔍 Vulnerabilities of
|
| digest | sha256:da30eca7154c7c4cb2616e31f7411021ea9146d5b15c68adf2a57df4c52b164c |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 218 MB |
| packages | 358 |
📦 Base Image alpine:3
| also known as |
|
| digest | sha256:1c4eef651f65e2f7daee7ee785882ac164b02b78fb74503052a26dc061c90474 |
| vulnerabilities |
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.env.example (1)
39-46: Verify the QBO_API_URL endpoint and consider renaming for clarity.The
QBO_API_URLis set to the userinfo endpoint (https://sandbox-accounts.platform.intuit.com/v1/openid_connect/userinfo), which is specific to user information retrieval rather than a general API base URL. This might be confusing for developers.Consider either:
- Renaming to
QBO_USERINFO_URLfor clarity- Using the QBO base API URL (e.g.,
https://sandbox-quickbooks.api.intuit.com) if this is intended as a base URL- Adding a comment explaining the specific purpose of this endpoint
-# QuickBooks Online (QBO) Configuration -QBO_API_URL=https://sandbox-accounts.platform.intuit.com/v1/openid_connect/userinfo +# QuickBooks Online (QBO) Configuration +# OAuth2 userinfo endpoint for QBO integration +QBO_USERINFO_URL=https://sandbox-accounts.platform.intuit.com/v1/openid_connect/userinfo
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.env.example(1 hunks)workers/main/src/configs/qbo.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.env*
📄 CodeRabbit Inference Engine (.cursor/rules/service-configuration.mdc)
Create .env file from .env.example for environment configuration
Files:
.env.example
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: After the bullet list in the pull request body, add a brief explanation of why the PR is needed
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: Pull request title must be a one sentence summary with a maximum of 120 characters
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: Analyze the changes to understand the purpose and impact before submitting a pull request
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/service-configuration.mdc:0-0
Timestamp: 2025-06-24T12:29:29.869Z
Learning: Environment configuration should be managed via a .env file, typically created from a provided .env.example template, to ensure consistent and secure configuration across environments.
Learnt from: anatolyshipitz
PR: speedandfunction/automatization#34
File: workers/main/src/workflows/financial/FinancialReportFormatter.ts:3-7
Timestamp: 2025-05-30T17:57:21.010Z
Learning: User anatolyshipitz prefers to keep code implementations simple during early development stages rather than adding comprehensive error handling and validation. They consider extensive type annotations and error handling "redundant" when focusing on core functionality and testing.
.env.example (1)
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/service-configuration.mdc:0-0
Timestamp: 2025-06-24T12:29:29.869Z
Learning: Environment configuration should be managed via a .env file, typically created from a provided .env.example template, to ensure consistent and secure configuration across environments.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
- GitHub Check: Service Availability Check
🔇 Additional comments (1)
workers/main/src/configs/qbo.ts (1)
14-23: Schema validation correctly supports both authentication methods.The validation schema properly handles the transition from bearer token to OAuth2 authentication by making the bearer token optional while requiring OAuth2 credentials. The URL validation for the token endpoint is appropriate.
The schema changes align well with the OAuth2 integration requirements and maintain backward compatibility with existing bearer token setups.
- Rearranged the QBO configuration parameters in `qbo.ts` for improved readability and consistency. - Updated the Zod schema to enforce required fields for `QBO_API_URL`, `QBO_CLIENT_ID`, `QBO_CLIENT_SECRET`, and `QBO_COMPANY_ID`, while making `QBO_REFRESH_TOKEN` optional. - This refactor enhances the clarity of the configuration setup and ensures that essential parameters are validated correctly. These changes improve the overall structure and usability of the QBO integration configuration.
- Introduced additional QuickBooks Online (QBO) configuration parameters in the `.env.test` file, including `QBO_CLIENT_ID`, `QBO_CLIENT_SECRET`, `QBO_COMPANY_ID`, `QBO_REFRESH_TOKEN`, and `QBO_TOKEN_ENDPOINT`. - This update enhances the environment setup for QBO integration by providing necessary configuration details for OAuth2 authentication in the testing environment. These changes improve the clarity and usability of the environment configuration for developers working with the QBO API in testing scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
workers/main/.env.test (1)
17-22: Add a trailing newline to satisfy dotenv-linter and POSIX toolsMany editors and linters (including
dotenv-linter) expect a single LF at the end of the file.
Add one blank line after the last variable to silence the warning and avoid edge-case parsing issues.QBO_TOKEN_ENDPOINT=https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
workers/main/.env.test(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: After the bullet list in the pull request body, add a brief explanation of why the PR is needed
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: Pull request title must be a one sentence summary with a maximum of 120 characters
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/pull-request-rules.mdc:0-0
Timestamp: 2025-07-28T16:45:05.154Z
Learning: Analyze the changes to understand the purpose and impact before submitting a pull request
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/service-configuration.mdc:0-0
Timestamp: 2025-06-24T12:29:29.869Z
Learning: Environment configuration should be managed via a .env file, typically created from a provided .env.example template, to ensure consistent and secure configuration across environments.
Learnt from: anatolyshipitz
PR: speedandfunction/automatization#34
File: workers/main/src/workflows/financial/FinancialReportFormatter.ts:3-7
Timestamp: 2025-05-30T17:57:21.010Z
Learning: User anatolyshipitz prefers to keep code implementations simple during early development stages rather than adding comprehensive error handling and validation. They consider extensive type annotations and error handling "redundant" when focusing on core functionality and testing.
workers/main/.env.test (1)
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/service-configuration.mdc:0-0
Timestamp: 2025-06-24T12:29:29.869Z
Learning: Environment configuration should be managed via a .env file, typically created from a provided .env.example template, to ensure consistent and secure configuration across environments.
🪛 dotenv-linter (3.3.0)
workers/main/.env.test
[warning] 22-22: [EndingBlankLine] No blank line at the end of the file
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
- GitHub Check: Service Availability Check
🔇 Additional comments (1)
workers/main/.env.test (1)
14-22: Double-check coexistence of legacy bearer token with new OAuth2 flow
QBO_BEARER_TOKEN(lines 14–15) now coexists with the OAuth2 parameters added below.
Confirm that your updatedqbo.tsschema really treats the bearer token as optional and that tests don’t unintentionally prefer the hard-coded token over the refresh-token flow; otherwise authentication paths may diverge between local, CI and production environments.If the bearer token is no longer needed, consider removing it from
.env.testto avoid confusion.
|
killev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good



Add QuickBooks Online OAuth2 configuration parameters to support the QBO integration for weekly financial reports.