-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Issue: TIL PUT operation duplicates credentialsType entries instead of replacing claims (v0.10.0)
Description
In version 0.10.0 of the Trusted Issuers List (TIL), the handling of claims.path has changed.
- When executing a POST to register a new issuer, the issuer is stored correctly.
- When later executing a PUT with the same
credentialsType, instead of replacing the claims of thatcredentialsType, the TIL concatenates them, creating multiple objects with the samecredentialsType.
This results in inconsistent behavior: the verifier arbitrarily accepts or rejects verifications, depending on which duplicated claims are evaluated.
Steps to Reproduce
- Execute a POST to register an issuer with a
credentialsTypeand claims. - Execute a PUT with the same
credentialsTypebut a different set of claims. - Execute a GET and observe multiple entries with the same
credentialsType.
Expected Behavior
- The PUT request should replace the claims of the specified
credentialsType. - Each issuer should have only one object per
credentialsType.
Actual Behavior
- The PUT request concatenates the claims.
- Multiple objects with the same
credentialsTypeare created.
Example Requests and Result
POST request
curl -X POST "https://<til-service>/issuer" \
-H "Content-Type: application/json" \
-d '{
"did": "did:key:zExampleIssuerDID123456",
"credentials": [
{
"credentialsType": "LegalPersonCredential",
"claims": [
{
"name": "roles",
"path": "$.roles[*].names[*]",
"allowedValues": [
"SELLER",
"SERVICE-PROVIDER",
"ADMIN",
"POLICYMANAGER"
]
}
]
}
]
}'PUT request
curl -X PUT "https://<til-service>/issuer/did:key:zExampleIssuerDID123456" \
-H "Content-Type: application/json" \
-d '{
"did": "did:key:zExampleIssuerDID123456",
"credentials": [
{
"credentialsType": "LegalPersonCredential",
"claims": [
{
"name": "roles",
"path": "$.roles[*].names[*]",
"allowedValues": [
"POLICYMANAGER",
"SERVICE-PROVIDER",
"OPERATOR"
]
}
]
}
]
}'GET result
{
"did": "did:key:zExampleIssuerDID123456",
"credentials": [
{
"credentialsType": "LegalPersonCredential",
"claims": [
{
"name": "roles",
"path": "$.roles[*].names[*]",
"allowedValues": ["SELLER","SERVICE-PROVIDER","ADMIN","POLICYMANAGER"]
}
]
},
{
"credentialsType": "LegalPersonCredential",
"claims": [
{
"name": "roles",
"path": "$.roles[*].names[*]",
"allowedValues": ["POLICYMANAGER","SERVICE-PROVIDER","OPERATOR"]
}
]
},
{
"credentialsType": "LegalPersonCredential",
"claims": [
{
"name": "roles",
"path": "$.roles[*].names[*]",
"allowedValues": ["CONSUMER","DRIVER","SERVICE-PROVIDER","POLICYMANAGER"]
}
]
}
// ... repeated multiple times with the same credentialsType
]
}Impact
This duplication causes the verifier to behave unpredictably:
- Sometimes requests are accepted,
- Other times they are rejected,
depending on how the duplicated claims are evaluated.
Environment
- TIL version: 0.10.0
- Endpoint:
https://<til-service> - Reproduced consistently with POST → PUT → GET workflow
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels