From 6dcde167a52af82426fde5a3a7f419d9f765f988 Mon Sep 17 00:00:00 2001 From: Nicholas O'Brien Date: Sat, 5 Apr 2025 01:02:36 +0000 Subject: [PATCH 1/2] added CDN docs --- docs/_docs/admin-guide/tavern.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/_docs/admin-guide/tavern.md b/docs/_docs/admin-guide/tavern.md index 16279f494..e2ffbf348 100644 --- a/docs/_docs/admin-guide/tavern.md +++ b/docs/_docs/admin-guide/tavern.md @@ -379,3 +379,22 @@ query PeristenceTomes { } } ``` + +## CDN HTTP API + +### Upload - POST /cdn/upload - AUTHENTICATED + +The upload API for the Tavern CDN use forms and the POST method. The parameters are `fileName` and `fileContent`. and the API will return an Ent ID for the file created. A curl example is shown below: + +```bash +[$ /tmp] curl --cookie "auth-session=REDACTED" -F "fileName=test_file" -F "fileContent=@/path/to/file" https://example.com/cdn/upload +{"data":{"file":{"id":4294967755}}}% +``` + +### Playground - GET /cdn/{fileName} - UNAUTHENTICATED + +The download API is a simple GET request where the `fileName` provided as part of the upload request(or any File Ent) is appended to the path. Additionally the endpoint is unauthenticated so no cookie is required (and easy to use from Imix!). An example of accessing the API via eldritch is below: + +```python +f = http.get(f"https://example.com/cdn/{fileName}", allow_insecure=True) +``` From 2078fbc70e7c07a628ed6496f62200fb65491f53 Mon Sep 17 00:00:00 2001 From: Nicholas O'Brien Date: Sat, 5 Apr 2025 01:10:48 +0000 Subject: [PATCH 2/2] update docs to include assets mention --- docs/_docs/admin-guide/tavern.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/_docs/admin-guide/tavern.md b/docs/_docs/admin-guide/tavern.md index e2ffbf348..5f2bee273 100644 --- a/docs/_docs/admin-guide/tavern.md +++ b/docs/_docs/admin-guide/tavern.md @@ -393,8 +393,10 @@ The upload API for the Tavern CDN use forms and the POST method. The parameters ### Playground - GET /cdn/{fileName} - UNAUTHENTICATED -The download API is a simple GET request where the `fileName` provided as part of the upload request(or any File Ent) is appended to the path. Additionally the endpoint is unauthenticated so no cookie is required (and easy to use from Imix!). An example of accessing the API via eldritch is below: +The download API is a simple GET request where the `fileName` provided as part of the upload request(or any `File` Ent) is appended to the path. Additionally the endpoint is unauthenticated so no cookie is required (and easy to use from Imix!). An example of accessing the API via eldritch is below: ```python f = http.get(f"https://example.com/cdn/{fileName}", allow_insecure=True) ``` + +As these files are stored in the `File` Ent, they can also be accessed via the `asset` eldritch library functions.