[OPENIDM-13948] embedded DJ explicit mapping does not allow empty valued properties Created: 16/Oct/19  Updated: 24/Mar/20  Resolved: 24/Mar/20

Status: Closed
Project: OpenIDM
Component/s: Module - Repository DS
Affects Version/s: 7.0.0
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Ladislav Folta Assignee: Jason Lemay
Resolution: Not a defect Votes: 0
Labels: LEWIS, regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OpenIDM: 7.0.0-SNAPSHOT 55394c2 with embedded_dj explicit mapping


Target Version/s:
Story Points: 1

 Description   

The gender attribute is defined as:

the attribute is defined as:
attributeTypes: ( 1.3.6.1.4.1.36733.2.3.1.520
  NAME 'fr-idm-gender'
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
  ORDERING caseIgnoreOrderingMatch
  X-ORIGIN 'OpenIDM DSRepoService' 

the mapping in repo.ds.json is:

                    "gender": {
                        "ldapAttribute": "fr-idm-gender",
                        "type": "simple"
                    },

When we try to create user with gender as empty string, the DS throws error.

curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"id": "ricksutter", "userName": "rsutter", "givenName": "rick", "sn": "sutter", "mail": "rick@example.com", "telephoneNumber": "6669876987", "password": "Th3Password", "description": "Just another user", "gender": ""}' --request PUT "http://localhost:8080/openidm/managed/user/ricksutter"

Response Content:
{"code":400,"reason":"Bad Request","message":"Invalid Attribute Syntax: Entry "uid=ricksutter,ou=user,ou=managed,dc=openidm,dc=forgerock,dc=com" contains a value "" for attribute fr-idm-gender that is invalid according to the syntax for that attribute: The operation attempted to assign a zero-length value to an attribute with the directory string syntax"}

With JDBC repos the test is green.

To run automated test:
config.cfg: repo_type = embedded_dj_explicit_table

./run-pybot.py -t scripted_action_can_update_property -s .on_managed_users -n openidm


Generated at Tue Nov 24 21:08:45 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.