Skip to content

Commit d7e3e59

Browse files
committed
fix: documentation
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent 6f32e6a commit d7e3e59

File tree

6 files changed

+60
-81
lines changed

6 files changed

+60
-81
lines changed

lib/Controller/AdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public function signerName(
531531
/**
532532
* Update certificate policy of this instance
533533
*
534-
* @return DataResponse<Http::STATUS_OK, array{status: 'success', url: string}, array{}>|DataResponse<Http::STATUS_UNPROCESSABLE_ENTITY, array{status: 'failure', message: string}, array{}>
534+
* @return DataResponse<Http::STATUS_OK, array{status: 'success', CPS: string}, array{}>|DataResponse<Http::STATUS_UNPROCESSABLE_ENTITY, array{status: 'failure', message: string}, array{}>
535535
*
536536
* 200: OK
537537
* 422: Not found

lib/ResponseDefinitions.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@
8181
* commonName: string,
8282
* names: LibresignRootCertificateName[],
8383
* }
84+
* @psalm-type LibresignPolicySection = array{
85+
* OID: string,
86+
* CPS: string,
87+
* }
8488
* @psalm-type LibresignEngineHandler = array{
8589
* configPath: string,
8690
* cfsslUri?: string,
87-
* policySection: array{
88-
* array{
89-
* OID: string,
90-
* CPS: string,
91-
* },
92-
* }|array{},
91+
* policySection: LibresignPolicySection[],
9392
* rootCert: LibresignRootCertificate,
9493
* }
9594
* @psalm-type LibresignCetificateDataGenerated = LibresignEngineHandler&array{

openapi-administration.json

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -142,34 +142,10 @@
142142
"type": "string"
143143
},
144144
"policySection": {
145-
"anyOf": [
146-
{
147-
"type": "object",
148-
"required": [
149-
null
150-
],
151-
"properties": {
152-
"": {
153-
"type": "object",
154-
"required": [
155-
"OID",
156-
"CPS"
157-
],
158-
"properties": {
159-
"OID": {
160-
"type": "string"
161-
},
162-
"CPS": {
163-
"type": "string"
164-
}
165-
}
166-
}
167-
}
168-
},
169-
{
170-
"type": "object"
171-
}
172-
]
145+
"type": "array",
146+
"items": {
147+
"$ref": "#/components/schemas/PolicySection"
148+
}
173149
},
174150
"rootCert": {
175151
"$ref": "#/components/schemas/RootCertificate"
@@ -200,6 +176,21 @@
200176
}
201177
}
202178
},
179+
"PolicySection": {
180+
"type": "object",
181+
"required": [
182+
"OID",
183+
"CPS"
184+
],
185+
"properties": {
186+
"OID": {
187+
"type": "string"
188+
},
189+
"CPS": {
190+
"type": "string"
191+
}
192+
}
193+
},
203194
"PublicCapabilities": {
204195
"type": "object",
205196
"properties": {
@@ -1833,7 +1824,7 @@
18331824
"type": "object",
18341825
"required": [
18351826
"status",
1836-
"url"
1827+
"CPS"
18371828
],
18381829
"properties": {
18391830
"status": {
@@ -1842,7 +1833,7 @@
18421833
"success"
18431834
]
18441835
},
1845-
"url": {
1836+
"CPS": {
18461837
"type": "string"
18471838
}
18481839
}

openapi-full.json

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -248,34 +248,10 @@
248248
"type": "string"
249249
},
250250
"policySection": {
251-
"anyOf": [
252-
{
253-
"type": "object",
254-
"required": [
255-
null
256-
],
257-
"properties": {
258-
"": {
259-
"type": "object",
260-
"required": [
261-
"OID",
262-
"CPS"
263-
],
264-
"properties": {
265-
"OID": {
266-
"type": "string"
267-
},
268-
"CPS": {
269-
"type": "string"
270-
}
271-
}
272-
}
273-
}
274-
},
275-
{
276-
"type": "object"
277-
}
278-
]
251+
"type": "array",
252+
"items": {
253+
"$ref": "#/components/schemas/PolicySection"
254+
}
279255
},
280256
"rootCert": {
281257
"$ref": "#/components/schemas/RootCertificate"
@@ -640,6 +616,21 @@
640616
}
641617
}
642618
},
619+
"PolicySection": {
620+
"type": "object",
621+
"required": [
622+
"OID",
623+
"CPS"
624+
],
625+
"properties": {
626+
"OID": {
627+
"type": "string"
628+
},
629+
"CPS": {
630+
"type": "string"
631+
}
632+
}
633+
},
643634
"PublicCapabilities": {
644635
"type": "object",
645636
"properties": {
@@ -9618,7 +9609,7 @@
96189609
"type": "object",
96199610
"required": [
96209611
"status",
9621-
"url"
9612+
"CPS"
96229613
],
96239614
"properties": {
96249615
"status": {
@@ -9627,7 +9618,7 @@
96279618
"success"
96289619
]
96299620
},
9630-
"url": {
9621+
"CPS": {
96319622
"type": "string"
96329623
}
96339624
}

src/types/openapi/openapi-administration.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,7 @@ export type components = {
302302
EngineHandler: {
303303
configPath: string;
304304
cfsslUri?: string;
305-
policySection: {
306-
""?: {
307-
OID: string;
308-
CPS: string;
309-
};
310-
} | Record<string, never>;
305+
policySection: components["schemas"]["PolicySection"][];
311306
rootCert: components["schemas"]["RootCertificate"];
312307
};
313308
OCSMeta: {
@@ -317,6 +312,10 @@ export type components = {
317312
totalitems?: string;
318313
itemsperpage?: string;
319314
};
315+
PolicySection: {
316+
OID: string;
317+
CPS: string;
318+
};
320319
PublicCapabilities: {
321320
libresign?: components["schemas"]["Capabilities"];
322321
};
@@ -981,7 +980,7 @@ export interface operations {
981980
data: {
982981
/** @enum {string} */
983982
status: "success";
984-
url: string;
983+
CPS: string;
985984
};
986985
};
987986
};

src/types/openapi/openapi-full.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,12 +1264,7 @@ export type components = {
12641264
EngineHandler: {
12651265
configPath: string;
12661266
cfsslUri?: string;
1267-
policySection: {
1268-
""?: {
1269-
OID: string;
1270-
CPS: string;
1271-
};
1272-
} | Record<string, never>;
1267+
policySection: components["schemas"]["PolicySection"][];
12731268
rootCert: components["schemas"]["RootCertificate"];
12741269
};
12751270
File: {
@@ -1374,6 +1369,10 @@ export type components = {
13741369
last: string | null;
13751370
first: string | null;
13761371
};
1372+
PolicySection: {
1373+
OID: string;
1374+
CPS: string;
1375+
};
13771376
PublicCapabilities: {
13781377
libresign?: components["schemas"]["Capabilities"];
13791378
};
@@ -5026,7 +5025,7 @@ export interface operations {
50265025
data: {
50275026
/** @enum {string} */
50285027
status: "success";
5029-
url: string;
5028+
CPS: string;
50305029
};
50315030
};
50325031
};

0 commit comments

Comments
 (0)