Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiddenFields exposed in relationships #87

Open
basz opened this issue Oct 25, 2016 · 0 comments
Open

hiddenFields exposed in relationships #87

basz opened this issue Oct 25, 2016 · 0 comments

Comments

@basz
Copy link
Contributor

basz commented Oct 25, 2016

Given two DTO's (Identity and Preference) where Identity has a hidden field passwordHash.

I noticed that when I serialize the Identity DTO the passwordHash field is correctly hidden.

But when I serialize Preference with a relationship to to Identity the passwordHash is not hidden.

{
  "data": {
    "type": "identity/preference",
    "id": "212dca7d-87be-500f-a269-0ddef0757415",
    "attributes": {
      "name": "restriction.ip.enabled",
      "preference_id": "212dca7d-87be-500f-a269-0ddef0757415",
      "value": false
    },
    "relationships": {
      "identity": {
        "data": {
          "type": "identity/user",
          "id": "fff1324d-1383-5363-a6db-b9b7d2f856e9"
        }
      }
    }
  },
  "included": [
    {
      "type": "identity/user",
      "id": "fff1324d-1383-5363-a6db-b9b7d2f856e9",
      "attributes": {
        "passwordHash": "$2y$14$Q0xLWS....",
        "displayName": "Xxxxx Xx Xxx",
        "emailAddress": "xxxx@xxx.xxx",
        "registrationDate": "2012-12-20T13:41:29+0100",
        "emailStatus": "verified",
        "accountStatus": "active",
        "roles": [
          "guest",
          "member",
          "admin",
          "member.customer"
        ]
      }
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant