Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dantb committed Sep 20, 2023
1 parent e4436fc commit 925d7a5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
19 changes: 5 additions & 14 deletions docs/src/main/paradox/docs/delta/api/archives-api.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Archives

An archive is a collection of resources stored inside an archive file. The archiving format chosen for this purpose is
tar (or tarball). Archive resources are rooted in the `/v1/archives/{org_label}/{project_label}/` collection.
ZIP. Archive resources are rooted in the `/v1/archives/{org_label}/{project_label}/` collection.

Each archive...

Expand Down Expand Up @@ -101,15 +101,15 @@ The json payload:
- If the `@id` value is not found on the payload, an @id will be generated as follows: `base:{UUID}`. The `base` is
the `prefix` defined on the resource's project (`{project_label}`).

The response will be an HTTP 303 Location redirect, which will point to the url where to consume the archive (tarball).
The response will be an HTTP 303 Location redirect, which will point to the url where to consume the archive (ZIP).

The following diagram can help to understand the HTTP exchange
![post-redirect-get](assets/archives/post-redirect-get.png "Post/Redirect/Get archive")

**Example**

The following example shows how to create an archive containing 3 files. 2 of them are resources and the other is a file.
As a response, the tarball will be offered.
As a response, the ZIP file will be offered.

Request
: @@snip [archive.sh](assets/archives/create.sh)
Expand Down Expand Up @@ -147,16 +147,7 @@ Note that if the payload contains an @id different from the `{archive_id}`, the

When fetching an archive, the response format can be chosen through HTTP content negotiation.
In order to fetch the archive metadata, the client can use any of the @ref:[following MIME types](content-negotiation.md#supported-mime-types).
However, in order to fetch the archive content, the HTTP `Accept` header should be provided:

* `*/*` or `application/x-tar` will return a tar archive (or tarball)
* `application/zip` will return a zip archive

@@@ note { .warning }

@link:[The limitations of the tar format](https://en.wikipedia.org/wiki/Tar_(computing))
makes the usage of archives difficult (among other things, the maximum file name is limited to 100 characters),
so its support will be removed in a future release.
However, in order to fetch the archive content, the HTTP `Accept` header should be provided as `application/zip`.

@@@

Expand All @@ -170,7 +161,7 @@ GET /v1/archives/{org_label}/{project_label}/{archive_id}?ignoreNotFound=true

**Example**

Request (tarball)
Request (ZIP)
: @@snip [fetch.sh](assets/archives/fetch.sh)

Request (metadata)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/paradox/docs/delta/api/assets/archives/fetch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
curl "http://localhost:8080/v1/archives/myorg/myproject/myarchive" \
-H "Accept: application/x-tar" \
-o output.tar
-H "Accept: application/x-zip" \
-o output.zip
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"_createdAt": "2021-05-17T14:54:42.939Z",
"_createdBy": "http://localhost:8080/v1/realms/myrealm/users/john",
"_updatedAt": "2021-05-17T14:54:42.939Z",
"_updatedBy": "http://localhost:8080/v1/realms/myrealm/users/john"
"_updatedBy": "http://localhost:8080/v1/realms/myrealm/users/john",
"_expiresInSeconds": 17530
}
2 changes: 1 addition & 1 deletion docs/src/main/paradox/docs/delta/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A file is a binary attachment resource.

## Archives

An archive is a collection of resources stored inside an archive file. The archiving format chosen for this purpose is tar (or tarball).
An archive is a collection of resources stored inside an archive file. The archiving format chosen for this purpose is ZIP file.

@ref:[Operations on archives](archives-api.md)

Expand Down
4 changes: 4 additions & 0 deletions docs/src/main/paradox/docs/releases/v1.9-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Annotated source is now available as an output format when creating an archive.

Creating an archive now requires only the `resources/read` permission instead of `archives/write`.

#### Remove support for Tarball archives

Tarball archives are no longer supported due to unnecessary restrictions. ZIP is now the only allowed format and clients should send `application/zip` in the `Accept` header when creating archives.

### Storages

Storages can no longer be created with credentials that would get stored:
Expand Down

0 comments on commit 925d7a5

Please sign in to comment.