josefnpat / vapor

Vapor - LÖVE Distribution Client
zlib License
77 stars 24 forks source link

User Accounts #200

Open Bobbyjoness opened 9 years ago

Bobbyjoness commented 9 years ago

I would like to see if I can add user account support to Vapor. But idk if I should code my own backend in lua or somehow try to use it with the official Vapor site/server. Also I would be attempting to add openssl and LuaSec.

pablomayobre commented 9 years ago

I dont think LuaSec is the way to go, I would prefere to use luajit-request a thousand times (at least with LÖVE)

Bobbyjoness commented 9 years ago

That's more binaries if I'm not mistaken. Luajit-request depends on openssl and libcurl

pablomayobre commented 9 years ago

In Windows that is one DLL file, in Linux that is one extra dependency (Not actually becaue for LuaSec you need LuaSec which depends on openssl, so it is actually the same) and MacOSX already has curl so no problem there (I think)

pablomayobre commented 9 years ago

About the real topic here (because we were actually discussing about #39 lol) this is also a 1.x milestone and not actually a 0.x milestone. So if you want to implement it in 0.x, do so in your own fork, but 1.x is a complete rewrite so it is possible that your code will not be included (at least without major changes)

Bobbyjoness commented 9 years ago

Majority of the work is backend. I'm basically using 0.x as a testing grounds for backend work if the things I want are approved and we decide how to do backend work. I'm thinking about doing user accounts on a lua or node server but do it as a RESTful api so the website can use it as well.

pablomayobre commented 9 years ago

Well you will have to host that yourself and then somehow integrate it with Drupal in the future, but I still think that the review will include MAJOR changes

Bobbyjoness commented 9 years ago

If its agreed on how to do it here. Then the lua/node account system can stay running independent of drupal. As I'm sure that drupal can use RESTful APIs for user accounts. It actually a good way to distribute the load

pablomayobre commented 9 years ago

Well then that is a different topic:

Bobbyjoness commented 9 years ago

Well for the first one I think that we can do a lot with user accounts but the simple things are messages, friends list, currently playing, better analytics based off of demographics, anything really but at first I would say that we need at least friend list and currently playing and a syncable favorite lists.

Bobbyjoness commented 9 years ago

And I just thought of a new issue.

pablomayobre commented 9 years ago

Well, I need to ask, is that all really needed? Are you considering the load all that means to the server? even more if Vapor becomes more and more accepted

Bobbyjoness commented 9 years ago

I can provide a server host for any of the components if it comes down to it. But in reality it should do fine on what we currently have for server hosting. The load would be not as much as you would think. Yeah more than it currently is but it wouldn't be that bad.

pablomayobre commented 9 years ago

Another question, isnt security a problem?

Bobbyjoness commented 9 years ago

Yeah but we have a community of web devs I'm sure we can figure it out. And if Vapor kicks off I'm sure we can figure out the server side stuff by then. I have some plans. A lot of plans. Lol this a good pet project no wonder leafo maintains itch.io

pablomayobre commented 9 years ago

I dont think this can be fixed, because there is no way to hide tokens or credentials for the client app so you could easily ask the server for all the data for an user... I guess this same applies to everything but it is, still, a problem

Bobbyjoness commented 9 years ago

What are you talking about? We can make it secure I don't understand the concern.

pablomayobre commented 9 years ago

Well I wonder about that, it is always a matter of opening the LÖVE file (or searching the github repo) to find the tokens and credentials needed to access the private API and with that you are a few requests away to dumping all the info of an user... So security is always a problem.

Anyway that is just a part of this... About the other stuff... Will this account be somewhat related to the forum account? There are private messages there and also friend lists...

Bobbyjoness commented 9 years ago

Credentials wouldn't be stored anywhere on the client machine. It would be entered each time.

pablomayobre commented 9 years ago

Yeah I know about that, I meant if the app was modified to try with multiple credentials (an actual attack)... Anyway that may be thinking too much about it for now...

What about the other thing I commented at the bottom?

Bobbyjoness commented 9 years ago

Being related to forum accounts would ultimately require more coordination with the Löve web devs and for us to get access to their database. I personally would not want that responsibility. An accidentally delete all would be sad.

pablomayobre commented 9 years ago

Yeah I thought the same hahaha... would be ultra nice though... (One account to rule them all)

Bobbyjoness commented 9 years ago

And the public generally don't have a love forums account

pablomayobre commented 9 years ago

The public generally doesnt have a Vapor account... so creating one or the other is pretty much the same...

Anyway If we go broader than LÖVE having an account in the LÖVE forums may be pointless

Bobbyjoness commented 9 years ago

They can make a Vapor account in app. Lol plus Vapor will have a lot more data and if we use love forums account we would need two databases for the data.

pablomayobre commented 9 years ago

In app registration sounds like lots of spam accounts to me... and bots and such...

Bobbyjoness commented 9 years ago

Ok now you just saying whatever lol. It's the same on websites lol.

pablomayobre commented 9 years ago

It is not, in a site you put a captcha and you have reduced this in a huge amount... in app you just modify the .love file and there you go... a million accounts in a second

Bobbyjoness commented 9 years ago

We can do a captcha as well.

josefnpat commented 9 years ago

Looking at this entire discussion, I can see the benefit of working Account Registration into the 1.x branch, but not much use in the 0.x branch due to it's design.

As @Positive07 mentioned, we really need to determine what we want to be included in the 1.x branch.

As for feature request from vapor.love2d.org I see:

IMO at this point there are not enough internet multiplayer games for love to entirely warrant this (considering I wrote xapalus, I say this with a heavy heart.) On the site I currently see:

Although with the inclusion of enet in love 0.9.x, it does show a lot of promise.

What may be interesting is if we integrated a service much like the classic Kali did.

For each of the feature requests mentioned earlier, a full API needs to be discussed and laid out before implementation to ensure:

a) Security b) Ease of integration c) Ease of reproduction on other websites.

For implementation, I see a few ways to do it, but to ensure that Vapor is extendable and reusable, we need to approach it the right way.

1) We could add a "master" vapor user registration system that would associate accounts with mirrors. This would allow folks to be able to manage mirrors as a part of vapor.love2d.org. Unfortunately what it does do is it restricts vapor to only be used with vapor.love2d.org mirrors. I am personally against this when we can do the next option and still achieve the same objectives.

2) We could document exactly how vapor plans on authenticating (SSL) users for developers, and then associate a flag with the "mirror" object type that accepts usernames, passwords and stores sessions. This way we can maintain a "open" and "free" environment for people to use vapor any way they want.

e.g. user: seppi password:pass at vapor.love2d.org/login would respond with a session key if correct. Then vapor could syncronize the mirror with vapor.love2d.org/api?session=$session.

Then vapor.love2d.org/api could use the session key to return appropriate data.

Security Concerns: With the creation of luajit-request, we are pretty sexy. We have full https support and should have no issues with security. It requires minimal distribution of libcurl on windows, OSX comes with it, and linux usually does as well except in some odd edge cases we can test for anyway. After that, drupal for vapor.love2d.org is well prepared. We can probably get an api endpoint from the phpbb3 instance of love2d.org/forums to authenticate against them as well if we ask super nicely. For communication purposes, security shouldn't be a problem.

Service outage concerns: I intend on supporting whatever traffic vapor ends up spitting out, and drupal will scale just fine until proven otherwise.