-
Notifications
You must be signed in to change notification settings - Fork 5
aadarsh-st/SK-2521-Enhance content-type handling and add validation t… #273
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
base: himanshu/SK-2519-update-linting-rules-and-fix-hardcoded-values-in-java-v2-sdk
Are you sure you want to change the base?
Conversation
…ests for request bodies
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
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.
Pull request overview
This PR enhances content-type handling in the Skyflow SDK by supporting multiple content types (XML, plain text, HTML, form-encoded) beyond JSON, adds URL encoding for path/query parameters, and updates error messaging for bearer tokens.
Changes:
- Added URL encoding support in
Utils.javaandHttpUtility.javafor path parameters, query parameters, and form-encoded data - Updated bearer token error message to indicate "invalid or expired" instead of just "expired"
- Modified
ConnectionController.javato handle both JSON and non-JSON request/response content types using a__raw_body__wrapper - Enhanced validation in
Validations.javato support String request bodies and check for empty/whitespace-only strings - Added comprehensive test coverage for new content-type handling across XML, HTML, plain text, and form-encoded formats
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ConnectionControllerTests.java | Added tests for string request bodies with various content types (XML, HTML, plain text) |
| InvokeConnectionTests.java | Added validation tests for string bodies, empty/whitespace strings, and special characters in form-encoded data |
| HttpUtilityTests.java | Added tests for raw body handling, null request IDs, and URL encoding of special characters |
| ConnectionController.java | Modified to detect content type and handle both JSON and non-JSON payloads with raw body wrapping |
| Validations.java | Enhanced to validate String request bodies and detect empty/whitespace-only strings |
| Utils.java | Added URL encoding for path and query parameters with fallback handling |
| HttpUtility.java | Added raw body detection, conditional content-type setting, and URL encoding for form data |
| InfoLogs.java | Updated bearer token expiry message to include "invalid or expired" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/skyflow/vault/controller/ConnectionController.java
Outdated
Show resolved
Hide resolved
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
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.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/main/java/com/skyflow/vault/controller/ConnectionController.java:1
- The error message 'Server returned error' is generic and uninformative. Consider including the HTTP status code or more context about what went wrong, such as 'Server returned error with status code {httpCode}'.
package com.skyflow.vault.controller;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/skyflow/vault/controller/ConnectionController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/skyflow/vault/controller/ConnectionController.java
Outdated
Show resolved
Hide resolved
…and update request ID format in HttpUtility
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
…-values-in-java-v2-sdk' of https://github.com/skyflowapi/skyflow-java into aadarsh-st/SK-2521-fixed-bug-bash-issue
Fixed below issues: