2929from ..anoncreds .routes import (
3030 create_transaction_for_endorser_description ,
3131 endorser_connection_id_description ,
32+ AnonCredsRevRegIdMatchInfoSchema ,
33+ AnoncredsRevocationModuleResponseSchema ,
3234)
3335from ..askar .profile_anon import AskarAnoncredsProfile
3436from ..indy .issuer import IndyIssuerError
4042from ..messaging .valid import (
4143 ANONCREDS_CRED_DEF_ID_EXAMPLE ,
4244 ANONCREDS_CRED_DEF_ID_VALIDATE ,
43- INDY_CRED_REV_ID_EXAMPLE ,
44- INDY_CRED_REV_ID_VALIDATE ,
45+ ANONCREDS_CRED_REV_ID_EXAMPLE ,
46+ ANONCREDS_CRED_REV_ID_VALIDATE ,
4547 ANONCREDS_REV_REG_ID_EXAMPLE ,
4648 ANONCREDS_REV_REG_ID_VALIDATE ,
4749 UUID4_EXAMPLE ,
6870TAG_TITLE = "anoncreds - revocation"
6971
7072
71- class RevocationAnoncredsModuleResponseSchema (OpenAPISchema ):
72- """Response schema for Revocation Module."""
73-
74-
7573class RevRegResultSchemaAnoncreds (OpenAPISchema ):
7674 """Result schema for revocation registry creation request."""
7775
@@ -107,10 +105,10 @@ def validate_fields(self, data, **kwargs):
107105 )
108106 cred_rev_id = fields .Str (
109107 required = False ,
110- validate = INDY_CRED_REV_ID_VALIDATE ,
108+ validate = ANONCREDS_CRED_REV_ID_VALIDATE ,
111109 metadata = {
112110 "description" : "Credential revocation identifier" ,
113- "example" : INDY_CRED_REV_ID_EXAMPLE ,
111+ "example" : ANONCREDS_CRED_REV_ID_EXAMPLE ,
114112 },
115113 )
116114 cred_ex_id = fields .Str (
@@ -279,19 +277,6 @@ class SetRevRegStateQueryStringSchema(OpenAPISchema):
279277 )
280278
281279
282- class RevRegIdMatchInfoSchema (OpenAPISchema ):
283- """Path parameters and validators for request taking rev reg id."""
284-
285- rev_reg_id = fields .Str (
286- required = True ,
287- validate = ANONCREDS_REV_REG_ID_VALIDATE ,
288- metadata = {
289- "description" : "Revocation Registry identifier" ,
290- "example" : ANONCREDS_REV_REG_ID_EXAMPLE ,
291- },
292- )
293-
294-
295280class RevocationCredDefIdMatchInfoSchema (OpenAPISchema ):
296281 """Path parameters and validators for request taking cred def id."""
297282
@@ -351,10 +336,10 @@ class PublishRevocationsSchemaAnoncreds(OpenAPISchema):
351336 keys = fields .Str (metadata = {"example" : ANONCREDS_REV_REG_ID_EXAMPLE }),
352337 values = fields .List (
353338 fields .Str (
354- validate = INDY_CRED_REV_ID_VALIDATE ,
339+ validate = ANONCREDS_CRED_REV_ID_VALIDATE ,
355340 metadata = {
356341 "description" : "Credential revocation identifier" ,
357- "example" : INDY_CRED_REV_ID_EXAMPLE ,
342+ "example" : ANONCREDS_CRED_REV_ID_EXAMPLE ,
358343 },
359344 )
360345 ),
@@ -371,10 +356,10 @@ class PublishRevocationsResultSchemaAnoncreds(OpenAPISchema):
371356 keys = fields .Str (metadata = {"example" : ANONCREDS_REV_REG_ID_EXAMPLE }),
372357 values = fields .List (
373358 fields .Str (
374- validate = INDY_CRED_REV_ID_VALIDATE ,
359+ validate = ANONCREDS_CRED_REV_ID_VALIDATE ,
375360 metadata = {
376361 "description" : "Credential revocation identifier" ,
377- "example" : INDY_CRED_REV_ID_EXAMPLE ,
362+ "example" : ANONCREDS_CRED_REV_ID_EXAMPLE ,
378363 },
379364 )
380365 ),
@@ -455,7 +440,7 @@ def validate_fields(self, data, **kwargs):
455440 summary = "Revoke an issued credential" ,
456441)
457442@request_schema (RevokeRequestSchemaAnoncreds ())
458- @response_schema (RevocationAnoncredsModuleResponseSchema (), description = "" )
443+ @response_schema (AnoncredsRevocationModuleResponseSchema (), description = "" )
459444@tenant_authentication
460445async def revoke (request : web .BaseRequest ):
461446 """Request handler for storing a credential revocation.
@@ -585,7 +570,7 @@ async def get_rev_regs(request: web.BaseRequest):
585570 tags = [TAG_TITLE ],
586571 summary = "Get revocation registry by revocation registry id" ,
587572)
588- @match_info_schema (RevRegIdMatchInfoSchema ())
573+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
589574@response_schema (RevRegResultSchemaAnoncreds (), 200 , description = "" )
590575@tenant_authentication
591576async def get_rev_reg (request : web .BaseRequest ):
@@ -723,7 +708,7 @@ async def rotate_rev_reg(request: web.BaseRequest):
723708 tags = [TAG_TITLE ],
724709 summary = "Get number of credentials issued against revocation registry" ,
725710)
726- @match_info_schema (RevRegIdMatchInfoSchema ())
711+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
727712@response_schema (RevRegIssuedResultSchemaAnoncreds (), 200 , description = "" )
728713@tenant_authentication
729714async def get_rev_reg_issued_count (request : web .BaseRequest ):
@@ -764,7 +749,7 @@ async def get_rev_reg_issued_count(request: web.BaseRequest):
764749 tags = [TAG_TITLE ],
765750 summary = "Get details of credentials issued against revocation registry" ,
766751)
767- @match_info_schema (RevRegIdMatchInfoSchema ())
752+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
768753@response_schema (CredRevRecordDetailsResultSchemaAnoncreds (), 200 , description = "" )
769754@tenant_authentication
770755async def get_rev_reg_issued (request : web .BaseRequest ):
@@ -806,7 +791,7 @@ async def get_rev_reg_issued(request: web.BaseRequest):
806791 tags = [TAG_TITLE ],
807792 summary = "Get details of revoked credentials from ledger" ,
808793)
809- @match_info_schema (RevRegIdMatchInfoSchema ())
794+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
810795@response_schema (CredRevIndyRecordsResultSchemaAnoncreds (), 200 , description = "" )
811796@tenant_authentication
812797async def get_rev_reg_indy_recs (request : web .BaseRequest ):
@@ -851,7 +836,7 @@ async def get_rev_reg_indy_recs(request: web.BaseRequest):
851836 tags = [TAG_TITLE ],
852837 summary = "Fix revocation state in wallet and return number of updated entries" ,
853838)
854- @match_info_schema (RevRegIdMatchInfoSchema ())
839+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
855840@querystring_schema (RevRegUpdateRequestMatchInfoSchema ())
856841@response_schema (RevRegWalletUpdatedResultSchemaAnoncreds (), 200 , description = "" )
857842@tenant_authentication
@@ -992,8 +977,8 @@ async def get_cred_rev_record(request: web.BaseRequest):
992977 summary = "Download tails file" ,
993978 produces = ["application/octet-stream" ],
994979)
995- @match_info_schema (RevRegIdMatchInfoSchema ())
996- @response_schema (RevocationAnoncredsModuleResponseSchema , description = "tails file" )
980+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
981+ @response_schema (AnoncredsRevocationModuleResponseSchema , description = "tails file" )
997982@tenant_authentication
998983async def get_tails_file (request : web .BaseRequest ) -> web .FileResponse :
999984 """Request handler to download tails file for revocation registry.
@@ -1030,7 +1015,7 @@ async def get_tails_file(request: web.BaseRequest) -> web.FileResponse:
10301015
10311016
10321017@docs (tags = [TAG_TITLE ], summary = "Set revocation registry state manually" )
1033- @match_info_schema (RevRegIdMatchInfoSchema ())
1018+ @match_info_schema (AnonCredsRevRegIdMatchInfoSchema ())
10341019@querystring_schema (SetRevRegStateQueryStringSchema ())
10351020@response_schema (RevRegResultSchemaAnoncreds (), 200 , description = "" )
10361021@tenant_authentication
0 commit comments