Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

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

please provide a proper commit message, in particular also providing details in which context we get the prefixed URLs instead of just the host name

Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,26 @@ static DataCloudConnection oauthBasedConnection(String url, Properties propertie
val tokenProcessor = getDataCloudTokenProcessor(properties);
val authInterceptor = TokenProcessorSupplier.of(tokenProcessor);

val host = tokenProcessor.getDataCloudToken().getTenantUrl();
val tenantUrl = tokenProcessor.getDataCloudToken().getTenantUrl();
log.info("Creating gRPC channel for tenant URL: {}", tenantUrl);
Comment on lines +149 to +150
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect indentation. Please run the code formatter

Copy link
Author

Choose a reason for hiding this comment

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

WAHH! Github web edit!!! Now I need to set up my personal account in my git workflow after all


// Extract hostname from tenant URL, handling both URLs with and without schemes
String host;
if (tenantUrl.contains("://")) {
// URL has a scheme, parse it normally
val tenantUri = java.net.URI.create(tenantUrl);
host = tenantUri.getHost();
} else {
// URL is just a hostname, use it directly
host = tenantUrl;
}
log.info("Extracted hostname from tenant URL: {}", host);

if (host == null || host.trim().isEmpty()) {
throw new DataCloudJDBCException(
String.format("Invalid tenant URL '%s': could not extract hostname", tenantUrl));
}

final ManagedChannelBuilder<?> builder = ManagedChannelBuilder.forAddress(
host, DataCloudConnection.DEFAULT_PORT)
.intercept(TracingHeadersInterceptor.of());
Expand Down