factpulse 1.0.8 → 1.0.13
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/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/docs/ChorusProApi.md +1 -1
- data/docs/MontantHtTotal1.md +15 -0
- data/docs/MontantTtcTotal1.md +15 -0
- data/docs/MontantTva1.md +15 -0
- data/docs/OptionsProcessing.md +1 -1
- data/docs/SoumettreFactureRequest.md +3 -3
- data/docs/StatutTache.md +1 -1
- data/lib/factpulse/models/montant_ht_total1.rb +104 -0
- data/lib/factpulse/models/montant_ttc_total1.rb +104 -0
- data/lib/factpulse/models/montant_tva1.rb +104 -0
- data/lib/factpulse/models/options_processing.rb +1 -15
- data/lib/factpulse/models/soumettre_facture_request.rb +3 -6
- data/lib/factpulse/models/statut_tache.rb +4 -2
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +3 -2
- metadata +7 -5
- data/docs/ProcessingEndpointsUnifisApi.md +0 -147
- data/docs/SignatureLectroniqueApi.md +0 -315
- data/lib/factpulse/api/processing_endpoints_unifis_api.rb +0 -158
- data/lib/factpulse/api/signature_lectronique_api.rb +0 -333
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#API REST FactPulse
|
|
3
|
-
|
|
4
|
-
# API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
5
|
-
|
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
|
7
|
-
|
|
8
|
-
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.18.0-SNAPSHOT
|
|
10
|
-
|
|
11
|
-
=end
|
|
12
|
-
|
|
13
|
-
require 'cgi'
|
|
14
|
-
|
|
15
|
-
module FactPulse
|
|
16
|
-
class SignatureLectroniqueApi
|
|
17
|
-
attr_accessor :api_client
|
|
18
|
-
|
|
19
|
-
def initialize(api_client = ApiClient.default)
|
|
20
|
-
@api_client = api_client
|
|
21
|
-
end
|
|
22
|
-
# Générer un certificat X.509 auto-signé de test
|
|
23
|
-
# Génère un certificat X.509 auto-signé pour les tests de signature électronique PDF. **⚠️ ATTENTION : Certificat de TEST uniquement !** Ce certificat est : - ✅ Adapté pour tests et développement - ✅ Compatible signature PDF (PAdES) - ✅ Conforme eIDAS niveau **SES** (Simple Electronic Signature) - ❌ **JAMAIS utilisable en production** - ❌ **Non reconnu** par les navigateurs et lecteurs PDF - ❌ **Aucune valeur juridique** ## Niveaux eIDAS - **SES** (Simple) : Certificat auto-signé ← Généré par cet endpoint - **AdES** (Advanced) : Certificat CA commerciale (Let's Encrypt, etc.) - **QES** (Qualified) : Certificat qualifié PSCO (CertEurope, Universign, etc.) ## Utilisation Une fois généré, le certificat peut être : 1. **Enregistré dans Django** (recommandé) : - Django Admin > Certificats de signature - Upload `certificat_pem` et `cle_privee_pem` 2. **Utilisé directement** : - Signer un PDF avec `/signer-pdf` - Le certificat sera automatiquement utilisé ## Exemple d'appel ```bash curl -X POST \"https://www.factpulse.fr/api/facturation/generer-certificat-test\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organisation\": \"Client XYZ SARL\", \"email\": \"contact@xyz.fr\", \"duree_jours\": 365 }' ``` ## Cas d'usage - Tests de signature PDF en développement - POC de signature électronique - Formation et démos - Tests d'intégration automatisés ## Conformité technique Certificat généré avec : - Clé RSA 2048 ou 4096 bits - Algorithme SHA-256 - Extensions Key Usage : `digitalSignature`, `contentCommitment` (non-repudiation) - Extensions Extended Key Usage : `codeSigning`, `emailProtection` - Validité : 1 jour à 10 ans (configurable) - Format : PEM (certificat et clé) - Optionnel : PKCS#12 (.p12)
|
|
24
|
-
# @param generate_certificate_request [GenerateCertificateRequest]
|
|
25
|
-
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [GenerateCertificateResponse]
|
|
27
|
-
def generer_certificat_test_api_v1_traitement_generer_certificat_test_post(generate_certificate_request, opts = {})
|
|
28
|
-
data, _status_code, _headers = generer_certificat_test_api_v1_traitement_generer_certificat_test_post_with_http_info(generate_certificate_request, opts)
|
|
29
|
-
data
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Générer un certificat X.509 auto-signé de test
|
|
33
|
-
# Génère un certificat X.509 auto-signé pour les tests de signature électronique PDF. **⚠️ ATTENTION : Certificat de TEST uniquement !** Ce certificat est : - ✅ Adapté pour tests et développement - ✅ Compatible signature PDF (PAdES) - ✅ Conforme eIDAS niveau **SES** (Simple Electronic Signature) - ❌ **JAMAIS utilisable en production** - ❌ **Non reconnu** par les navigateurs et lecteurs PDF - ❌ **Aucune valeur juridique** ## Niveaux eIDAS - **SES** (Simple) : Certificat auto-signé ← Généré par cet endpoint - **AdES** (Advanced) : Certificat CA commerciale (Let's Encrypt, etc.) - **QES** (Qualified) : Certificat qualifié PSCO (CertEurope, Universign, etc.) ## Utilisation Une fois généré, le certificat peut être : 1. **Enregistré dans Django** (recommandé) : - Django Admin > Certificats de signature - Upload `certificat_pem` et `cle_privee_pem` 2. **Utilisé directement** : - Signer un PDF avec `/signer-pdf` - Le certificat sera automatiquement utilisé ## Exemple d'appel ```bash curl -X POST \"https://www.factpulse.fr/api/facturation/generer-certificat-test\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organisation\": \"Client XYZ SARL\", \"email\": \"contact@xyz.fr\", \"duree_jours\": 365 }' ``` ## Cas d'usage - Tests de signature PDF en développement - POC de signature électronique - Formation et démos - Tests d'intégration automatisés ## Conformité technique Certificat généré avec : - Clé RSA 2048 ou 4096 bits - Algorithme SHA-256 - Extensions Key Usage : `digitalSignature`, `contentCommitment` (non-repudiation) - Extensions Extended Key Usage : `codeSigning`, `emailProtection` - Validité : 1 jour à 10 ans (configurable) - Format : PEM (certificat et clé) - Optionnel : PKCS#12 (.p12)
|
|
34
|
-
# @param generate_certificate_request [GenerateCertificateRequest]
|
|
35
|
-
# @param [Hash] opts the optional parameters
|
|
36
|
-
# @return [Array<(GenerateCertificateResponse, Integer, Hash)>] GenerateCertificateResponse data, response status code and response headers
|
|
37
|
-
def generer_certificat_test_api_v1_traitement_generer_certificat_test_post_with_http_info(generate_certificate_request, opts = {})
|
|
38
|
-
if @api_client.config.debugging
|
|
39
|
-
@api_client.config.logger.debug 'Calling API: SignatureLectroniqueApi.generer_certificat_test_api_v1_traitement_generer_certificat_test_post ...'
|
|
40
|
-
end
|
|
41
|
-
# verify the required parameter 'generate_certificate_request' is set
|
|
42
|
-
if @api_client.config.client_side_validation && generate_certificate_request.nil?
|
|
43
|
-
fail ArgumentError, "Missing the required parameter 'generate_certificate_request' when calling SignatureLectroniqueApi.generer_certificat_test_api_v1_traitement_generer_certificat_test_post"
|
|
44
|
-
end
|
|
45
|
-
# resource path
|
|
46
|
-
local_var_path = '/api/v1/traitement/generer-certificat-test'
|
|
47
|
-
|
|
48
|
-
# query parameters
|
|
49
|
-
query_params = opts[:query_params] || {}
|
|
50
|
-
|
|
51
|
-
# header parameters
|
|
52
|
-
header_params = opts[:header_params] || {}
|
|
53
|
-
# HTTP header 'Accept' (if needed)
|
|
54
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
-
# HTTP header 'Content-Type'
|
|
56
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
-
if !content_type.nil?
|
|
58
|
-
header_params['Content-Type'] = content_type
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# form parameters
|
|
62
|
-
form_params = opts[:form_params] || {}
|
|
63
|
-
|
|
64
|
-
# http body (model)
|
|
65
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_certificate_request)
|
|
66
|
-
|
|
67
|
-
# return_type
|
|
68
|
-
return_type = opts[:debug_return_type] || 'GenerateCertificateResponse'
|
|
69
|
-
|
|
70
|
-
# auth_names
|
|
71
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
72
|
-
|
|
73
|
-
new_options = opts.merge(
|
|
74
|
-
:operation => :"SignatureLectroniqueApi.generer_certificat_test_api_v1_traitement_generer_certificat_test_post",
|
|
75
|
-
:header_params => header_params,
|
|
76
|
-
:query_params => query_params,
|
|
77
|
-
:form_params => form_params,
|
|
78
|
-
:body => post_body,
|
|
79
|
-
:auth_names => auth_names,
|
|
80
|
-
:return_type => return_type
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
-
if @api_client.config.debugging
|
|
85
|
-
@api_client.config.logger.debug "API called: SignatureLectroniqueApi#generer_certificat_test_api_v1_traitement_generer_certificat_test_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
-
end
|
|
87
|
-
return data, status_code, headers
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# Signer un PDF avec le certificat du client (PAdES-B-LT)
|
|
91
|
-
# Signe un PDF uploadé avec le certificat électronique configuré pour le client (via client_uid du JWT). **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO - hors scope). **⚠️ Disclaimer légal** : Les signatures générées sont des cachets électroniques au sens du règlement eIDAS. Le niveau de validité juridique dépend du certificat utilisé (SES/AdES/QES). FactPulse ne fournit pas de certificats qualifiés QES - vous devez obtenir un certificat auprès d'un PSCO (Prestataire de Services de Confiance qualifié) pour une validité juridique maximale.
|
|
92
|
-
# @param fichier_pdf [File] Fichier PDF à signer (sera traité puis retourné signé en base64)
|
|
93
|
-
# @param [Hash] opts the optional parameters
|
|
94
|
-
# @option opts [String] :raison
|
|
95
|
-
# @option opts [String] :localisation
|
|
96
|
-
# @option opts [String] :contact
|
|
97
|
-
# @option opts [String] :field_name Nom du champ de signature PDF (default to 'FactPulseSignature')
|
|
98
|
-
# @option opts [Boolean] :use_pades_lt Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL. (default to false)
|
|
99
|
-
# @option opts [Boolean] :use_timestamp Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T) (default to true)
|
|
100
|
-
# @return [Object]
|
|
101
|
-
def signer_pdf_api_v1_traitement_signer_pdf_post(fichier_pdf, opts = {})
|
|
102
|
-
data, _status_code, _headers = signer_pdf_api_v1_traitement_signer_pdf_post_with_http_info(fichier_pdf, opts)
|
|
103
|
-
data
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
# Signer un PDF avec le certificat du client (PAdES-B-LT)
|
|
107
|
-
# Signe un PDF uploadé avec le certificat électronique configuré pour le client (via client_uid du JWT). **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO - hors scope). **⚠️ Disclaimer légal** : Les signatures générées sont des cachets électroniques au sens du règlement eIDAS. Le niveau de validité juridique dépend du certificat utilisé (SES/AdES/QES). FactPulse ne fournit pas de certificats qualifiés QES - vous devez obtenir un certificat auprès d'un PSCO (Prestataire de Services de Confiance qualifié) pour une validité juridique maximale.
|
|
108
|
-
# @param fichier_pdf [File] Fichier PDF à signer (sera traité puis retourné signé en base64)
|
|
109
|
-
# @param [Hash] opts the optional parameters
|
|
110
|
-
# @option opts [String] :raison
|
|
111
|
-
# @option opts [String] :localisation
|
|
112
|
-
# @option opts [String] :contact
|
|
113
|
-
# @option opts [String] :field_name Nom du champ de signature PDF (default to 'FactPulseSignature')
|
|
114
|
-
# @option opts [Boolean] :use_pades_lt Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL. (default to false)
|
|
115
|
-
# @option opts [Boolean] :use_timestamp Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T) (default to true)
|
|
116
|
-
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
117
|
-
def signer_pdf_api_v1_traitement_signer_pdf_post_with_http_info(fichier_pdf, opts = {})
|
|
118
|
-
if @api_client.config.debugging
|
|
119
|
-
@api_client.config.logger.debug 'Calling API: SignatureLectroniqueApi.signer_pdf_api_v1_traitement_signer_pdf_post ...'
|
|
120
|
-
end
|
|
121
|
-
# verify the required parameter 'fichier_pdf' is set
|
|
122
|
-
if @api_client.config.client_side_validation && fichier_pdf.nil?
|
|
123
|
-
fail ArgumentError, "Missing the required parameter 'fichier_pdf' when calling SignatureLectroniqueApi.signer_pdf_api_v1_traitement_signer_pdf_post"
|
|
124
|
-
end
|
|
125
|
-
# resource path
|
|
126
|
-
local_var_path = '/api/v1/traitement/signer-pdf'
|
|
127
|
-
|
|
128
|
-
# query parameters
|
|
129
|
-
query_params = opts[:query_params] || {}
|
|
130
|
-
|
|
131
|
-
# header parameters
|
|
132
|
-
header_params = opts[:header_params] || {}
|
|
133
|
-
# HTTP header 'Accept' (if needed)
|
|
134
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
135
|
-
# HTTP header 'Content-Type'
|
|
136
|
-
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
137
|
-
if !content_type.nil?
|
|
138
|
-
header_params['Content-Type'] = content_type
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
# form parameters
|
|
142
|
-
form_params = opts[:form_params] || {}
|
|
143
|
-
form_params['fichier_pdf'] = fichier_pdf
|
|
144
|
-
form_params['raison'] = opts[:'raison'] if !opts[:'raison'].nil?
|
|
145
|
-
form_params['localisation'] = opts[:'localisation'] if !opts[:'localisation'].nil?
|
|
146
|
-
form_params['contact'] = opts[:'contact'] if !opts[:'contact'].nil?
|
|
147
|
-
form_params['field_name'] = opts[:'field_name'] if !opts[:'field_name'].nil?
|
|
148
|
-
form_params['use_pades_lt'] = opts[:'use_pades_lt'] if !opts[:'use_pades_lt'].nil?
|
|
149
|
-
form_params['use_timestamp'] = opts[:'use_timestamp'] if !opts[:'use_timestamp'].nil?
|
|
150
|
-
|
|
151
|
-
# http body (model)
|
|
152
|
-
post_body = opts[:debug_body]
|
|
153
|
-
|
|
154
|
-
# return_type
|
|
155
|
-
return_type = opts[:debug_return_type] || 'Object'
|
|
156
|
-
|
|
157
|
-
# auth_names
|
|
158
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
159
|
-
|
|
160
|
-
new_options = opts.merge(
|
|
161
|
-
:operation => :"SignatureLectroniqueApi.signer_pdf_api_v1_traitement_signer_pdf_post",
|
|
162
|
-
:header_params => header_params,
|
|
163
|
-
:query_params => query_params,
|
|
164
|
-
:form_params => form_params,
|
|
165
|
-
:body => post_body,
|
|
166
|
-
:auth_names => auth_names,
|
|
167
|
-
:return_type => return_type
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
171
|
-
if @api_client.config.debugging
|
|
172
|
-
@api_client.config.logger.debug "API called: SignatureLectroniqueApi#signer_pdf_api_v1_traitement_signer_pdf_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
173
|
-
end
|
|
174
|
-
return data, status_code, headers
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# Signer un PDF de manière asynchrone (Celery)
|
|
178
|
-
# Signe un PDF uploadé de manière asynchrone via une tâche Celery. **Différence avec /signer-pdf** : - `/signer-pdf` : Signature synchrone (blocage jusqu'à la fin) - `/signer-pdf-async` : Signature asynchrone (retourne immédiatement un task_id) **Avantages de l'async** : - Pas de timeout pour les gros fichiers - Pas de blocage du worker FastAPI - Possibilité de suivre la progression via le task_id - Idéal pour les traitements par lot **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **⚠️ Disclaimer légal** : Identique à /signer-pdf (voir documentation de cet endpoint).
|
|
179
|
-
# @param fichier_pdf [File] Fichier PDF à signer (traité de manière asynchrone)
|
|
180
|
-
# @param [Hash] opts the optional parameters
|
|
181
|
-
# @option opts [String] :raison
|
|
182
|
-
# @option opts [String] :localisation
|
|
183
|
-
# @option opts [String] :contact
|
|
184
|
-
# @option opts [String] :field_name Nom du champ de signature PDF (default to 'FactPulseSignature')
|
|
185
|
-
# @option opts [Boolean] :use_pades_lt Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL. (default to false)
|
|
186
|
-
# @option opts [Boolean] :use_timestamp Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T) (default to true)
|
|
187
|
-
# @return [Object]
|
|
188
|
-
def signer_pdf_async_api_v1_traitement_signer_pdf_async_post(fichier_pdf, opts = {})
|
|
189
|
-
data, _status_code, _headers = signer_pdf_async_api_v1_traitement_signer_pdf_async_post_with_http_info(fichier_pdf, opts)
|
|
190
|
-
data
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# Signer un PDF de manière asynchrone (Celery)
|
|
194
|
-
# Signe un PDF uploadé de manière asynchrone via une tâche Celery. **Différence avec /signer-pdf** : - `/signer-pdf` : Signature synchrone (blocage jusqu'à la fin) - `/signer-pdf-async` : Signature asynchrone (retourne immédiatement un task_id) **Avantages de l'async** : - Pas de timeout pour les gros fichiers - Pas de blocage du worker FastAPI - Possibilité de suivre la progression via le task_id - Idéal pour les traitements par lot **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **⚠️ Disclaimer légal** : Identique à /signer-pdf (voir documentation de cet endpoint).
|
|
195
|
-
# @param fichier_pdf [File] Fichier PDF à signer (traité de manière asynchrone)
|
|
196
|
-
# @param [Hash] opts the optional parameters
|
|
197
|
-
# @option opts [String] :raison
|
|
198
|
-
# @option opts [String] :localisation
|
|
199
|
-
# @option opts [String] :contact
|
|
200
|
-
# @option opts [String] :field_name Nom du champ de signature PDF (default to 'FactPulseSignature')
|
|
201
|
-
# @option opts [Boolean] :use_pades_lt Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL. (default to false)
|
|
202
|
-
# @option opts [Boolean] :use_timestamp Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T) (default to true)
|
|
203
|
-
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
204
|
-
def signer_pdf_async_api_v1_traitement_signer_pdf_async_post_with_http_info(fichier_pdf, opts = {})
|
|
205
|
-
if @api_client.config.debugging
|
|
206
|
-
@api_client.config.logger.debug 'Calling API: SignatureLectroniqueApi.signer_pdf_async_api_v1_traitement_signer_pdf_async_post ...'
|
|
207
|
-
end
|
|
208
|
-
# verify the required parameter 'fichier_pdf' is set
|
|
209
|
-
if @api_client.config.client_side_validation && fichier_pdf.nil?
|
|
210
|
-
fail ArgumentError, "Missing the required parameter 'fichier_pdf' when calling SignatureLectroniqueApi.signer_pdf_async_api_v1_traitement_signer_pdf_async_post"
|
|
211
|
-
end
|
|
212
|
-
# resource path
|
|
213
|
-
local_var_path = '/api/v1/traitement/signer-pdf-async'
|
|
214
|
-
|
|
215
|
-
# query parameters
|
|
216
|
-
query_params = opts[:query_params] || {}
|
|
217
|
-
|
|
218
|
-
# header parameters
|
|
219
|
-
header_params = opts[:header_params] || {}
|
|
220
|
-
# HTTP header 'Accept' (if needed)
|
|
221
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
222
|
-
# HTTP header 'Content-Type'
|
|
223
|
-
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
224
|
-
if !content_type.nil?
|
|
225
|
-
header_params['Content-Type'] = content_type
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
# form parameters
|
|
229
|
-
form_params = opts[:form_params] || {}
|
|
230
|
-
form_params['fichier_pdf'] = fichier_pdf
|
|
231
|
-
form_params['raison'] = opts[:'raison'] if !opts[:'raison'].nil?
|
|
232
|
-
form_params['localisation'] = opts[:'localisation'] if !opts[:'localisation'].nil?
|
|
233
|
-
form_params['contact'] = opts[:'contact'] if !opts[:'contact'].nil?
|
|
234
|
-
form_params['field_name'] = opts[:'field_name'] if !opts[:'field_name'].nil?
|
|
235
|
-
form_params['use_pades_lt'] = opts[:'use_pades_lt'] if !opts[:'use_pades_lt'].nil?
|
|
236
|
-
form_params['use_timestamp'] = opts[:'use_timestamp'] if !opts[:'use_timestamp'].nil?
|
|
237
|
-
|
|
238
|
-
# http body (model)
|
|
239
|
-
post_body = opts[:debug_body]
|
|
240
|
-
|
|
241
|
-
# return_type
|
|
242
|
-
return_type = opts[:debug_return_type] || 'Object'
|
|
243
|
-
|
|
244
|
-
# auth_names
|
|
245
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
246
|
-
|
|
247
|
-
new_options = opts.merge(
|
|
248
|
-
:operation => :"SignatureLectroniqueApi.signer_pdf_async_api_v1_traitement_signer_pdf_async_post",
|
|
249
|
-
:header_params => header_params,
|
|
250
|
-
:query_params => query_params,
|
|
251
|
-
:form_params => form_params,
|
|
252
|
-
:body => post_body,
|
|
253
|
-
:auth_names => auth_names,
|
|
254
|
-
:return_type => return_type
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
258
|
-
if @api_client.config.debugging
|
|
259
|
-
@api_client.config.logger.debug "API called: SignatureLectroniqueApi#signer_pdf_async_api_v1_traitement_signer_pdf_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
260
|
-
end
|
|
261
|
-
return data, status_code, headers
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
# Valider les signatures électroniques d'un PDF
|
|
265
|
-
# Valide les signatures électroniques présentes dans un PDF uploadé. **Vérifications effectuées** : - Présence de signatures - Intégrité du document (non modifié depuis signature) - Validité des certificats - Chaîne de confiance (si disponible) - Présence d'horodatage (PAdES-B-T) - Données de validation (PAdES-B-LT) **Standards supportés** : PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note** : Cette validation est technique (intégrité cryptographique). La validité juridique dépend du niveau eIDAS du certificat (SES/AdES/QES) et du contexte d'utilisation.
|
|
266
|
-
# @param fichier_pdf [File] Fichier PDF à valider (sera analysé pour détecter et valider les signatures)
|
|
267
|
-
# @param [Hash] opts the optional parameters
|
|
268
|
-
# @return [Object]
|
|
269
|
-
def valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post(fichier_pdf, opts = {})
|
|
270
|
-
data, _status_code, _headers = valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_with_http_info(fichier_pdf, opts)
|
|
271
|
-
data
|
|
272
|
-
end
|
|
273
|
-
|
|
274
|
-
# Valider les signatures électroniques d'un PDF
|
|
275
|
-
# Valide les signatures électroniques présentes dans un PDF uploadé. **Vérifications effectuées** : - Présence de signatures - Intégrité du document (non modifié depuis signature) - Validité des certificats - Chaîne de confiance (si disponible) - Présence d'horodatage (PAdES-B-T) - Données de validation (PAdES-B-LT) **Standards supportés** : PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note** : Cette validation est technique (intégrité cryptographique). La validité juridique dépend du niveau eIDAS du certificat (SES/AdES/QES) et du contexte d'utilisation.
|
|
276
|
-
# @param fichier_pdf [File] Fichier PDF à valider (sera analysé pour détecter et valider les signatures)
|
|
277
|
-
# @param [Hash] opts the optional parameters
|
|
278
|
-
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
279
|
-
def valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_with_http_info(fichier_pdf, opts = {})
|
|
280
|
-
if @api_client.config.debugging
|
|
281
|
-
@api_client.config.logger.debug 'Calling API: SignatureLectroniqueApi.valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post ...'
|
|
282
|
-
end
|
|
283
|
-
# verify the required parameter 'fichier_pdf' is set
|
|
284
|
-
if @api_client.config.client_side_validation && fichier_pdf.nil?
|
|
285
|
-
fail ArgumentError, "Missing the required parameter 'fichier_pdf' when calling SignatureLectroniqueApi.valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post"
|
|
286
|
-
end
|
|
287
|
-
# resource path
|
|
288
|
-
local_var_path = '/api/v1/traitement/valider-signature-pdf'
|
|
289
|
-
|
|
290
|
-
# query parameters
|
|
291
|
-
query_params = opts[:query_params] || {}
|
|
292
|
-
|
|
293
|
-
# header parameters
|
|
294
|
-
header_params = opts[:header_params] || {}
|
|
295
|
-
# HTTP header 'Accept' (if needed)
|
|
296
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
297
|
-
# HTTP header 'Content-Type'
|
|
298
|
-
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
299
|
-
if !content_type.nil?
|
|
300
|
-
header_params['Content-Type'] = content_type
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
# form parameters
|
|
304
|
-
form_params = opts[:form_params] || {}
|
|
305
|
-
form_params['fichier_pdf'] = fichier_pdf
|
|
306
|
-
|
|
307
|
-
# http body (model)
|
|
308
|
-
post_body = opts[:debug_body]
|
|
309
|
-
|
|
310
|
-
# return_type
|
|
311
|
-
return_type = opts[:debug_return_type] || 'Object'
|
|
312
|
-
|
|
313
|
-
# auth_names
|
|
314
|
-
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
315
|
-
|
|
316
|
-
new_options = opts.merge(
|
|
317
|
-
:operation => :"SignatureLectroniqueApi.valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post",
|
|
318
|
-
:header_params => header_params,
|
|
319
|
-
:query_params => query_params,
|
|
320
|
-
:form_params => form_params,
|
|
321
|
-
:body => post_body,
|
|
322
|
-
:auth_names => auth_names,
|
|
323
|
-
:return_type => return_type
|
|
324
|
-
)
|
|
325
|
-
|
|
326
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
327
|
-
if @api_client.config.debugging
|
|
328
|
-
@api_client.config.logger.debug "API called: SignatureLectroniqueApi#valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
329
|
-
end
|
|
330
|
-
return data, status_code, headers
|
|
331
|
-
end
|
|
332
|
-
end
|
|
333
|
-
end
|