-
Notifications
You must be signed in to change notification settings - Fork 2
/
apnf-man-platform-openapi-gco.yaml
3954 lines (3830 loc) · 162 KB
/
apnf-man-platform-openapi-gco.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: APNF MAN Platform - GCO API Reference
version: 1.7.0
license:
name: CC-BY-SA-4.0
url: https://creativecommons.org/licenses/by-sa/4.0/legalcode
description: |
# Introduction
Welcome to the APNF MAN platform GCO (*Gestionnaire des Certificats Opérateurs*) API reference.
The APIs listed in this reference provide functionalities for service providers to create and
manage the STI certificates to be used for signing their SIP telephone calls per the STIR SHAKEN
protocol, along with functionalities to manage access to the MAN platform.
Each provider registered with the APNF may request an access to the MAN platform and therefore these APIs.
Note that these APIs are a subset of APIs published by the platform. You can refer to the *References*
at the end of this section to get a list of all API references published for the MAN platform.
## Authentication
All APIs listed in this document require the API client to be authenticated.
The authentication process relies on OAuth 2.0 protocol, where an access token needs
to be passed to the API request as a JSON Web TOKEN using the Bearer `Authorization` header.
```
Authorization: Bearer <JWT>
```
Refer to the *MAN Platform Authorization API Reference* on how to generate access tokens. Note that in order to
request an access token, you will first need to create an **API credential** as described in this reference.
## Requests & Headers
- A Bearer `Authorization` header is required, where the Bearer token shall be set with the access token generated by the MAN platform authorization API.
- A `X-Request-Id` header can be provided with an uuid. If provided, this header will be returned in the
`X-Response-Id` response header.
## Responses & Headers
Unless explicitly specified, all responses will use JSON for the response body format.
The `Content-Type` header will be included in all responses to make the type explicit.
Following headers are also included in responses:
- `Content-Type`: format of the response, if a body is included in the response.
- `Content-Length`: size in bytes of the response body, if a body is included in the response.
- `X-Response-Id`: uniquely identifies the response sent to the client. It corresponds to the `X-Request-Id`
request header if provided. Otherwise, a new value is generated,
- `X-Correlation-Id`: ID generated by the API gateway to track the request between the different services. This
value can be different from the `X-Response-Id` header.
## Dates
Unless specified, all dates exposed in this API comply with the ISO-8601 date format using UTC as the timezone.
## Common Error Codes
The following error codes can be returned:
| Error code | Description |
|:----------:|-------------------------------------------------------------------------|
| **400** | The request is malformed. |
| **401** | The authentication failed. |
| **403** | User is not allowed to access to the resource. |
| **404** | The resource does not exist. |
| **405** | The method is not allowed for the resource. |
| **406** | The format in the `Accept` header is not supported. |
| **409** | There is a conflict between the object status and the action requested |
| **415** | The format in the `Content-Type` header is not supported. |
| **429** | Too many requests have been sent by the client (see Rate Limiting). |
| **500** | An unexpected error occurred while processing the request. |
| **503** | The service is unavailable. |
## Rate Limiting
To ensure availability to all clients, concurrent accesses to this API are restricted per
below rate limiting logic:
- Each IP address is allowed to perform up to 600 calls during a period of 1 minute.
- The `GET /bpco/certificates` API method has an additional restriction, limiting calls to 1 per minute.
- Any additional call will be rejected by the API using a 429 "TOO_MANY_REQUESTS" error code
# References
Additional API references are also available, covering other functionalities:
- **MAN Platform API Reference**, covering all APIs published by the platform, including the GCO API methods presented in this reference.
- **MAN Platform Authentication API Reference**, providing the APIs to create access tokens require to authenticate against the APIs listed in this document.
- **MAN Platform BPCO API Reference**, listing APIs published as part of the BPCO (Base Publique des Certificats Opérateurs), the MAN platform public access service used to access STI certificates.
# History
**1.7.0** - 2024/09/09
- (Certificates) Add `INVALIDATION` status to be used during CA compromission
- (Certificates) New API method - GET /certificates/export
- (Providers) GET /providers/{provider_id}/bypass_token - Rename response from `records` to `bypass_tokens`
- (Providers) Cleanup provider unused examples and schemas
- (Providers) Remove users and history API methods as available as part of the **MAN Platform API Reference** document.
**1.6.0** - 2023/12/13
- (Certificates) PATCH /certificates/{certificate_id} - Add constraints for expired certificates
- (Certificates) POST /certificates/{certificate_id} - Add 409 HTTP status case
- (Certificates) GET /certificates/export - New endpoint to export certificates as CSV
- (Providers) GET /providers/{provider_id} - New `legal_administrator` property to provide provider current legal administrator user.
- (Providers) GET /providers - Removed `verified`, `verified_at` and `verified_status` filters as never implemented
- (Providers) GET /providers/{provider_id}/bypass_token - Add 415 HTTP status case
- (Providers) PATCH /providers/{provider_id} - New `legal_administrator` property to change provider legal administrator user
- (Providers) PATCH /providers/{provider_id} - Allow `opts_contracts` property to be edited by MANAGER users
- (Providers) Add `BypassTokenId` schema
- (Providers) Update `BypassToken` schema to add `BypassTokenId` reference and specify required properties
- (Providers) Update `bypass_token` property in `Provider` schema
- (Providers) Remove `domains_allowed` mentions from `ProviderCreationRequest` schema and examples as property has been removed since 1.3.0 release
- (Providers) Updated `ProviderDetails` schema to add `deposit_notification_list` property and remove `last_verification` property
- (Users) GET /users - Add `created_at`, `updated_at` and `last_connected_at` properties to `UserSummaryView` schema
- (Users) GET /users - Grant API method access to the MANAGER role.
- (Users) GET /users/{user_id} - Grant API method access to the MANAGER role.
- (Users) GET /users/{user_id} - New `legal_administrator ` to see if user is legal administrator.
- (Users) POST /users – Allow APNF administrators to create provider administrator users
- (Users) PATCH /users - Allow APNF administrators to update the role of any provider user.
- (Users) POST /users/reset-credential - Rename original reset-password to enhance functionality by adding reset of OTP and resend new link of account activation.
- (BPCO) GET /bpco/certificates - Add missing `Content-Length` response header
- (Description) Fix spelling error in 'Rate limiting'
**1.5.0** - 2023/09/27
- Include in `Description` section rate limiting logic
- Add CC-BY-SA-4.0 license
**1.4.0** - 2023/06/27
- (Providers) POST /providers/{provider_id}/bypass_token - Add new API to generate a new provider bypass token
- (Providers) GET /providers/{provider_id}/bypass_token - Add new API to retrieve bypass tokens generated by the provider
- (Providers) GET /providers/{provider_id} - Add `bypass_token` property in Provider schema
**1.3.0** - 2023/06/16
- Add `servers` entries for VABF and Preproduction platforms
- (Certificates) Clarify `renewal_after` property usage
- (Certificates) Clarify `valid_to` constraints
- (Providers) Deprecate `domains_allowed` property
- (Providers) `technical_number` property cannot be edited by provider administrators
**1.2.0** - 2023/05/04
- (All) Remove `Content-Length` header for 204 and 304 responses
- (All) Update error message for 401 HTTP responses
- (All) Add 405 HTTP status case + update error message
- (All) Use different ID values depending on the object type
- (Certificates) Add new status `INVALID`
- (POST /certificates/) Add `updated_at`, `updated_by` properties to response examples
- (POST /certificates) Add `Location` header in responses
- (POST /certificates/) Test certificates cannot have the `renewal_auto` property enabled.
- (PATCH /certificates/{certificate_id}) Test certificates cannot have the `renewal_auto` property enabled.
- (POST /certificates/{certificate_id}/renew) Add constraints for revoked and invalid certificates
- (POST /certificates/{certificate_id}/renew) Test certificates cannot have the `renewal_auto` property enabled.
- (POST /certificates/{certificate_id}/renew) Clarify valid_from/valid_to property constraints
- (POST /certificates/{certificate_id}/renew) Add 409 HTTP status case for revoked certificates
- (POST /certificates/{certificate_id}/renew) Add `Location` header in responses
- (POST /certificates/{certificate_id}/revoke) Add constraints for expired, revoked and invalid certificates
- (HEAD /bpco/certificates) Remove `Content-Length` response header and body
- (GET /bpco/certificates) Add `Content-Type` header for 304 HTTP status case
- (HEAD /bpco/crl) Remove `Content-Length` response header and body
- (GET /bpco/crl) Add `Content-Type` header for 304 HTTP status case
- (Providers) New `deposit_notification_list` property in Provider object
- (Providers) Improve `domains_allowed` property description for `ProviderCreationRequest` example
- (Providers) Allow `opts_contracts` property to be edited by *ADMINISTRATOR* users
- (Users) New `/users/{user_id}/preferences` method
- (Users) Remove `/user/activate` method
**1.1.0** - 2023/01/18
- Update base URL from *https://man-plateforme.fr/api/* to *https://api.man-plateforme.fr/*
- Update BPCO API URLs from *https://man-bpco.fr/* to *https://api.man-bpco.fr/*
- Change `Certificate` component schema to change `revoked_at` property format from `integer` to `string`
- Update certificate serial number schema pattern
- Cleanup `ProviderOIDCSettings` component schema
servers:
- url: https://api.man-plateforme.fr/
description: Production platform
- url: https://api.pprod.man-plateforme.fr/
description: Preproduction platform
- url: https://api.vabf.man-plateforme.fr/
description: VABF platform
tags:
- name: Providers
description: |
Service provider registration, authorization and data management APIs.
While most of these APIs can only be accessed by the MAN platform administrators
to create and authorize service providers, these latter have access to a subset
for updating their organization settings and reviewing their authorization status & history.
- name: STI Certificates
description: |
STI certificates creation and management APIs.
These APIs provide to service providers a full control of their STI certificates, with
support of functionalities like certificate renewal, revocation and delegation.
- name: History
description: |
Platform activity logs access and search APIs.
These APIs give service providers a way to have access and review actions performed by their users
within the platform.
- name: STI Certificates (Archived)
description: |
STI certificates access APIs.
3 months after their expiration, STI certificates are automatically archived by the platform
and removed from the list of certificates. For tracking and forensics purposes, they however remain
available for 3 years in a dedicated list, after which they are deleted
once for all from the platform.
These APIs just provide read-only access; no updates are allowed on certificates once archived.
- name: BPCO
description: |
APIs related to BPCO (Base Publique des Certificats Opérateurs), the MAN platform public access
service to STI certificates.
These APIs provide access to metadata and download facilities to objects
published in the BPCO, like STI certificates and CRLs.
paths:
/providers/{provider_id}:
get:
summary: Return provider details
description: |
Return a JSON object with provider details.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*, *SUPERVISOR*
- *ADMINISTRATOR*, *MANAGER* and *SUPERVISOR* users can only access details of their provider.
operationId: GetProvider
tags:
- Providers
parameters:
- $ref: '#/components/parameters/ProviderId'
- $ref: '#/components/parameters/X-Request-Id'
responses:
'200':
description: Return a JSON object with provider details
content:
application/json:
schema:
$ref: '#/components/schemas/Provider'
examples:
Provider Details:
$ref: '#/components/examples/ProviderDetails'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
patch:
summary: Update provider properties
description: |
Update provider properties. Deleted providers cannot be updated.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*
- *ADMINISTRATOR* and *MANAGER* users can update properties of their own provider. Only a subset of the provider properties can be updated by these users.
operationId: UpdateProvider
tags:
- Providers
parameters:
- $ref: '#/components/parameters/ProviderId'
- $ref: '#/components/parameters/X-Request-Id'
requestBody:
required: true
description: |
A [JSON Merge Patch (RFC 7386)](https://datatracker.ietf.org/doc/html/rfc7386) containing only the properties
that must be updated (with the new value) or deleted (with null as value).
content:
application/merge-patch+json:
schema:
type: object
properties:
status:
type: string
description: |
Change the provider status. Only possible values are `ENABLED` and `DISABLED`.
- Only *MAN_ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
enum:
- ENABLED
- DISABLED
name:
type: string
maxLength: 64
description: |
Change the provider name
- Only *MAN_ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
example: Opérateur
address:
type: string
maxLength: 255
description: |
Change the provider HQ address
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
example: 30, rue de Paris 75018 Paris
technical_number:
type: string
maxLength: 15
description: |
Change the provider technical phone number
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
signatory:
type: boolean
description: |
Change the provider signatory flag
- Only *MAN_ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
default: true
opts:
type: string
description: |
Change the provider opts flag
- Only *MAN_ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
opts_contracts:
type: array
description: |
Change the list of providers allowed to select this provider as OPTS.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR*, *MANAGER* and *APNF* users can update this property
- Can be deleted.
items:
$ref: '#/components/schemas/ProviderCode'
legal_administrator:
description: |
UUID of the user account to change the provider legal administrator
$ref: '#/components/schemas/UUID'
global_notification_list:
description: |
Change the list of email addresses for the provider 'global' notification list.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: array
items:
$ref: '#/components/schemas/EmailAddress'
legal_notification_list:
description: |
Change the list of email addresses for the provider 'legal' notification list.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: array
items:
$ref: '#/components/schemas/EmailAddress'
certificate_notification_list:
description: |
Change the list of email addresses for the provider 'certificate' notification list.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: array
items:
$ref: '#/components/schemas/EmailAddress'
ticketing_notification_list:
description: |
Change the list of email addresses for the provider 'ticketing' notification list.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: array
items:
$ref: '#/components/schemas/EmailAddress'
deposit_notification_list:
description: |
Change the list of email addresses for the provider 'deposit' notification list.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: array
items:
$ref: '#/components/schemas/EmailAddress'
ticket_notification_active:
description: |
Change the flag to receive ticket notifications.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Can be deleted.
type: boolean
example: true
sftp_allowed_keys:
type: array
description: |
Change the SSH public keys allowed to access the platform SFTP service created for the provider.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- All values shall be passed when updating the property
- Can be deleted.
items:
type: string
maxLength: 1024
description: SSH public key contents
example: ssh-rsa AAAAB3NzaC...p5CSsDJ SI@host-4527
sftp_allowed_ips:
type: array
description: |
Change the list of IPv4 addresses to be allowed to connect to the SFTP BSM service.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- All values shall be passed when updating the property
- Can be deleted.
items:
type: string
description: IPv4 address
format: ipv4
pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$
example: 127.0.0.1
languages:
type: array
description: |
Change the list of languages to be proposed to the provider users for the platform UI.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- All values shall be passed when updating the property
- Cannot be deleted.
items:
$ref: '#/components/schemas/Language'
example:
- FRENCH
- ENGLISH
authentication_mode:
type: string
description: |
Change the mode to be used to authenticate provider user accounts.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- Cannot be deleted.
enum:
- SSO
- MFA
default: MFA
example: SSO
sso_settings:
type: object
description: |
Change the Single Sign-On configuration.
- *MAN_ADMINISTRATOR*, *ADMINISTRATOR* and *APNF* users can update this property
- To be used only when `authentication_mode` is set to `SSO`.
- All values shall be passed when updating the property
examples:
ProviderUpdateRequestByManAdministrator:
$ref: '#/components/examples/ProviderUpdateRequestByManAdministrator'
ProviderUpdateRequestByAdministrator:
$ref: '#/components/examples/ProviderUpdateRequestByAdministrator'
responses:
'200':
description: Confirms successful processing and return the provider properties in the response.
content:
application/json:
schema:
$ref: '#/components/schemas/Provider'
examples:
Successful response with provider properties:
$ref: '#/components/examples/ProviderDetails'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'415':
$ref: '#/components/responses/ErrorInvalidContentType'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/providers/{provider_id}/bypass_token:
get:
summary: Retrieve a paginated list of bypass tokens created for the provider.
description: |
The API applies any sort preferences passed to the API request and returns a paginated list of corresponding results.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*, *SUPERVISOR*
operationId: ListProviderBypassTokens
tags:
- Providers
parameters:
- $ref: '#/components/parameters/ProviderId'
- $ref: '#/components/parameters/PaginationLimit'
- $ref: '#/components/parameters/PaginationOffset'
- $ref: '#/components/parameters/X-Request-Id'
responses:
'200':
description: Return a list of bypass tokens
content:
application/json:
schema:
type: object
properties:
metadata:
$ref: '#/components/schemas/PaginationMetaData'
bypass_tokens:
type: array
items:
$ref: '#/components/schemas/BypassToken'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'404':
$ref: '#/components/responses/ErrorNotFound'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'415':
$ref: '#/components/responses/ErrorInvalidContentType'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
post:
summary: Generate new provider bypass token
description: |
Create a new provider bypass token. The previous token will be archived.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*
- *ADMINISTRATOR*, *MANAGER* can generate bypass token for their own provider.
operationId: GenerateProviderBypassToken
tags:
- Providers
parameters:
- $ref: '#/components/parameters/ProviderId'
- $ref: '#/components/parameters/X-Request-Id'
responses:
'200':
description: Return a JSON object with a single `id` property containing the bypass token value.
content:
application/json:
schema:
$ref: '#/components/schemas/BypassTokenCreationResponse'
examples:
Successful response with bypass token details:
$ref: '#/components/examples/BypassTokenCreationResponse'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'404':
$ref: '#/components/responses/ErrorNotFound'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'415':
$ref: '#/components/responses/ErrorInvalidContentType'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/certificates:
post:
summary: Initiate the creation of a STI certificate
description: |
Initiate the creation of a new certificate. Shall always be called by the origin signing service provider.
Two types of certificates can be created, for which the creation process will be different:
* Direct certificates (type = `DIRECT`) are used directly by the origin signing service provider
* Indirect certificates (type = `INDIRECT`) are requested by the origin signing service provider for a technical signing service provider (OPTS).
While the creation of direct certificates is fully handled by this API, the process for indirect certificates is composed of 2 stages:
* This API initiates the certificate request
* The OPTS shall then call the `POST /certificates/{certificate_id}` to finalize the creation of the
certificate.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*
- *ADMINISTRATOR* and *MANAGER* can initiate the creation of a new certificate only for its own provider.
operationId: CreateCertificate
tags:
- STI Certificates
parameters:
- $ref: '#/components/parameters/X-Request-Id'
requestBody:
description: Certificate details
required: true
content:
application/json:
schema:
type: object
required:
- name
- type
- valid_from
properties:
name:
type: string
maxLength: 64
description: Certificate name provided by the origin service provider.
example: Main Certificate
description:
type: string
maxLength: 1024
description: Additional information related to the certificate.
example: Description of the certificate.
type:
$ref: '#/components/schemas/CertificateType'
opts:
type: string
description: |
APNF code assigned to the technical service provider (OPTS).
Required if `type` is `INDIRECT`.
Otherwise shall not be specified.
pattern: ^([0-9A-Z]{6})$
example: SPB000
csr:
type: string
maxLength: 2048
description: |
Contents of the CSR file used to create this certificate. Format of the contents is PEM.
Required if `type` is `DIRECT`.
Otherwise shall not be specified.
example: |
-----BEGIN CERTIFICATE REQUEST-----
MIIBEjCBuQIBADBXMRYwFAYDVQQDDA1TSEFLRU4gT1BDMDAwMQswCQYDVQQGEwJG
UjEVMBMGA1UECgwMT3DDg8KpcmF0ZXVyMRkwFwYDVQQLDBBTZXJ2aWNlIFByb3Zp
ZGVyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2qw/qQeNfCytgqjIETfjmVEw
7R7PrKZFaHLhaOxJabV1BN/AGp0Shm5f/pOZ19S9GVT0ULplSrl9+QrrpKLwjKAA
MAoGCCqGSM49BAMCA0gAMEUCIADk95rHd2LAI6vCuz8OjqlA9FJAWC1j/QcK8HSb
mMWkAiEAsVc1L/LvTKlEI98lsfDmCtKsJuQ4iBBuZ5Hzp0T1Xr8=
-----END CERTIFICATE REQUEST-----
test_certificate:
type: boolean
description: Is this a test certificate?
default: false
example: false
valid_from:
type: string
description: |
Certificate validity start date. Date shall be in ISO-8601 format.
Unless `test_certificate` is set to `true`, the date shall be at least one week in the future.
format: date-time
example: '2022-01-17T10:12:25Z'
valid_to:
type: string
description: |
Certificate expiration date. Date shall be in ISO-8601 format.
Required if `type` is `INDIRECT` or if `test_certificate` is set to `true`.
format: date-time
example: '2023-01-17T10:12:25Z'
renewal_auto:
type: boolean
description: |
Automated renewal option. Cannot be enabled for test certificates.
If enabled, the application will automatically create a new certificate
using the same CSR and options provided for this certificate.
See `renewal_after` option for defining when the renewal process shall be triggered.
default: false
example: true
renewal_after:
type: integer
description: |
Number of days to wait after certificate creation (or finalization for an indirect certificate)
for the automated certificate renewal process to be triggered.
Required if if `renewal_auto` is set to `true`.
Otherwise, shall not be specified.
example: 300
examples:
DirectCertificateRequest:
$ref: '#/components/examples/DirectCertificateRequest'
IndirectCertificateRequest:
$ref: '#/components/examples/IndirectCertificateRequest'
responses:
'201':
description: |
Confirms the creation of the new certificate and returns its details in the response.
This applies only to direct certificates.
content:
application/json:
schema:
$ref: '#/components/schemas/Certificate'
examples:
DirectCertificate:
$ref: '#/components/examples/DirectCertificate'
headers:
Location:
$ref: '#/components/headers/Location-Certificate'
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'202':
description: |
Confirms the indirect certificate creation request.
This applies only to indirect certificates.
content:
application/json:
schema:
$ref: '#/components/schemas/PendingIndirectCertificate'
examples:
PendingIndirectCertificate:
$ref: '#/components/examples/PendingIndirectCertificate'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'404':
$ref: '#/components/responses/ErrorNotFound'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'409':
description: Error returned when the provider has already too many active certificates.
content:
application/json:
schema:
type: object
required:
- code
properties:
code:
type: string
description: Error code. Shall be capitalized with underscore.
example: CONFLICT
message:
type: string
description: Message providing more details and context for error that occurred
example: Maximum number of active certificates has been reached.
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'415':
$ref: '#/components/responses/ErrorInvalidContentType'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
get:
summary: Retrieve a paginated list of records with support of sorting & filtering
description: |
The API applies any sort and filter preferences passed to the API request and returns a paginated list of
corresponding results.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*, *SUPERVISOR*
- *ADMINISTRATOR*, *MANAGER* and *SUPERVISOR* users can access any certificate attached to their provider.
operationId: SearchCertificates
tags:
- STI Certificates
parameters:
- name: query
in: query
description: |
Filter on a property following the format `operator:value`.
If the operator is `eq`, it can be ignored.
For string, number or date-time property:
* `eq` and `ne` = (not) equal.
* `in` and `not_in` = (not) in a list. `value` contains an array such as `[val1,val2,val3]`.
For string property only:
* `match` and `not_match` = (not) match the wildcard pattern (`*` for zero or more characters and `?` for a
single character) contains in `value`.
For number or date-time property:
* `gt` and `gte` = greater than (or equal).
* `lt` and `lte` = less than (or equal).
In any case, `value` must be percent encoded.
The parameter name is one of the following values:
- `id`
- `provider_id` (only for *MAN_ADMINISTRATOR* and *APNF* users)
- `type`
- `opts`
- `name`
- `valid_from`
- `valid_to`
- `test_certificate`
- `status`
- `renewal_auto`
- `renewal_after`
- `sn`
- `created_at`
- `updated_at`
- `revoked_at`
- `revoked_reason`
schema:
type: object
additionalProperties:
type: string
pattern: ^(((eq|ne|(not_)?match|[lg]te?):)?.+|(in|not_in):\[.+(,.+)*\])$
example:
provider_id: OPC000
created_at: gte:2022-01-01T00:00:00Z
- $ref: '#/components/parameters/PaginationLimit'
- $ref: '#/components/parameters/PaginationOffset'
- name: sort
in: query
description: |
Sort preference using the format `property_name:order`, where:
- `property_name` is one of the following values:
- `id`
- `provider_id` (only for *MAN_ADMINISTRATOR* and *APNF* users)
- `opts`
- `name`
- `valid_from`
- `valid_to`
- `status`
- `sn`
- `created_at`
- `updated_at`
- `revoked_at`
- `revoked_reason`
- `order` may be set to `asc` or `desc`.
schema:
type: string
pattern: ^(id|provider_id|type|opts|name|valid_(from|to)|test_certificate|url|status|renew(al_a(uto|fter)|ed_by)|sn|(cre|upd)ated_(at|by)|revoked_(at|by|reason)):(([Aa]|[Dd][Ee])[Ss][Cc])$
example: name:asc
- $ref: '#/components/parameters/X-Request-Id'
responses:
'200':
description: Return a paginated list of records
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
content:
application/json:
schema:
type: object
properties:
metadata:
$ref: '#/components/schemas/PaginationMetaData'
certificates:
type: array
items:
$ref: '#/components/schemas/CertificateSummaryView'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'415':
$ref: '#/components/responses/ErrorInvalidContentType'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
/certificates/{certificate_id}:
get:
summary: Return STI certificate details
description: |
Return a JSON object with STI certificate details and contents.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*, *SUPERVISOR*
- *ADMINISTRATOR*, *MANAGER* and *SUPERVISOR* users can access any certificate attached to their provider.
operationId: GetCertificate
tags:
- STI Certificates
parameters:
- $ref: '#/components/parameters/CertificateId'
- $ref: '#/components/parameters/X-Request-Id'
responses:
'200':
description: Return the JSON object with certificate properties and contents.
content:
application/json:
schema:
$ref: '#/components/schemas/Certificate'
examples:
DirectCertificate:
$ref: '#/components/examples/DirectCertificate'
PendingIndirectCertificate:
$ref: '#/components/examples/PendingIndirectCertificate'
IndirectCertificate:
$ref: '#/components/examples/IndirectCertificate'
headers:
Content-Length:
$ref: '#/components/headers/Content-Length'
X-Correlation-Id:
$ref: '#/components/headers/X-Correlation-Id'
X-Response-Id:
$ref: '#/components/headers/X-Response-Id'
'400':
$ref: '#/components/responses/ErrorValidation'
'401':
$ref: '#/components/responses/ErrorNotAuthenticated'
'403':
$ref: '#/components/responses/ErrorNoPermission'
'404':
$ref: '#/components/responses/ErrorNotFound'
'406':
$ref: '#/components/responses/ErrorInvalidAcceptHeader'
'429':
$ref: '#/components/responses/ErrorRateLimiting'
'500':
$ref: '#/components/responses/ErrorInternal'
'503':
$ref: '#/components/responses/ServiceUnavailable'
post:
summary: Finalize the creation of an indirect STI certificate
description: |
API called by the technical signing service provider (OPTS) to finalize the creation of indirect certificates.
Can only be called by the OPTS for which the indirect certificate has been requested for.
**Allowed Roles**: *ADMINISTRATOR*, *MANAGER*
- *ADMINISTRATOR*, *MANAGER* users can finalize any indirect certificate created for their provider.
operationId: FinalizeIndirectCertificate
tags:
- STI Certificates
parameters:
- $ref: '#/components/parameters/CertificateId'
- $ref: '#/components/parameters/X-Request-Id'
requestBody:
description: JSON object with certificate finalization options
required: true
content:
application/json:
schema:
type: object
required:
- csr
properties:
description:
type: string
maxLength: 1024
description: OPTS additional information for this certificate. Only available to the OPTS.
example: Description of the certificate.
csr:
type: string
maxLength: 2048
description: |
Contents of the CSR file used to create this certificate. Format of the contents is PEM.
example: |
-----BEGIN CERTIFICATE REQUEST-----
MIIBEjCBuQIBADBXMRYwFAYDVQQDDA1TSEFLRU4gT1BDMDAwMQswCQYDVQQGEwJG
UjEVMBMGA1UECgwMT3DDg8KpcmF0ZXVyMRkwFwYDVQQLDBBTZXJ2aWNlIFByb3Zp
ZGVyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2qw/qQeNfCytgqjIETfjmVEw
7R7PrKZFaHLhaOxJabV1BN/AGp0Shm5f/pOZ19S9GVT0ULplSrl9+QrrpKLwjKAA
MAoGCCqGSM49BAMCA0gAMEUCIADk95rHd2LAI6vCuz8OjqlA9FJAWC1j/QcK8HSb