Skip to content

Commit 4b1968f

Browse files
authored
fix validation bug for timestamp max validator. (#74)
Signed-off-by: morrieinmaas <moritz@animo.id>
1 parent 1362312 commit 4b1968f

File tree

5 files changed

+60
-73
lines changed

5 files changed

+60
-73
lines changed

aries_cloudcontroller/model/indy_non_revocation_interval.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ def __init__(
3636
**kwargs,
3737
)
3838

39-
@validator("from_")
40-
def from__max(cls, value):
41-
# Property is optional
42-
if value is None:
43-
return
44-
45-
if value > -1:
46-
raise ValueError(f"from_ must be less than -1, currently {value}")
47-
return value
48-
4939
@validator("from_")
5040
def from__min(cls, value):
5141
# Property is optional
@@ -56,16 +46,6 @@ def from__min(cls, value):
5646
raise ValueError(f"from_ must be greater than 0, currently {value}")
5747
return value
5848

59-
@validator("to")
60-
def to_max(cls, value):
61-
# Property is optional
62-
if value is None:
63-
return
64-
65-
if value > -1:
66-
raise ValueError(f"to must be less than -1, currently {value}")
67-
return value
68-
6949
@validator("to")
7050
def to_min(cls, value):
7151
# Property is optional

aries_cloudcontroller/model/indy_proof_identifier.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ def schema_id_pattern(cls, value):
8383
)
8484
return value
8585

86-
@validator("timestamp")
87-
def timestamp_max(cls, value):
88-
# Property is optional
89-
if value is None:
90-
return
91-
92-
if value > -1:
93-
raise ValueError(f"timestamp must be less than -1, currently {value}")
94-
return value
95-
9686
@validator("timestamp")
9787
def timestamp_min(cls, value):
9888
# Property is optional

aries_cloudcontroller/model/indy_requested_creds_requested_pred.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ def __init__(
3636
**kwargs,
3737
)
3838

39-
@validator("timestamp")
40-
def timestamp_max(cls, value):
41-
# Property is optional
42-
if value is None:
43-
return
44-
45-
if value > -1:
46-
raise ValueError(f"timestamp must be less than -1, currently {value}")
47-
return value
48-
4939
@validator("timestamp")
5040
def timestamp_min(cls, value):
5141
# Property is optional

generator/data/openapi.patch

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/generator/data/openapi.yml b/generator/data/openapi.yml
2-
index 81a975a..ab4c13c 100644
2+
index 81a975a..1a84edb 100644
33
--- a/generator/data/openapi.yml
44
+++ b/generator/data/openapi.yml
55
@@ -705,7 +705,9 @@ paths:
@@ -8,8 +8,8 @@ index 81a975a..ab4c13c 100644
88
schema:
99
- $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
1010
+ oneOf:
11-
+ - $ref: '#/components/schemas/CredentialDefinitionSendResult'
12-
+ - $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
11+
+ - $ref: '#/components/schemas/CredentialDefinitionSendResult'
12+
+ - $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
1313
x-codegen-request-body-name: body
1414
operationId: publish_cred_def
1515
/credential-definitions/created:
@@ -19,8 +19,8 @@ index 81a975a..ab4c13c 100644
1919
schema:
2020
- $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
2121
+ oneOf:
22-
+ - $ref: '#/components/schemas/PublishRevocations'
23-
+ - $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
22+
+ - $ref: '#/components/schemas/PublishRevocations'
23+
+ - $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
2424
x-codegen-request-body-name: body
2525
operationId: publish_revocations
2626
/revocation/registries/created:
@@ -30,8 +30,8 @@ index 81a975a..ab4c13c 100644
3030
schema:
3131
- $ref: '#/components/schemas/TxnOrRevRegResult'
3232
+ oneOf:
33-
+ - $ref: '#/components/schemas/RevRegResult'
34-
+ - $ref: '#/components/schemas/TxnOrRevRegResult'
33+
+ - $ref: '#/components/schemas/RevRegResult'
34+
+ - $ref: '#/components/schemas/TxnOrRevRegResult'
3535
operationId: publish_rev_reg_def
3636
/revocation/registry/{rev_reg_id}/entry:
3737
post:
@@ -41,8 +41,8 @@ index 81a975a..ab4c13c 100644
4141
schema:
4242
- $ref: '#/components/schemas/TxnOrSchemaSendResult'
4343
+ oneOf:
44-
+ - $ref: '#/components/schemas/SchemaSendResult'
45-
+ - $ref: '#/components/schemas/TxnOrSchemaSendResult'
44+
+ - $ref: '#/components/schemas/SchemaSendResult'
45+
+ - $ref: '#/components/schemas/TxnOrSchemaSendResult'
4646
x-codegen-request-body-name: body
4747
operationId: publish_schema
4848
/schemas/created:
@@ -52,7 +52,7 @@ index 81a975a..ab4c13c 100644
5252
type:
5353
- type: object
5454
+ enum:
55-
+ - CL
55+
+ - CL
5656
description: 'Signature type: CL for Camenisch-Lysyanskaya'
5757
example: CL
5858
value:
@@ -65,7 +65,30 @@ index 81a975a..ab4c13c 100644
6565
properties:
6666
credential_definition_id:
6767
pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$
68-
@@ -6111,18 +6122,14 @@ components:
68+
@@ -5861,14 +5872,12 @@ components:
69+
type: object
70+
properties:
71+
from:
72+
- maximum: 18446744073709551615
73+
minimum: 0
74+
type: integer
75+
description: Earliest time of interest in non-revocation interval
76+
format: int32
77+
example: 1640995199
78+
to:
79+
- maximum: 18446744073709551615
80+
minimum: 0
81+
type: integer
82+
description: Latest time of interest in non-revocation interval
83+
@@ -6030,7 +6039,6 @@ components:
84+
description: Schema identifier
85+
example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0
86+
timestamp:
87+
- maximum: 18446744073709551615
88+
minimum: 0
89+
type: integer
90+
description: Timestamp epoch
91+
@@ -6111,18 +6119,14 @@ components:
6992
type: object
7093
properties:
7194
from:
@@ -84,7 +107,7 @@ index 81a975a..ab4c13c 100644
84107
example: 1640995199
85108
IndyProofReqPredSpec:
86109
required:
87-
@@ -6168,18 +6175,14 @@ components:
110+
@@ -6168,18 +6172,14 @@ components:
88111
type: object
89112
properties:
90113
from:
@@ -103,7 +126,7 @@ index 81a975a..ab4c13c 100644
103126
example: 1640995199
104127
IndyProofRequest:
105128
type: object
106-
@@ -6217,18 +6220,14 @@ components:
129+
@@ -6217,18 +6217,14 @@ components:
107130
type: object
108131
properties:
109132
from:
@@ -122,7 +145,15 @@ index 81a975a..ab4c13c 100644
122145
example: 1640995199
123146
IndyProofRequestedProof:
124147
type: object
125-
@@ -7394,6 +7393,8 @@ components:
148+
@@ -6316,7 +6312,6 @@ components:
149+
a UUID)
150+
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
151+
timestamp:
152+
- maximum: 18446744073709551615
153+
minimum: 0
154+
type: integer
155+
description: Epoch timestamp of interest for non-revocation proof
156+
@@ -7394,6 +7389,8 @@ components:
126157
example: 0
127158
RevRegResult:
128159
type: object
@@ -131,15 +162,15 @@ index 81a975a..ab4c13c 100644
131162
properties:
132163
result:
133164
$ref: '#/components/schemas/IssuerRevRegRecord'
134-
@@ -7545,6 +7546,7 @@ components:
165+
@@ -7545,6 +7542,7 @@ components:
135166
SchemaSendResult:
136167
required:
137168
- schema_id
138169
+ - schema
139170
type: object
140171
properties:
141172
schema:
142-
@@ -7683,10 +7685,7 @@ components:
173+
@@ -7683,10 +7681,7 @@ components:
143174
mechanism:
144175
type: string
145176
time:
@@ -150,31 +181,31 @@ index 81a975a..ab4c13c 100644
150181
example: 1640995199
151182
TAAInfo:
152183
type: object
153-
@@ -7831,6 +7830,7 @@ components:
184+
@@ -7831,6 +7826,7 @@ components:
154185
example: 2021-12-31 23:59:59+00:00
155186
TxnOrCredentialDefinitionSendResult:
156187
type: object
157188
+ additionalProperties: false
158189
properties:
159190
sent:
160191
$ref: '#/components/schemas/CredentialDefinitionSendResult'
161-
@@ -7841,6 +7841,7 @@ components:
192+
@@ -7841,6 +7837,7 @@ components:
162193
- $ref: '#/components/schemas/TransactionRecord'
163194
TxnOrPublishRevocationsResult:
164195
type: object
165196
+ additionalProperties: false
166197
properties:
167198
sent:
168199
$ref: '#/components/schemas/PublishRevocations'
169-
@@ -7851,6 +7852,7 @@ components:
200+
@@ -7851,6 +7848,7 @@ components:
170201
- $ref: '#/components/schemas/TransactionRecord'
171202
TxnOrRevRegResult:
172203
type: object
173204
+ additionalProperties: false
174205
properties:
175206
sent:
176207
$ref: '#/components/schemas/RevRegResult'
177-
@@ -7861,6 +7863,7 @@ components:
208+
@@ -7861,6 +7859,7 @@ components:
178209
- $ref: '#/components/schemas/TransactionRecord'
179210
TxnOrSchemaSendResult:
180211
type: object

generator/data/openapi.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,8 @@ paths:
706706
application/json:
707707
schema:
708708
oneOf:
709-
- $ref: '#/components/schemas/CredentialDefinitionSendResult'
710-
- $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
709+
- $ref: '#/components/schemas/CredentialDefinitionSendResult'
710+
- $ref: '#/components/schemas/TxnOrCredentialDefinitionSendResult'
711711
x-codegen-request-body-name: body
712712
operationId: publish_cred_def
713713
/credential-definitions/created:
@@ -3325,8 +3325,8 @@ paths:
33253325
application/json:
33263326
schema:
33273327
oneOf:
3328-
- $ref: '#/components/schemas/PublishRevocations'
3329-
- $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
3328+
- $ref: '#/components/schemas/PublishRevocations'
3329+
- $ref: '#/components/schemas/TxnOrPublishRevocationsResult'
33303330
x-codegen-request-body-name: body
33313331
operationId: publish_revocations
33323332
/revocation/registries/created:
@@ -3438,8 +3438,8 @@ paths:
34383438
application/json:
34393439
schema:
34403440
oneOf:
3441-
- $ref: '#/components/schemas/RevRegResult'
3442-
- $ref: '#/components/schemas/TxnOrRevRegResult'
3441+
- $ref: '#/components/schemas/RevRegResult'
3442+
- $ref: '#/components/schemas/TxnOrRevRegResult'
34433443
operationId: publish_rev_reg_def
34443444
/revocation/registry/{rev_reg_id}/entry:
34453445
post:
@@ -3617,8 +3617,8 @@ paths:
36173617
application/json:
36183618
schema:
36193619
oneOf:
3620-
- $ref: '#/components/schemas/SchemaSendResult'
3621-
- $ref: '#/components/schemas/TxnOrSchemaSendResult'
3620+
- $ref: '#/components/schemas/SchemaSendResult'
3621+
- $ref: '#/components/schemas/TxnOrSchemaSendResult'
36223622
x-codegen-request-body-name: body
36233623
operationId: publish_schema
36243624
/schemas/created:
@@ -5054,7 +5054,7 @@ components:
50545054
example: tag
50555055
type:
50565056
enum:
5057-
- CL
5057+
- CL
50585058
description: 'Signature type: CL for Camenisch-Lysyanskaya'
50595059
example: CL
50605060
value:
@@ -5872,14 +5872,12 @@ components:
58725872
type: object
58735873
properties:
58745874
from:
5875-
maximum: 18446744073709551615
58765875
minimum: 0
58775876
type: integer
58785877
description: Earliest time of interest in non-revocation interval
58795878
format: int32
58805879
example: 1640995199
58815880
to:
5882-
maximum: 18446744073709551615
58835881
minimum: 0
58845882
type: integer
58855883
description: Latest time of interest in non-revocation interval
@@ -6041,7 +6039,6 @@ components:
60416039
description: Schema identifier
60426040
example: WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0
60436041
timestamp:
6044-
maximum: 18446744073709551615
60456042
minimum: 0
60466043
type: integer
60476044
description: Timestamp epoch
@@ -6315,7 +6312,6 @@ components:
63156312
a UUID)
63166313
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
63176314
timestamp:
6318-
maximum: 18446744073709551615
63196315
minimum: 0
63206316
type: integer
63216317
description: Epoch timestamp of interest for non-revocation proof

0 commit comments

Comments
 (0)