Scenario:
- as admin user create a custom license license like this:

(note there is no additional required user info)
- log-in as non-anonymous user and download file from the item with custom license above
- the License confirmation dialog contains no additional fields, except of the default ones - which is OK
- click "I AGREE" button
- the following request is sent to backend:
POST server/api/core/clarinusermetadata/manage?bitstreamUUID=09818a61-1ed8-4b7c-838a-5c45573b0ad9
and contains the payload:
[
{"type":{"value":"clarinusermetadata"},"metadataKey":"IP","metadataValue":"172.20.0.1"}
]
(so far OK)
- now in another window log-in as admin and update the license to contain required fields (e.g. User Name and Country)

- click save
- log-in as non-anonymous user (same as before) and download file from the same item again
- the License confirmation dialog contains User Name and Country fields, except of the default ones - which is OK
- fill in the required fields and click "I AGREE" button
- the following request is sent to backend:
POST server/api/core/clarinusermetadata/manage?bitstreamUUID=09818a61-1ed8-4b7c-838a-5c45573b0ad9
and contains the payload:
[
{"type":{"value":"clarinusermetadata"},"metadataKey":"NAME","metadataValue":"Milan"},
{"type": {"value":"clarinusermetadata"},"metadataKey":"COUNTRY","metadataValue":"CZ"},
{"type":{"value":"clarinusermetadata"},"metadataKey":"IP","metadataValue":"172.20.0.1"}
]
(so far ok)
- now, as admin user, edit the license again, and un-check additional required fields, click save
- log-in as non-anonymous user and download file from the same item again
- the License confirmation dialog contains no additional fields, except of the default ones - which is OK
- click "I AGREE" button
Now the payload is:
[
{"type":"clarinusermetadata","metadataKey":"COUNTRY","metadataValue":"CZ"},
{"type":"clarinusermetadata","metadataKey":"NAME","metadataValue":"Milan"},
{"type": {"value":"clarinusermetadata"},"metadataKey":"IP","metadataValue":"172.20.0.1"}
]
but it should be
[
{"type": {"value":"clarinusermetadata"},"metadataKey":"IP","metadataValue":"172.20.0.1"}
]
and the same invalid clarin user metadata are stored in user_metadata table which is wrong.
The
metadata are stored, rather than
Scenario:
POST server/api/core/clarinusermetadata/manage?bitstreamUUID=09818a61-1ed8-4b7c-838a-5c45573b0ad9and contains the payload:
(so far OK)
POST server/api/core/clarinusermetadata/manage?bitstreamUUID=09818a61-1ed8-4b7c-838a-5c45573b0ad9and contains the payload:
(so far ok)
Now the payload is:
but it should be
[
{"type": {"value":"clarinusermetadata"},"metadataKey":"IP","metadataValue":"172.20.0.1"}
]
and the same invalid clarin user metadata are stored in user_metadata table which is wrong.
The
metadata are stored, rather than