Commit Graph

2885 Commits

Author SHA1 Message Date
jixinchi 6670c556d7 add unit test for Filesystem BlobKey and ContainerName validator 2024-05-06 22:37:53 +09:00
jixinchi 03aeccffdf fix grammar error in sentence from contains to contain 2024-05-06 22:37:53 +09:00
jixinchi b0819e0ef5 more validation for containerName and blobKey to avoid access escape 2024-05-06 22:37:53 +09:00
Andrew Gaul d733401ce7 Set version to 2.6.1-SNAPSHOT 2024-04-24 20:29:39 +09:00
Andrew Gaul da1bc06f9e JCLOUDS-1635: Add COOL and COLD to Tier
The former replaces INFREQUENT.  References gaul/s3proxy#625.
2024-04-20 17:31:52 +09:00
Maksim_Hadalau 0688553087 JCLOUDS-1631: fix AWSRequestAuthorizeSignatureV4 when prefix contains special chars 2024-04-14 17:37:51 +09:00
Andrew Gaul 107741f786 JCLOUDS-1629: Upgrade to Guice 7.0.0
This also changes from javax to jakarta annotations.
2024-02-26 15:27:29 +09:00
Andrew Gaul b5e4e1d0fd JCLOUDS-1627: Upgrade to Jakarta packages
This resolves an issue with newer Guice versions.
2024-02-23 18:04:48 +09:00
Mickael LANOE 6455fd8518 Parse out of order ListBucket response elements
Currently, jclouds assumes that the <ID> must occur before the
<DisplayName> tag. If the XML body does not adhere to this order, the
parser throws a NullPointerException.

Scaleway is a cloud provider that does not adhere to this order and
returns the <DisplayName> tag before the <ID> tag. The patch changes the
parser to not depend on the order of the tags.

See commit 04feb8f848 for a similar fix
2023-12-10 00:21:47 +09:00
Valentin 47e3022519
FilesystemStorageStrategyImpl.getBlob() for a folder return blob as type Blob (#187)
Co-authored-by: Valentin Popov <popov@mailarchiva.ru>
2023-11-11 16:37:00 -05:00
jixinchi eb1181daf5
check file exists in getContainerAccess (#185) 2023-10-12 18:18:30 +02:00
Edo Demirbilek 611b4c4a11
Adding access key auth support for openstack V3 (#183)
* Adding access key auth support for openstack V3 from an earlier commit + adding test

* added new line at the end to fix checkstyle warning
2023-09-04 23:49:45 +02:00
Andrew Gaul db69360b5f Revert "Revert "Upgrade to snakeyaml 2.0""
This reverts commit cf4a926afe.  The
current CI failure is unrelated to this dependency.
2023-06-14 20:16:28 -07:00
Andrew Gaul cf4a926afe Revert "Upgrade to snakeyaml 2.0"
This reverts commit f82e94c337.  This
break CI due to an unexpected Java version mismatch.
2023-05-10 21:30:27 +09:00
Andrew Gaul f82e94c337 Upgrade to snakeyaml 2.0
This has some API changes.  Closes #169.
2023-04-16 16:43:36 +09:00
Andrew Gaul 12de6ef74d Atomically replace objects in filesystem putBlob
Fixes gaul/s3proxy#490.  This fixes a regression from
41ce90ec36.  Continue to support
Windows logic although it is unclear if this is necessary.
2023-01-24 14:44:53 +09:00
Andrew Gaul 62632c9db6 JCLOUDS-1371: Optimize filesystem delimiter
populateBlobKeysInContainer will no longer recurse when the delimiter
matches "/".  This makes listing deep hierarchies with a delimiter
faster.  Note that the general LocalBlobStore handling is still
required for the general cases.  This requires removing a bogus test
case.  References gaul/s3proxy#473.
2023-01-24 14:44:34 +09:00
Andrew Gaul e478dd5452 JCLOUDS-1371: JCLOUDS-1488: optimize fs prefix
This reduces the number of stat calls required when prefix is deep in the
filesystem hierarchy.  Further optimizations to delimiter are possible.
References gaul/s3proxy#473.
2023-01-22 18:31:09 +09:00
dependabot[bot] b754e177fe Bump snakeyaml from 1.31 to 1.32 in /apis/byon
---
updated-dependencies:
- dependency-name: org.yaml:snakeyaml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-15 12:40:10 +09:00
Jonathan Leitschuh b282b5cbfe vuln-fix: Temporary File Information Disclosure
This fixes temporary file information disclosure vulnerability due to the use
of the vulnerable `File.createTempFile()` method. The vulnerability is fixed by
using the `Files.createTempFile()` method which sets the correct posix permissions.

Weakness: CWE-377: Insecure Temporary File
Severity: Medium
CVSSS: 5.5
Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.SecureTempFileCreation)

Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>

Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/18


Co-authored-by: Moderne <team@moderne.io>
2022-11-20 21:31:45 +09:00
dependabot[bot] b098cceaf9
Bump snakeyaml from 1.26 to 1.31 in /apis/byon (#154)
Bumps [snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 1.26 to 1.31.
- [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-1.31..snakeyaml-1.26)

---
updated-dependencies:
- dependency-name: org.yaml:snakeyaml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-15 13:16:09 +02:00
Andrew Gaul 5111923566 Specify missing DataProviders
Uncovered by newer versions of testng.
2022-08-03 21:24:12 +09:00
Andrew Gaul 2b217fb2bb Annotate public non-test methods
Newer versions of TestNG try to run these.
2022-08-03 21:24:12 +09:00
Andrew Gaul 65e16c97f5 Annotate test methods as singleThreaded
Newer versions of testng deprecate sequential.
2022-08-03 21:24:12 +09:00
Andrew Gaul 16926b0bb7 Upgrade to assertj 3.23.1
Enabled by requiring Java 8.  Also fix some minor API breakage.
2022-07-31 17:19:05 +09:00
Andrew Gaul 36f351cd18 Next development version 2.6.0-SNAPSHOT 2022-03-26 18:30:06 +09:00
ramahin 5fad7fa895 JCLOUDS-1599 - Add support for GLACIER_IR storage class 2022-03-09 09:06:13 +09:00
Andrew Gaul 468b126dd8 JCLOUDS-1594: Allow overriding S3 signer
Previously s3 always used v2 and aws-s3 always used v4.  Now s3
defaults to v2 and can override to v4.  Note that this does not change
BlobRequestSigner.
2022-01-12 22:24:45 +09:00
SATYANAN-ANAND c95ddff020
JCLOUDS-1591: Fix NPE in ClientCredentialsClaims 2021-12-27 16:26:28 +09:00
Andrew Gaul 3bbb0b446a JCLOUDS-1590: Promote glacier to core 2021-12-18 00:11:40 +09:00
Andrew Gaul afa92c7478 Merge remote-tracking branch 'jclouds-labs-aws-local/promote-glacier-moved' into promoted-glacier 2021-12-17 13:55:10 +09:00
Andrew Gaul 66ef18c6ae JCLOUDS-1589: Upgrade to log4j 2.16.0
This addresses a critical CVE:

https://logging.apache.org/log4j/2.x/security.html
2021-12-17 13:33:38 +09:00
Andrew Gaul dbd8eb1dab JCLOUDS-1589: Upgrade to log4j 2.16.0
This addresses a critical CVE:

https://logging.apache.org/log4j/2.x/security.html
2021-12-16 23:56:09 +09:00
Andrew Gaul b0592c5afa Next development version 2.5.0-SNAPSHOT 2021-09-19 08:59:59 +09:00
Andrew Gaul e8e78689e6 Next development version 2.4.0-SNAPSHOT 2021-09-19 08:58:25 +09:00
Andrew Gaul 720e92c54a Prefer case-insenstive header comparisons
Follows up to #116.
2021-07-29 20:01:27 +09:00
didixith 779bc2db19
JCLOUDS-1516: specify host name when creating bucket 2021-07-10 11:35:16 +09:00
i831992 2791f47046 JCLOUDS-1580 - Add support for lowercase metadata headers
The issue happens if a cloud provider returns lowercase metadata headers, for example: "x-object-meta-apiversion" instead of "X-Object-Meta-ApiVersion"

In that case, BlobStore.blobMetadata(CONTAINER, PATH).getUserMetadata()
incorrectly returns an empty map.

This happens because the code is looking for the exact String "-Meta-" (case-sensitive).

This checkin allows to handle metadata headers of any case, and also adds a unit test for that situation.
2021-06-23 09:59:26 +09:00
Andrew Gaul 09dfab4277 Next development version 2.4.0-SNAPSHOT 2021-04-14 23:14:10 +09:00
Andrew Gaul 7ad7890ad0 Next development version 2.4.0-SNAPSHOT 2021-04-14 23:07:54 +09:00
Timur Alperovich 04feb8f848 Parse out of order ListBuckets response elements
Currently, jclouds assumes that the ListBuckets response follows a
specific order: the <Owner> tag, followed by the <Buckets> tag. Within
the <Owner> tag, jclouds further assumes that the <ID> must occur before
the <DisplayName> tag. If the XML body does not adhere to this order,
the parser throws a NullPointerException.

DigitalOcean spaces does not adhere to this order and returns the
<DisplayName> tag before the <ID> tag. The patch changes the parser to
not depend on the order of the tags.
2021-04-04 20:06:26 +09:00
Jean-Noël Rouvignac 0b89ee0825
S3 APIs: Remove the dependency to com.jamesmurty.utils:java-xmlbuilder (#98)
XMLBuilder is a very nice fluent API for building XML documents.
However, it is only used by a tiny portion of jclouds: the s3 api. The
use of the XMLBuilder class requires a dependency to
com.jamesmurty.utils:java-xmlbuilder jar and a transitive
dependency to the net.iharder:base64 jar (superseded by
java.util.Base64 in java 8). They are 18kb each approximately and they
not OSGi compatible. They are not huge, but they represent more API
surface and more things to change when trying to use jclouds in an OSGi
context (they need to be replaced by OSGi compatible bundles like
org.apache.servicemix.bundles.java-xmlbuilder).

This commit replaces the use of XMLBuilder by a direct use of the
javax.xml and org.w3c.dom APIs.

I hope retesting will be minimal, and most of this code is covered by
unit tests.
2021-03-01 15:01:10 +01:00
Jean-Noël Rouvignac f6f3f99024
Avoid using the guice injector int ests which triggers an NPE 2021-03-01 11:49:24 +01:00
gurkerl83 50462ca940 Upgrade OKHttp dependency
The JClouds project module upgrades the okhttp server library and related dependencies such as mockwebserver from 2.2.0 to 3.14.9. The vendor switched the groupId declaration from com.squareup.okhttp to com.squareup.okhttp3.

Adjust imports and api calls for newer okhttp vers
2021-02-12 18:57:56 +09:00
gurkerl83 3d753a48d2 Clear rule for bouncycastle exclusion
- Mock-Webserver v2.2.0 - Vendor, defined dependency bcprov-jdk15on > Previously, the dependency got excluded; otherwise, it conflicted with the existing bouncy castle version used in JClouds.
- Mock-Webserver v3.14.9 - The vendor does not define a bouncy castle dependency anymore; instead, it moved to the okhttp-tls module.

- Introduce the okhttp-tls module for tests in the core module. The following APIs (Docker, Elastic-Stack) and providers Softlayer extend their respective MockTest from BaseMockWebServerTest. The mock base test is located in the test jar of JClouds core module.
- Due to conflicting bouncy castle classes in the classpath, those which get loaded from the okhttp-tls module, and those defined in JClouds bouncy castle module, the bouncy castle dependency of okhttp-tls has to get skipped for the two APIs and providers mentioned.

Side note:
The JClouds GAE driver module also requires the new okhttp-tls dependency because of the following chain of inheritance.
Different from the situation above, the bouncy castle classes of the okhttp-tls got not excluded.
GaeHttpCommandExecutorServiceIntegrationTest -> BaseHttpCommandExecutorServiceIntegrationTest -> BaseMockWebServerTest

The reason for this is unknown to me.
2021-02-12 18:57:46 +09:00
korlov42 44ff69d144 JCLOUDS-1551: Update version of OkHttp 3.14.9 2021-02-12 18:57:46 +09:00
Andrew Gaul 56ad552344 Force application/x-directory for directories
Paths created by Files.createParentDirs lack extended attributes and
thus Content-Type for directories.
2021-02-03 21:36:28 +09:00
Andrew Gaul dabc0ab6a9 Allow setting BlobAccess in LocalBlobStore.putBlob
This addresses a race condition with filesystem users.
2021-02-01 19:37:47 +09:00
gurkerl83 47f51347a2 Remove Guice multibindings
Since Guice 4.2, multibindings support has moved to Guice core. Before that, you need to depend on the guice-multibindings extension. For reference https://github.com/google/guice/wiki/Multibindings
2021-01-31 22:03:59 +09:00
Jean-Noël Rouvignac 647af7e365
Simplify S3 code that uses java-xml-builder (#93)
* animal sniffer should be on java18, just like `<jdk.version>`

* Only use XMLBuilder's elem() and text() methods to have similar looking code

* Remove unnecessary call to XMLBuilder's up() because the returned value is never used

* Simplify code

* Deduplicate code

* Make the code more explicit by returning the rootBuilder
2021-01-21 21:54:44 +09:00