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

Parse-server does not flag manually created session as "restricted" #5047

Closed
reallyimeric opened this issue Sep 11, 2018 · 5 comments
Closed

Comments

@reallyimeric
Copy link
Contributor

Issue Description

Parse server did not created a restricted session as described on https://docs.parseplatform.org/rest/guide/#creating-sessions and https://docs.parseplatform.org/rest/guide/#session-properties

Steps to reproduce

curl -X POST \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-Session-Token: r:a161b67134500f0a822403746ddef79d" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/sessions

Expected Results

A session instance with restricted field set to true is created.

Actual Outcome

A session instance with restricted field set to false is created.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.0.0
    • Operating System: arch linux, with kernel 4.18.5, glibc 2.28 and nodejs 10.9.0
    • Hardware: x86, Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
  • Database

    • MongoDB version: mongodb 3.6.5 WiredTiger: 3.0.1: (January 8, 2018)
    • Storage engine: WiredTiger
    • Hardware: the same with server
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): the same with server

Logs/Trace

verbose: REQUEST for [POST] /parse/sessions: {} method=POST, url=/parse/sessions, host=localhost:1337, user-agent=curl/7.61.0, accept=*/*, x-parse-application-id=myAppId, x-parse-session-token=r:a161b67134500f0a822403746ddef79d, content-type=application/json, content-length=2,
verbose: RESPONSE from [POST] /parse/sessions: {
  "status": 201,
  "location": "http://localhost:1337/parse/classes/_Session/TSqPEESGyA",
  "response": {
    "sessionToken": "r:ab1c8b7336d14367f42f8aa90b7e32a4",
    "user": {
      "__type": "Pointer",
      "className": "_User",
      "objectId": "io4RhSnV2Z"
    },
    "createdWith": {
      "action": "create"
    },
    "restricted": false,
    "expiresAt": {
      "__type": "Date",
      "iso": "2019-09-11T00:30:30.972Z"
    },
    "objectId": "TSqPEESGyA"
  }
} status=201, location=http://localhost:1337/parse/classes/_Session/TSqPEESGyA, sessionToken=r:ab1c8b7336d14367f42f8aa90b7e32a4, __type=Pointer, className=_User, objectId=io4RhSnV2Z, action=create, restricted=false, __type=Date, iso=2019-09-11T00:30:30.972Z, objectId=TSqPEESGyA
@flovilmart
Copy link
Contributor

I’m not sure the restricted flag is in used anywhere anymore. Is it something you’d be willing to fix?

@reallyimeric
Copy link
Contributor Author

I'm a new guy to parse series and I have not met parse.com before. Maybe it's too hard for me to implement this. So is restricted session obsoleted by parse server?

@flovilmart
Copy link
Contributor

I don’t believe it’s in use nor that the restricted flag has any effect. Ensuring it’s set to false should be a good first task, to get to explore the code base.

@reallyimeric
Copy link
Contributor Author

Thanks for replying. I will avoid using this.

@flovilmart
Copy link
Contributor

There should be no issue with those sessions either. You don’t need to avoid them.

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

2 participants