factpulse 4.0.2 → 4.0.3
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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +12 -0
- data/docs/AFNORPDPPAApi.md +9 -2
- data/docs/AsyncTasksApi.md +6 -1
- data/docs/ChorusProApi.md +96 -16
- data/docs/ClientManagementApi.md +359 -13
- data/docs/ConvertResumeRequest.md +5 -1
- data/docs/DownloadsApi.md +12 -2
- data/docs/ElectronicSignatureApi.md +24 -4
- data/docs/FacturXConversionApi.md +101 -4
- data/docs/FacturXGenerationApi.md +18 -3
- data/docs/FacturXPDFXMLVerificationApi.md +18 -3
- data/docs/FacturXValidationApi.md +18 -3
- data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +18 -0
- data/docs/Flux10EReportingApi.md +36 -6
- data/docs/Flux6InvoiceLifecycleCDARApi.md +18 -3
- data/docs/HealthApi.md +6 -1
- data/docs/KeyRotationRequest.md +20 -0
- data/docs/KeyRotationResponse.md +24 -0
- data/docs/PDPConfigResponse.md +2 -0
- data/docs/PDPConfigUpdateRequest.md +3 -1
- data/docs/SecretStatus.md +5 -1
- data/docs/ValidateCDARResponse.md +2 -2
- data/docs/ValidationErrorResponse.md +8 -2
- data/docs/WebhookSecretDeleteResponse.md +20 -0
- data/docs/WebhookSecretGenerateResponse.md +24 -0
- data/docs/WebhookSecretStatusResponse.md +20 -0
- data/lib/factpulse/api/afnorpdppa_api.rb +4 -1
- data/lib/factpulse/api/async_tasks_api.rb +1 -1
- data/lib/factpulse/api/chorus_pro_api.rb +16 -16
- data/lib/factpulse/api/client_management_api.rb +276 -10
- data/lib/factpulse/api/downloads_api.rb +2 -2
- data/lib/factpulse/api/electronic_signature_api.rb +4 -4
- data/lib/factpulse/api/factur_x_conversion_api.rb +78 -4
- data/lib/factpulse/api/factur_x_generation_api.rb +3 -3
- data/lib/factpulse/api/factur_x_validation_api.rb +3 -3
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +3 -3
- data/lib/factpulse/api/flux10_e_reporting_api.rb +6 -6
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +3 -3
- data/lib/factpulse/api/health_api.rb +1 -1
- data/lib/factpulse/configuration.rb +7 -0
- data/lib/factpulse/models/convert_resume_request.rb +27 -5
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response.rb +168 -0
- data/lib/factpulse/models/key_rotation_request.rb +211 -0
- data/lib/factpulse/models/key_rotation_response.rb +232 -0
- data/lib/factpulse/models/pdp_config_response.rb +11 -1
- data/lib/factpulse/models/pdp_config_update_request.rb +49 -5
- data/lib/factpulse/models/secret_status.rb +24 -4
- data/lib/factpulse/models/validate_cdar_response.rb +2 -2
- data/lib/factpulse/models/validation_error_response.rb +67 -20
- data/lib/factpulse/models/{facture_electronique_rest_api_schemas_cdar_validation_error_response.rb → webhook_secret_delete_response.rb} +25 -47
- data/lib/factpulse/models/webhook_secret_generate_response.rb +247 -0
- data/lib/factpulse/models/webhook_secret_status_response.rb +176 -0
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +6 -1
- metadata +14 -4
- data/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +0 -24
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X - Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Request to rotate the client encryption key. This operation re-encrypts all secrets from the old key to the new key. Both keys must be base64-encoded AES-256 keys (32 bytes each).
|
|
18
|
+
class KeyRotationRequest < ApiModelBase
|
|
19
|
+
# Current encryption key (base64-encoded AES-256)
|
|
20
|
+
attr_accessor :old_key
|
|
21
|
+
|
|
22
|
+
# New encryption key (base64-encoded AES-256)
|
|
23
|
+
attr_accessor :new_key
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'old_key' => :'oldKey',
|
|
29
|
+
:'new_key' => :'newKey'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'old_key' => :'String',
|
|
47
|
+
:'new_key' => :'String'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::KeyRotationRequest` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::KeyRotationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'old_key')
|
|
74
|
+
self.old_key = attributes[:'old_key']
|
|
75
|
+
else
|
|
76
|
+
self.old_key = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'new_key')
|
|
80
|
+
self.new_key = attributes[:'new_key']
|
|
81
|
+
else
|
|
82
|
+
self.new_key = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @old_key.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "old_key", old_key cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @old_key.to_s.length < 40
|
|
96
|
+
invalid_properties.push('invalid value for "old_key", the character length must be greater than or equal to 40.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if @new_key.nil?
|
|
100
|
+
invalid_properties.push('invalid value for "new_key", new_key cannot be nil.')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if @new_key.to_s.length < 40
|
|
104
|
+
invalid_properties.push('invalid value for "new_key", the character length must be greater than or equal to 40.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
return false if @old_key.nil?
|
|
115
|
+
return false if @old_key.to_s.length < 40
|
|
116
|
+
return false if @new_key.nil?
|
|
117
|
+
return false if @new_key.to_s.length < 40
|
|
118
|
+
true
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] old_key Value to be assigned
|
|
123
|
+
def old_key=(old_key)
|
|
124
|
+
if old_key.nil?
|
|
125
|
+
fail ArgumentError, 'old_key cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if old_key.to_s.length < 40
|
|
129
|
+
fail ArgumentError, 'invalid value for "old_key", the character length must be greater than or equal to 40.'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
@old_key = old_key
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] new_key Value to be assigned
|
|
137
|
+
def new_key=(new_key)
|
|
138
|
+
if new_key.nil?
|
|
139
|
+
fail ArgumentError, 'new_key cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if new_key.to_s.length < 40
|
|
143
|
+
fail ArgumentError, 'invalid value for "new_key", the character length must be greater than or equal to 40.'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@new_key = new_key
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Checks equality by comparing each attribute.
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def ==(o)
|
|
152
|
+
return true if self.equal?(o)
|
|
153
|
+
self.class == o.class &&
|
|
154
|
+
old_key == o.old_key &&
|
|
155
|
+
new_key == o.new_key
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @see the `==` method
|
|
159
|
+
# @param [Object] Object to be compared
|
|
160
|
+
def eql?(o)
|
|
161
|
+
self == o
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Calculates hash code according to all attributes.
|
|
165
|
+
# @return [Integer] Hash code
|
|
166
|
+
def hash
|
|
167
|
+
[old_key, new_key].hash
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Builds the object from hash
|
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
172
|
+
# @return [Object] Returns the model itself
|
|
173
|
+
def self.build_from_hash(attributes)
|
|
174
|
+
return nil unless attributes.is_a?(Hash)
|
|
175
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
176
|
+
transformed_hash = {}
|
|
177
|
+
openapi_types.each_pair do |key, type|
|
|
178
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
179
|
+
transformed_hash["#{key}"] = nil
|
|
180
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
181
|
+
# check to ensure the input is an array given that the attribute
|
|
182
|
+
# is documented as an array but the input is not
|
|
183
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
184
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
185
|
+
end
|
|
186
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
187
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
new(transformed_hash)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the object in the form of hash
|
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
|
195
|
+
def to_hash
|
|
196
|
+
hash = {}
|
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
198
|
+
value = self.send(attr)
|
|
199
|
+
if value.nil?
|
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
hash[param] = _to_hash(value)
|
|
205
|
+
end
|
|
206
|
+
hash
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
end
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#FactPulse REST API
|
|
3
|
+
|
|
4
|
+
# REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X - Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Factur-X - Validation - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) ### ✍️ Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification ### 📋 Flux 6 - Invoice Lifecycle (CDAR) - **CDAR Messages**: Acknowledgements, invoice statuses - **PPF Statuses**: REFUSED (210), PAID (212) ### 📊 Flux 10 - E-Reporting - **Tax Declarations**: International B2B, B2C - **Flow Types**: 10.1 (B2B transactions), 10.2 (B2B payments), 10.3 (B2C transactions), 10.4 (B2C payments) ### 📡 AFNOR PDP/PA (XP Z12-013) - **Flow Service**: Submit and search flows to PDPs - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user ### 🏛️ Chorus Pro - **Public Sector Invoicing**: Complete API for Chorus Pro ### ⏳ Async Tasks - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **Webhooks**: Automatic notifications when tasks complete ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: contact@factpulse.fr
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FactPulse
|
|
17
|
+
# Response from key rotation operation.
|
|
18
|
+
class KeyRotationResponse < ApiModelBase
|
|
19
|
+
# Whether rotation was successful
|
|
20
|
+
attr_accessor :success
|
|
21
|
+
|
|
22
|
+
# Result message
|
|
23
|
+
attr_accessor :message
|
|
24
|
+
|
|
25
|
+
# Number of secrets that were rotated
|
|
26
|
+
attr_accessor :rotated_count
|
|
27
|
+
|
|
28
|
+
attr_accessor :partial_errors
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'success' => :'success',
|
|
34
|
+
:'message' => :'message',
|
|
35
|
+
:'rotated_count' => :'rotatedCount',
|
|
36
|
+
:'partial_errors' => :'partialErrors'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'success' => :'Boolean',
|
|
54
|
+
:'message' => :'String',
|
|
55
|
+
:'rotated_count' => :'Integer',
|
|
56
|
+
:'partial_errors' => :'Array<String>'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'partial_errors'
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::KeyRotationResponse` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::KeyRotationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'success')
|
|
84
|
+
self.success = attributes[:'success']
|
|
85
|
+
else
|
|
86
|
+
self.success = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'message')
|
|
90
|
+
self.message = attributes[:'message']
|
|
91
|
+
else
|
|
92
|
+
self.message = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'rotated_count')
|
|
96
|
+
self.rotated_count = attributes[:'rotated_count']
|
|
97
|
+
else
|
|
98
|
+
self.rotated_count = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'partial_errors')
|
|
102
|
+
if (value = attributes[:'partial_errors']).is_a?(Array)
|
|
103
|
+
self.partial_errors = value
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if @success.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @message.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @rotated_count.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "rotated_count", rotated_count cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
invalid_properties
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Check to see if the all the properties in the model are valid
|
|
129
|
+
# @return true if the model is valid
|
|
130
|
+
def valid?
|
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
return false if @success.nil?
|
|
133
|
+
return false if @message.nil?
|
|
134
|
+
return false if @rotated_count.nil?
|
|
135
|
+
true
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Custom attribute writer method with validation
|
|
139
|
+
# @param [Object] success Value to be assigned
|
|
140
|
+
def success=(success)
|
|
141
|
+
if success.nil?
|
|
142
|
+
fail ArgumentError, 'success cannot be nil'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@success = success
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method with validation
|
|
149
|
+
# @param [Object] message Value to be assigned
|
|
150
|
+
def message=(message)
|
|
151
|
+
if message.nil?
|
|
152
|
+
fail ArgumentError, 'message cannot be nil'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
@message = message
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Custom attribute writer method with validation
|
|
159
|
+
# @param [Object] rotated_count Value to be assigned
|
|
160
|
+
def rotated_count=(rotated_count)
|
|
161
|
+
if rotated_count.nil?
|
|
162
|
+
fail ArgumentError, 'rotated_count cannot be nil'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
@rotated_count = rotated_count
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Checks equality by comparing each attribute.
|
|
169
|
+
# @param [Object] Object to be compared
|
|
170
|
+
def ==(o)
|
|
171
|
+
return true if self.equal?(o)
|
|
172
|
+
self.class == o.class &&
|
|
173
|
+
success == o.success &&
|
|
174
|
+
message == o.message &&
|
|
175
|
+
rotated_count == o.rotated_count &&
|
|
176
|
+
partial_errors == o.partial_errors
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# @see the `==` method
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def eql?(o)
|
|
182
|
+
self == o
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Calculates hash code according to all attributes.
|
|
186
|
+
# @return [Integer] Hash code
|
|
187
|
+
def hash
|
|
188
|
+
[success, message, rotated_count, partial_errors].hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Builds the object from hash
|
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
193
|
+
# @return [Object] Returns the model itself
|
|
194
|
+
def self.build_from_hash(attributes)
|
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
|
196
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
197
|
+
transformed_hash = {}
|
|
198
|
+
openapi_types.each_pair do |key, type|
|
|
199
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = nil
|
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
202
|
+
# check to ensure the input is an array given that the attribute
|
|
203
|
+
# is documented as an array but the input is not
|
|
204
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
205
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
206
|
+
end
|
|
207
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
new(transformed_hash)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the object in the form of hash
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_hash
|
|
217
|
+
hash = {}
|
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
219
|
+
value = self.send(attr)
|
|
220
|
+
if value.nil?
|
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
hash[param] = _to_hash(value)
|
|
226
|
+
end
|
|
227
|
+
hash
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
@@ -31,6 +31,8 @@ module FactPulse
|
|
|
31
31
|
|
|
32
32
|
attr_accessor :oauth_client_id
|
|
33
33
|
|
|
34
|
+
attr_accessor :encryption_mode
|
|
35
|
+
|
|
34
36
|
attr_accessor :secret_status
|
|
35
37
|
|
|
36
38
|
attr_accessor :last_test_at
|
|
@@ -55,6 +57,7 @@ module FactPulse
|
|
|
55
57
|
:'flow_service_url' => :'flowServiceUrl',
|
|
56
58
|
:'token_url' => :'tokenUrl',
|
|
57
59
|
:'oauth_client_id' => :'oauthClientId',
|
|
60
|
+
:'encryption_mode' => :'encryptionMode',
|
|
58
61
|
:'secret_status' => :'secretStatus',
|
|
59
62
|
:'last_test_at' => :'lastTestAt',
|
|
60
63
|
:'last_test_success' => :'lastTestSuccess',
|
|
@@ -85,6 +88,7 @@ module FactPulse
|
|
|
85
88
|
:'flow_service_url' => :'String',
|
|
86
89
|
:'token_url' => :'String',
|
|
87
90
|
:'oauth_client_id' => :'String',
|
|
91
|
+
:'encryption_mode' => :'String',
|
|
88
92
|
:'secret_status' => :'SecretStatus',
|
|
89
93
|
:'last_test_at' => :'Time',
|
|
90
94
|
:'last_test_success' => :'Boolean',
|
|
@@ -104,6 +108,7 @@ module FactPulse
|
|
|
104
108
|
:'flow_service_url',
|
|
105
109
|
:'token_url',
|
|
106
110
|
:'oauth_client_id',
|
|
111
|
+
:'encryption_mode',
|
|
107
112
|
:'secret_status',
|
|
108
113
|
:'last_test_at',
|
|
109
114
|
:'last_test_success',
|
|
@@ -160,6 +165,10 @@ module FactPulse
|
|
|
160
165
|
self.oauth_client_id = attributes[:'oauth_client_id']
|
|
161
166
|
end
|
|
162
167
|
|
|
168
|
+
if attributes.key?(:'encryption_mode')
|
|
169
|
+
self.encryption_mode = attributes[:'encryption_mode']
|
|
170
|
+
end
|
|
171
|
+
|
|
163
172
|
if attributes.key?(:'secret_status')
|
|
164
173
|
self.secret_status = attributes[:'secret_status']
|
|
165
174
|
end
|
|
@@ -231,6 +240,7 @@ module FactPulse
|
|
|
231
240
|
flow_service_url == o.flow_service_url &&
|
|
232
241
|
token_url == o.token_url &&
|
|
233
242
|
oauth_client_id == o.oauth_client_id &&
|
|
243
|
+
encryption_mode == o.encryption_mode &&
|
|
234
244
|
secret_status == o.secret_status &&
|
|
235
245
|
last_test_at == o.last_test_at &&
|
|
236
246
|
last_test_success == o.last_test_success &&
|
|
@@ -249,7 +259,7 @@ module FactPulse
|
|
|
249
259
|
# Calculates hash code according to all attributes.
|
|
250
260
|
# @return [Integer] Hash code
|
|
251
261
|
def hash
|
|
252
|
-
[is_configured, id, is_active, mode_sandbox, flow_service_url, token_url, oauth_client_id, secret_status, last_test_at, last_test_success, last_test_error, created_at, updated_at, message].hash
|
|
262
|
+
[is_configured, id, is_active, mode_sandbox, flow_service_url, token_url, oauth_client_id, encryption_mode, secret_status, last_test_at, last_test_success, last_test_error, created_at, updated_at, message].hash
|
|
253
263
|
end
|
|
254
264
|
|
|
255
265
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
|
-
# PDP configuration update request.
|
|
17
|
+
# PDP configuration update request. For encryption_mode='double', the X-Encryption-Key header must also be provided containing a base64-encoded AES-256 key (32 bytes).
|
|
18
18
|
class PDPConfigUpdateRequest < ApiModelBase
|
|
19
19
|
# Whether config is active
|
|
20
20
|
attr_accessor :is_active
|
|
@@ -34,6 +34,30 @@ module FactPulse
|
|
|
34
34
|
# OAuth Client Secret (sent but never returned)
|
|
35
35
|
attr_accessor :client_secret
|
|
36
36
|
|
|
37
|
+
attr_accessor :encryption_mode
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
37
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
62
|
def self.attribute_map
|
|
39
63
|
{
|
|
@@ -42,7 +66,8 @@ module FactPulse
|
|
|
42
66
|
:'flow_service_url' => :'flowServiceUrl',
|
|
43
67
|
:'token_url' => :'tokenUrl',
|
|
44
68
|
:'oauth_client_id' => :'oauthClientId',
|
|
45
|
-
:'client_secret' => :'clientSecret'
|
|
69
|
+
:'client_secret' => :'clientSecret',
|
|
70
|
+
:'encryption_mode' => :'encryptionMode'
|
|
46
71
|
}
|
|
47
72
|
end
|
|
48
73
|
|
|
@@ -64,13 +89,15 @@ module FactPulse
|
|
|
64
89
|
:'flow_service_url' => :'String',
|
|
65
90
|
:'token_url' => :'String',
|
|
66
91
|
:'oauth_client_id' => :'String',
|
|
67
|
-
:'client_secret' => :'String'
|
|
92
|
+
:'client_secret' => :'String',
|
|
93
|
+
:'encryption_mode' => :'String'
|
|
68
94
|
}
|
|
69
95
|
end
|
|
70
96
|
|
|
71
97
|
# List of attributes with nullable: true
|
|
72
98
|
def self.openapi_nullable
|
|
73
99
|
Set.new([
|
|
100
|
+
:'encryption_mode'
|
|
74
101
|
])
|
|
75
102
|
end
|
|
76
103
|
|
|
@@ -125,6 +152,10 @@ module FactPulse
|
|
|
125
152
|
else
|
|
126
153
|
self.client_secret = nil
|
|
127
154
|
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'encryption_mode')
|
|
157
|
+
self.encryption_mode = attributes[:'encryption_mode']
|
|
158
|
+
end
|
|
128
159
|
end
|
|
129
160
|
|
|
130
161
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -159,6 +190,8 @@ module FactPulse
|
|
|
159
190
|
return false if @token_url.nil?
|
|
160
191
|
return false if @oauth_client_id.nil?
|
|
161
192
|
return false if @client_secret.nil?
|
|
193
|
+
encryption_mode_validator = EnumAttributeValidator.new('String', ["fernet", "double"])
|
|
194
|
+
return false unless encryption_mode_validator.valid?(@encryption_mode)
|
|
162
195
|
true
|
|
163
196
|
end
|
|
164
197
|
|
|
@@ -202,6 +235,16 @@ module FactPulse
|
|
|
202
235
|
@client_secret = client_secret
|
|
203
236
|
end
|
|
204
237
|
|
|
238
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
239
|
+
# @param [Object] encryption_mode Object to be assigned
|
|
240
|
+
def encryption_mode=(encryption_mode)
|
|
241
|
+
validator = EnumAttributeValidator.new('String', ["fernet", "double"])
|
|
242
|
+
unless validator.valid?(encryption_mode)
|
|
243
|
+
fail ArgumentError, "invalid value for \"encryption_mode\", must be one of #{validator.allowable_values}."
|
|
244
|
+
end
|
|
245
|
+
@encryption_mode = encryption_mode
|
|
246
|
+
end
|
|
247
|
+
|
|
205
248
|
# Checks equality by comparing each attribute.
|
|
206
249
|
# @param [Object] Object to be compared
|
|
207
250
|
def ==(o)
|
|
@@ -212,7 +255,8 @@ module FactPulse
|
|
|
212
255
|
flow_service_url == o.flow_service_url &&
|
|
213
256
|
token_url == o.token_url &&
|
|
214
257
|
oauth_client_id == o.oauth_client_id &&
|
|
215
|
-
client_secret == o.client_secret
|
|
258
|
+
client_secret == o.client_secret &&
|
|
259
|
+
encryption_mode == o.encryption_mode
|
|
216
260
|
end
|
|
217
261
|
|
|
218
262
|
# @see the `==` method
|
|
@@ -224,7 +268,7 @@ module FactPulse
|
|
|
224
268
|
# Calculates hash code according to all attributes.
|
|
225
269
|
# @return [Integer] Hash code
|
|
226
270
|
def hash
|
|
227
|
-
[is_active, mode_sandbox, flow_service_url, token_url, oauth_client_id, client_secret].hash
|
|
271
|
+
[is_active, mode_sandbox, flow_service_url, token_url, oauth_client_id, client_secret, encryption_mode].hash
|
|
228
272
|
end
|
|
229
273
|
|
|
230
274
|
# Builds the object from hash
|