Skip to content

DevOps for Mobile Apps Demo - December 15, 2021

Recording

https://youtu.be/kRwo4aIHd2Q

Mission

DevOps for Mobile Apps Single-Engineer Group

Our goal is to improve the experience for Developers targeting mobile platforms by providing CI/CD capabilities and workflows that improve the experience of provisioning and deploying mobile apps.

Demos like this one are published each week, you can find previous demos and see new ones when they are finished in the Weekly Demos issue.

Current Update - Adding Secure Files Uploader / Downloader MR

Merge Request

Adding Secure Files Uploader / Downloader

APIs

Upload a Secure File

Secure Files can be uploaded via POST /projects/:id/secure_files with the name, file (5 MB limit) and optional permissions inputs. For example:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/secure_files --form "name=myfile.jks" --form "file=@/path/to/file/myfile.jks"

The response payload includes the file id, name, download_token, and permissions.

{
  "id": 1,
  "name": "myfile.jks",
  "download_token": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwaXJlc19hdCI6IjIwMjEtMTItMTUgMjA6MDc6MjggVVRDIn0.dYW_eEPd8isH8qwdKHR2Jv1WksvKg7D0mOj6_wTEeY8",
  "permissions": "read_only"
}

List all Secure Files for a Project

A list of Secure Files for a project is returned via GET /projects/:id/secure_files. The response payload is similar to the above.

curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/secure_files"

[{
  "id": 1,
  "name": "myfile.jks",
  "download_token": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwaXJlc19hdCI6IjIwMjEtMTItMTUgMjA6MDc6MjggVVRDIn0.dYW_eEPd8isH8qwdKHR2Jv1WksvKg7D0mOj6_wTEeY8",
  "permissions": "read_only"
}]

Get an individual Secure File

An individual Secure File is returned via GET /projects/:id/secure_files/:secure_file_id with a similar response payload.

curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/secure_files/1"

{
  "id": 1,
  "name": "myfile.jks",
  "download_token": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwaXJlc19hdCI6IjIwMjEtMTItMTUgMjA6MDc6MjggVVRDIn0.dYW_eEPd8isH8qwdKHR2Jv1WksvKg7D0mOj6_wTEeY8",
  "permissions": "read_only"
}

Download a Secure File

A single Secure File can be downloaded via GET /projects/:id/secure_files/:secure_file_id/download?token=<download_token>. There is no JSON response for this endpoint, it simply returns the decrypted file content.

The download token is a short-lived (30 min) token specific to the individual file and required by the download API.

curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/secure_files/1/download?token=<download_token> --output myfile.jks

Delete an individual Secure File

An individual Secure File can be deleted via DELETE /projects/:id/secure_files/:secure_file_id

curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/secure_files/1"

Up Next

  • Work to gather feedback on the MR
  • Work through remaining To Dos in the MR
Edited by Darby Frey