88
88
89
89
LOGGER = logging .getLogger (__name__ )
90
90
91
+ WALLET_TAG_TITLE = "wallet"
92
+ UPGRADE_TAG_TITLE = "AnonCreds - Wallet Upgrade"
93
+
91
94
92
95
class WalletModuleResponseSchema (OpenAPISchema ):
93
96
"""Response schema for Wallet Module."""
@@ -447,7 +450,7 @@ def format_did_info(info: DIDInfo):
447
450
}
448
451
449
452
450
- @docs (tags = ["wallet" ], summary = "List wallet DIDs" )
453
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "List wallet DIDs" )
451
454
@querystring_schema (DIDListQueryStringSchema ())
452
455
@response_schema (DIDListSchema , 200 , description = "" )
453
456
@tenant_authentication
@@ -553,7 +556,7 @@ async def wallet_did_list(request: web.BaseRequest):
553
556
return web .json_response ({"results" : results })
554
557
555
558
556
- @docs (tags = ["wallet" ], summary = "Create a local DID" )
559
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Create a local DID" )
557
560
@request_schema (DIDCreateSchema ())
558
561
@response_schema (DIDResultSchema , 200 , description = "" )
559
562
@tenant_authentication
@@ -680,7 +683,7 @@ async def wallet_create_did(request: web.BaseRequest):
680
683
return web .json_response ({"result" : format_did_info (info )})
681
684
682
685
683
- @docs (tags = ["wallet" ], summary = "Fetch the current public DID" )
686
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Fetch the current public DID" )
684
687
@response_schema (DIDResultSchema , 200 , description = "" )
685
688
@tenant_authentication
686
689
async def wallet_get_public_did (request : web .BaseRequest ):
@@ -707,7 +710,7 @@ async def wallet_get_public_did(request: web.BaseRequest):
707
710
return web .json_response ({"result" : format_did_info (info )})
708
711
709
712
710
- @docs (tags = ["wallet" ], summary = "Assign the current public DID" )
713
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Assign the current public DID" )
711
714
@querystring_schema (DIDQueryStringSchema ())
712
715
@querystring_schema (CreateAttribTxnForEndorserOptionSchema ())
713
716
@querystring_schema (AttribConnIdMatchInfoSchema ())
@@ -952,7 +955,10 @@ async def promote_wallet_public_did(
952
955
return info , attrib_def
953
956
954
957
955
- @docs (tags = ["wallet" ], summary = "Update endpoint in wallet and on ledger if posted to it" )
958
+ @docs (
959
+ tags = [WALLET_TAG_TITLE ],
960
+ summary = "Update endpoint in wallet and on ledger if posted to it" ,
961
+ )
956
962
@request_schema (DIDEndpointWithTypeSchema )
957
963
@querystring_schema (CreateAttribTxnForEndorserOptionSchema ())
958
964
@querystring_schema (AttribConnIdMatchInfoSchema ())
@@ -1083,7 +1089,7 @@ async def wallet_set_did_endpoint(request: web.BaseRequest):
1083
1089
return web .json_response ({"txn" : transaction .serialize ()})
1084
1090
1085
1091
1086
- @docs (tags = ["wallet" ], summary = "Create a jws using did keys with a given payload" )
1092
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Create a jws using did keys with a given payload" )
1087
1093
@request_schema (JWSCreateSchema )
1088
1094
@response_schema (WalletModuleResponseSchema (), description = "" )
1089
1095
@tenant_authentication
@@ -1121,7 +1127,10 @@ async def wallet_jwt_sign(request: web.BaseRequest):
1121
1127
return web .json_response (jws )
1122
1128
1123
1129
1124
- @docs (tags = ["wallet" ], summary = "Create an sd-jws using did keys with a given payload" )
1130
+ @docs (
1131
+ tags = [WALLET_TAG_TITLE ],
1132
+ summary = "Create an sd-jws using did keys with a given payload" ,
1133
+ )
1125
1134
@request_schema (SDJWSCreateSchema )
1126
1135
@response_schema (WalletModuleResponseSchema (), description = "" )
1127
1136
@tenant_authentication
@@ -1163,7 +1172,7 @@ async def wallet_sd_jwt_sign(request: web.BaseRequest):
1163
1172
return web .json_response (sd_jws )
1164
1173
1165
1174
1166
- @docs (tags = ["wallet" ], summary = "Verify a jws using did keys with a given JWS" )
1175
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Verify a jws using did keys with a given JWS" )
1167
1176
@request_schema (JWSVerifySchema ())
1168
1177
@response_schema (JWSVerifyResponseSchema (), 200 , description = "" )
1169
1178
@tenant_authentication
@@ -1204,7 +1213,7 @@ async def wallet_jwt_verify(request: web.BaseRequest):
1204
1213
1205
1214
1206
1215
@docs (
1207
- tags = ["wallet" ],
1216
+ tags = [WALLET_TAG_TITLE ],
1208
1217
summary = "Verify an sd-jws using did keys with a given SD-JWS with "
1209
1218
"optional key binding" ,
1210
1219
)
@@ -1239,7 +1248,7 @@ async def wallet_sd_jwt_verify(request: web.BaseRequest):
1239
1248
return web .json_response (result .serialize ())
1240
1249
1241
1250
1242
- @docs (tags = ["wallet" ], summary = "Query DID endpoint in wallet" )
1251
+ @docs (tags = [WALLET_TAG_TITLE ], summary = "Query DID endpoint in wallet" )
1243
1252
@querystring_schema (DIDQueryStringSchema ())
1244
1253
@response_schema (DIDEndpointSchema , 200 , description = "" )
1245
1254
@tenant_authentication
@@ -1273,7 +1282,9 @@ async def wallet_get_did_endpoint(request: web.BaseRequest):
1273
1282
return web .json_response ({"did" : did , "endpoint" : endpoint })
1274
1283
1275
1284
1276
- @docs (tags = ["wallet" ], summary = "Rotate keypair for a DID not posted to the ledger" )
1285
+ @docs (
1286
+ tags = [WALLET_TAG_TITLE ], summary = "Rotate keypair for a DID not posted to the ledger"
1287
+ )
1277
1288
@querystring_schema (DIDQueryStringSchema ())
1278
1289
@response_schema (WalletModuleResponseSchema (), description = "" )
1279
1290
@tenant_authentication
@@ -1329,11 +1340,9 @@ class UpgradeResultSchema(OpenAPISchema):
1329
1340
1330
1341
1331
1342
@docs (
1332
- tags = ["anoncreds - wallet upgrade" ],
1333
- summary = """
1334
- Upgrade the wallet from askar to anoncreds - Be very careful with this! You
1335
- cannot go back! See migration guide for more information.
1336
- """ ,
1343
+ tags = [UPGRADE_TAG_TITLE ],
1344
+ summary = "Upgrade the wallet from askar to askar-anoncreds. Be very careful with this!"
1345
+ " You cannot go back! See migration guide for more information." ,
1337
1346
)
1338
1347
@querystring_schema (UpgradeVerificationSchema ())
1339
1348
@response_schema (UpgradeResultSchema (), description = "" )
@@ -1484,7 +1493,7 @@ def post_process_routes(app: web.Application):
1484
1493
app ._state ["swagger_dict" ]["tags" ] = []
1485
1494
app ._state ["swagger_dict" ]["tags" ].append (
1486
1495
{
1487
- "name" : "wallet" ,
1496
+ "name" : WALLET_TAG_TITLE ,
1488
1497
"description" : "DID and tag policy management" ,
1489
1498
"externalDocs" : {
1490
1499
"description" : "Design" ,
@@ -1497,7 +1506,7 @@ def post_process_routes(app: web.Application):
1497
1506
)
1498
1507
app ._state ["swagger_dict" ]["tags" ].append (
1499
1508
{
1500
- "name" : "AnonCreds - Wallet Upgrade" ,
1509
+ "name" : UPGRADE_TAG_TITLE ,
1501
1510
"description" : "AnonCreds wallet upgrade" ,
1502
1511
"externalDocs" : {
1503
1512
"description" : "Specification" ,
0 commit comments