alastria / alastria-identity-JSON-objects

Alastria ID Model specification JSON objects verification
Apache License 2.0
1 stars 1 forks source link

proxyAddress is being checked for string whereas is needs to be checked for hex #54

Closed onmax closed 3 years ago

onmax commented 4 years ago

The proxyAddress in the validator is being checked for string (0-9a-zA-Z) but as far as I know proxyAddress is an hexadecimal value, so the regex should be 0-9a-fA-F. The code I am referring to is: https://github.com/alastria/alastria-identity-JSON-objects/blob/master/validators/did/index.js#L28

Also, as a side note, it will be also nice to check if proxyAddress is 40 characters long. Because the proxyAddress is 42 character long but we are not putting the 0x at the beggining. You can check the length of the proxyAddress here

VictorNS69 commented 4 years ago

As far as I know, the part of the proxy address in the DID should be a hexadecimal string (0-9 and a-f). what do you think @DrankoLQ @nmanero ?

onmax commented 4 years ago

Maybe this helps: https://github.com/alastria/alastria-identity-lib/blob/feature/issue-118-interfaces/src/tokenFactory/jwt/did.ts#L16

VictorNS69 commented 4 years ago

After talking with @carlospastormatut and reviewing the documentation, we can conclude that the proxy part of the DID will not have the 0x so the code here https://github.com/alastria/alastria-identity-JSON-objects/blob/master/validators/did/index.js#L28 is wrong.

VictorNS69 commented 4 years ago

We have updated the wiki https://github.com/alastria/alastria-identity/wiki/Alastria-DID-Method-Specification-(Quorum-version)#21-alastria-did-scheme