Skip to content

Conversation

@aadarsh-st
Copy link
Collaborator

Fixed below issues:

  1. Add URL encoding in Utils and HttpUtility.
  2. Update bearer token error message to indicate invalid or expired tokens.
  3. Handle different request and response content types correctly and return request ID on errors.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

@aadarsh-st aadarsh-st requested a review from Copilot February 2, 2026 09:45
Copy link

Copilot AI left a 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.java and HttpUtility.java for path parameters, query parameters, and form-encoded data
  • Updated bearer token error message to indicate "invalid or expired" instead of just "expired"
  • Modified ConnectionController.java to handle both JSON and non-JSON request/response content types using a __raw_body__ wrapper
  • Enhanced validation in Validations.java to 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.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@aadarsh-st aadarsh-st requested a review from Copilot February 2, 2026 10:17
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Copy link

Copilot AI left a 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.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

@aadarsh-st aadarsh-st changed the base branch from main to himanshu/SK-2519-update-linting-rules-and-fix-hardcoded-values-in-java-v2-sdk February 3, 2026 07:46
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.

2 participants