This is an automated email from the ASF dual-hosted git repository.
bamaer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 1c0e063efa Load the credentials of the default gs:// provider on first
use, fixes #9144 (#9145)
1c0e063efa is described below
commit 1c0e063efa35b04805444b80351c6a6a209736c6
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Thu Oct 29 20:54:08 2026 +0100
Load the credentials of the default gs:// provider on first use, fixes
#9144 (#9145)
---
.../org/apache/hop/vfs/gs/GoogleStorageFileProvider.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git
a/plugins/tech/google/src/main/java/org/apache/hop/vfs/gs/GoogleStorageFileProvider.java
b/plugins/tech/google/src/main/java/org/apache/hop/vfs/gs/GoogleStorageFileProvider.java
index 516b889c48..80ddbe7600 100644
---
a/plugins/tech/google/src/main/java/org/apache/hop/vfs/gs/GoogleStorageFileProvider.java
+++
b/plugins/tech/google/src/main/java/org/apache/hop/vfs/gs/GoogleStorageFileProvider.java
@@ -46,9 +46,14 @@ public class GoogleStorageFileProvider extends
AbstractOriginatingFileProvider {
/** Why {@link #tryApplicationDefaultCredentials()} last came back
empty-handed. */
private String applicationDefaultProblem;
+ /** Whether the credentials of the default provider still have to be loaded.
*/
+ private boolean defaultCredentialsPending;
+
public GoogleStorageFileProvider() {
super();
- setServiceAccountCredentials(null, null);
+ // Every Hop start creates the default provider, also where nobody uses
Google Cloud Storage:
+ // its credentials are loaded when the first file system is asked for
+ defaultCredentialsPending = true;
}
public GoogleStorageFileProvider(
@@ -83,9 +88,17 @@ public class GoogleStorageFileProvider extends
AbstractOriginatingFileProvider {
@Override
protected FileSystem doCreateFileSystem(FileName rootName, FileSystemOptions
fileSystemOptions)
throws FileSystemException {
+ loadPendingCredentials();
return new GoogleStorageFileSystem(rootName, null, newFileSystemOptions);
}
+ private synchronized void loadPendingCredentials() {
+ if (defaultCredentialsPending) {
+ defaultCredentialsPending = false;
+ setServiceAccountCredentials(null, null);
+ }
+ }
+
/**
* Look file systems up by this provider's own options, the ones they are
created with. Commons
* VFS caches a file system under its own options but looks it up under the
caller's; those never
@@ -95,6 +108,7 @@ public class GoogleStorageFileProvider extends
AbstractOriginatingFileProvider {
@Override
protected synchronized FileSystem getFileSystem(
FileName rootFileName, FileSystemOptions fileSystemOptions) throws
FileSystemException {
+ loadPendingCredentials();
return super.getFileSystem(rootFileName, newFileSystemOptions);
}