Skip to content

GetRoleMappings deserialisation exception if response includes array of dn strings #5270

Closed
@stevejgordon

Description

@stevejgordon

NEST/Elasticsearch.Net version: 7.10.1
Elasticsearch version: 7.10

Description of the problem including expected versus actual behavior:
When a role mapping contains an array of possible distinguished names, it causes a deserialisation error in NEST.

Steps to reproduce:

  1. Add the following role mapping to the Elasticsearch cluster by issuing:
PUT /_security/role_mapping/test%20admin%20role%20mapping
{
    "enabled" : true,
    "roles" : [
      "apm_user"
    ],
    "rules" : {
      "any" : [
        {
          "field" : {
            "dn" : [
	      "CN=Bloggs Joe abcdef01,OU=Users,OU=_Central,OU=S1000,OU=SG001,DC=ad001,DC=example,DC=net",
              "cn=bloggs joe abcdef02,ou=usersfunctional,ou=_central,ou=accadm,OU=SG001,DC=ad001,DC=example,DC=net"
            ]
          }
        }
      ]
    },
    "metadata" : { }
}
  1. Use NEST to get the role mappings
var client = new ElasticClient();
var resp = client.Security.GetRoleMapping();

Expected behavior
The response should be successfully deserialised.

** Actual behavior**
An UnexpectedElasticsearchClientException is throw in the deserialisation code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions