doc-locale/fr-fr/api/secure_files.md
{{< details >}}
{{< /details >}}
{{< history >}}
ci_secure_files a été supprimé.{{< /history >}}
Utilisez cette API pour gérer les fichiers sécurisés d'un projet.
Liste tous les fichiers sécurisés d'un projet spécifié.
GET /projects/:project_id/secure_files
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
project_id | entier ou chaîne | Oui | L'ID ou le chemin encodé en URL du projet. |
Exemple de requête :
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/secure_files"
Exemple de réponse :
[
{
"id": 1,
"name": "myfile.jks",
"checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aac",
"checksum_algorithm": "sha256",
"created_at": "2022-02-22T22:22:22.222Z",
"expires_at": null,
"metadata": null
},
{
"id": 2,
"name": "myfile.cer",
"checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aa2",
"checksum_algorithm": "sha256",
"created_at": "2022-02-22T22:22:22.222Z",
"expires_at": "2023-09-21T14:55:59.000Z",
"metadata": {
"id":"75949910542696343243264405377658443914",
"issuer": {
"C":"US",
"O":"Apple Inc.",
"CN":"Apple Worldwide Developer Relations Certification Authority",
"OU":"G3"
},
"subject": {
"C":"US",
"O":"Organization Name",
"CN":"Apple Distribution: Organization Name (ABC123XYZ)",
"OU":"ABC123XYZ",
"UID":"ABC123XYZ"
},
"expires_at":"2023-09-21T14:55:59.000Z"
}
}
]
Récupère les détails d'un fichier sécurisé spécifié dans un projet.
GET /projects/:project_id/secure_files/:id
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier | Oui | L'ID d'un fichier sécurisé. |
project_id | entier ou chaîne | Oui | L'ID ou le chemin encodé en URL du projet. |
Exemple de requête :
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/secure_files/1"
Exemple de réponse :
{
"id": 1,
"name": "myfile.jks",
"checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aac",
"checksum_algorithm": "sha256",
"created_at": "2022-02-22T22:22:22.222Z",
"expires_at": null,
"metadata": null
}
Crée un fichier sécurisé dans un projet spécifié.
POST /projects/:project_id/secure_files
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
file | fichier | Oui | Le fichier à téléverser (limite de 5 Mo). |
name | string | Oui | Le nom du fichier à téléverser. Le nom de fichier doit être unique dans le projet. |
project_id | entier ou chaîne | Oui | L'ID ou le chemin encodé en URL du projet. |
Exemple de requête :
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/secure_files" \
--form "name=myfile.jks" \
--form "file=@/path/to/file/myfile.jks"
Exemple de réponse :
{
"id": 1,
"name": "myfile.jks",
"checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aac",
"checksum_algorithm": "sha256",
"created_at": "2022-02-22T22:22:22.222Z",
"expires_at": null,
"metadata": null
}
Télécharge le contenu d'un fichier sécurisé spécifié dans un projet.
GET /projects/:project_id/secure_files/:id/download
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier | Oui | L'ID d'un fichier sécurisé. |
project_id | entier ou chaîne | Oui | L'ID ou le chemin encodé en URL du projet. |
Exemple de requête :
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/secure_files/1/download" \
--output myfile.jks
Supprime un fichier sécurisé spécifié d'un projet.
DELETE /projects/:project_id/secure_files/:id
Attributs pris en charge :
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier | Oui | L'ID d'un fichier sécurisé. |
project_id | entier ou chaîne | Oui | L'ID ou le chemin encodé en URL du projet. |
Exemple de requête :
curl --request DELETE \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/secure_files/1"