parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Parse S3 File Access with No Credentials

Open nkranes opened this issue 10 years ago • 13 comments

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

-[X] You've met the prerequisites.

-[X] You're running the latest version of Parse Server.

-[X] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

AWS, Parse 2.1.4, using S3 File Adapter

Steps to reproduce

Upload file through parse. Url is returned.

Hit new file through Parse (directAccess: false) with no credentials and it returns properly. I believe in previous versions this request required Parse credentials. Is this by design?

Logs/Trace

nkranes avatar Mar 04 '16 14:03 nkranes

@nkranes I think it is. I noticed that too.

Just out of curiosity where did you set the credentials for the S3Adaptor?. Im using a config JSON file to run with pm2 but cant seem to configure it now with 2.1.4.

Cliffordwh avatar Mar 04 '16 15:03 Cliffordwh

@Cliffordwh for now we don't have a support for those env variables :(

flovilmart avatar Mar 04 '16 15:03 flovilmart

@flovilmart OOOo makes sense. Where could i then hard code a quick fix to get it to work. in 2.1.3 i managed to just code it into /usr/bin/parse-server

Cliffordwh avatar Mar 04 '16 15:03 Cliffordwh

I'm on it!

flovilmart avatar Mar 04 '16 15:03 flovilmart

@Cliffordwh I don't use env vars. My config looks like:

var api = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/dev',
  cloud: {path}'
  appId: 'myAppId',
  masterKey: 'myMasterKey', // Keep this key secret!
  fileKey: 'optionalFileKey',
  serverURL: 'http://localhost:' + port, // Don't forget to change to https if needed
  allowClientClassCreation: 'false',
  filesAdapter: new S3Adapter(
    '{access_key}',
    '{secret_key}',
    '{bucket_name}',
    { directAccess: false}
  ),
});

nkranes avatar Mar 04 '16 15:03 nkranes

@nkranes Thanks. Was just informed it wont work yet with env.

Cliffordwh avatar Mar 04 '16 15:03 Cliffordwh

So @flovilmart , is open S3 file access through Parse intentionally open?

nkranes avatar Mar 04 '16 15:03 nkranes

@Cliffordwh - yeah, @flovilmart types faster than I do. :)

nkranes avatar Mar 04 '16 15:03 nkranes

@flovilmart Thanks for that. So is it safe to run "PARSE_SERVER_FILES_ADAPTER" : "S3Adapter", in my config with the other env's?

Cause that didnt work for me/.

Cliffordwh avatar Mar 04 '16 17:03 Cliffordwh

Hat would need to be the full path to the module I believe

flovilmart avatar Mar 04 '16 17:03 flovilmart

like parse-server/Adapters/Files/S3Adapter

flovilmart avatar Mar 04 '16 18:03 flovilmart

If I understand the issue correctly, this is the intended behavior of files. If you have a file URL, you have access to the file. This is also how it worked on Parse.com.

gfosco avatar Mar 06 '16 08:03 gfosco

@gfosco so there is no real difference between directAccess true or false. if the file url is known, the file is accessible. i am right?

chderen avatar Apr 05 '16 20:04 chderen