files.com 1.1.789 → 1.1.791
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +53 -11
- data/_VERSION +1 -1
- data/spec/models/folder_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64bba2627e8f620bf8ead9f5f6aca7bada4416bba947b3614973c15fc5add90c
|
|
4
|
+
data.tar.gz: f7abd0e2d505f535dd902a692b273c85bcc6a5bd96cc6baba3bbf36bd5eb3bca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c00385eb48e0aa4061b568935a44be82b53556a0f6fd826c8b96d31286cb561d929caa05aa92209342189698698bc415f90782e64239d28f068fdcd03e035a5
|
|
7
|
+
data.tar.gz: e4e6a231effa2ca3e313b7883c7af756aeff26c82c764cd9e462b59a8a628291e2c98e7b34061fa31970923ea41942fcd49c25d8c79ba21ef332e5bd2085c928
|
data/README.md
CHANGED
|
@@ -833,8 +833,8 @@ end
|
|
|
833
833
|
|
|
834
834
|
Files.com publishes a mock Files.com API server, which is useful for testing your use of the Files.com
|
|
835
835
|
SDKs and other direct integrations against the Files.com API in an integration test environment.
|
|
836
|
-
It never checks credentials: send any placeholder API key, and never use
|
|
837
|
-
with it.
|
|
836
|
+
It never checks credentials: send any placeholder API key, such as `YOUR_API_KEY`, and never use
|
|
837
|
+
real Files.com credentials with it.
|
|
838
838
|
|
|
839
839
|
The server has two modes, chosen when it starts:
|
|
840
840
|
|
|
@@ -847,10 +847,38 @@ The server has two modes, chosen when it starts:
|
|
|
847
847
|
stall or lose their connection on purpose. Requests it does not simulate fail with a clear error
|
|
848
848
|
instead of returning an example response.
|
|
849
849
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
850
|
+
### Quick Start with Docker
|
|
851
|
+
|
|
852
|
+
With [Docker](https://docs.docker.com/get-docker/) installed, start the published image from
|
|
853
|
+
[Docker Hub](https://hub.docker.com/r/filescom/files-mock-server) with the command shown. It runs
|
|
854
|
+
legacy mode at `http://127.0.0.1:4041`, reachable from your machine only: point your integration's
|
|
855
|
+
Files.com API base URL there and use a placeholder API key. Stop it with Ctrl+C; `--rm` removes its
|
|
856
|
+
container.
|
|
857
|
+
|
|
858
|
+
The published image is built for `linux/amd64` only, so the command asks for that platform;
|
|
859
|
+
without it, Docker on a machine of another architecture, such as an Apple silicon Mac, looks for
|
|
860
|
+
an image the tag does not have. The `latest` tag moves to whichever server was published last,
|
|
861
|
+
and `--pull=always` fetches it again each time, so it need not include simulation mode. To run
|
|
862
|
+
simulation mode, build the image from the source as below.
|
|
863
|
+
|
|
864
|
+
```shell title="Start the Mock Server with Docker"
|
|
865
|
+
docker run --platform linux/amd64 --rm --pull=always -p 127.0.0.1:4041:4041 filescom/files-mock-server:latest
|
|
866
|
+
|
|
867
|
+
## In another terminal, with a placeholder API key:
|
|
868
|
+
curl -H "X-FilesAPI-Key: YOUR_API_KEY" http://127.0.0.1:4041/api/rest/v1/users
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
### Simulation Mode in Docker
|
|
872
|
+
|
|
873
|
+
To run exactly the server the source's README describes, simulation mode included, build the image
|
|
874
|
+
from a checkout of the source on [GitHub](https://github.com/Files-com/files-mock-server) and run
|
|
875
|
+
it by the image ID you record with your test results. Only `linux/amd64` builds of the source have
|
|
876
|
+
been checked, so both commands ask for that platform.
|
|
877
|
+
|
|
878
|
+
Simulation mode listens only on loopback unless told otherwise, so the command binds it to the
|
|
879
|
+
container's interfaces with `-b tcp://0.0.0.0:4041` and publishes the port on your machine's
|
|
880
|
+
loopback address only. `FILES_MOCK_TRANSFER_ORIGIN` tells it the address your tests use, so the
|
|
881
|
+
upload and download URLs it returns point at the published port.
|
|
854
882
|
|
|
855
883
|
Simulation mode keeps its state only in the server process. Its control endpoints under
|
|
856
884
|
`/__files_mock/v1` report when the server is ready, reset it with your fixtures, add fault rules
|
|
@@ -858,13 +886,27 @@ and return the journal of the requests it received. It refuses work over its lim
|
|
|
858
886
|
truncating it. The README in the source describes all of these, the operations it simulates and
|
|
859
887
|
how to configure its limits.
|
|
860
888
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
889
|
+
```shell title="Simulation Mode from the Source"
|
|
890
|
+
## In a checkout of the source:
|
|
891
|
+
docker build --platform linux/amd64 -t files-mock-server:local .
|
|
892
|
+
image=$(docker image inspect --format '{{.Id}}' files-mock-server:local)
|
|
893
|
+
echo "$image" # record this ID with your test results
|
|
894
|
+
docker run --platform linux/amd64 --rm -e FILES_MOCK_MODE=simulation \
|
|
895
|
+
-e FILES_MOCK_TRANSFER_ORIGIN=http://127.0.0.1:40410 \
|
|
896
|
+
-p 127.0.0.1:40410:4041 "$image" -b tcp://0.0.0.0:4041
|
|
897
|
+
|
|
898
|
+
## In another terminal:
|
|
899
|
+
curl http://127.0.0.1:40410/__files_mock/v1/ready
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
### From the Source with Ruby
|
|
864
903
|
|
|
865
|
-
|
|
904
|
+
Start the server from its source with Ruby and Bundler. `FILES_MOCK_MODE` is read once at startup:
|
|
905
|
+
leaving it unset or setting it to `legacy` starts legacy mode, `simulation` starts simulation mode,
|
|
906
|
+
and any other value stops startup with an error. Legacy mode listens on port 4041 on all IPv4
|
|
907
|
+
interfaces, and simulation mode on `127.0.0.1:4041`.
|
|
866
908
|
|
|
867
|
-
```shell title="Start the Mock Server"
|
|
909
|
+
```shell title="Start the Mock Server with Ruby"
|
|
868
910
|
bundle install
|
|
869
911
|
|
|
870
912
|
## Legacy mode
|
data/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.791
|
data/spec/models/folder_spec.rb
CHANGED
|
@@ -31,7 +31,7 @@ RSpec.describe Files::Folder, :with_test_folder do
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
describe "mkdir" do
|
|
35
35
|
it "makes a new folder" do
|
|
36
36
|
Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
|
|
37
37
|
expect(Files::Folder.exist?(test_folder.join("my-new-folder").to_s, options)).to eq(true)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: files.com
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.791
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- files.com
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|