-
Notifications
You must be signed in to change notification settings - Fork 15
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
make implementing other authentication methods easier #25
Comments
this should probably be titled "other authentication methods" |
Another option is to split the source code for this repo into multiple files and have a sort of "build step" that generates the single-file version that people use. This would be similar to how larger projects exists as dozens of source file and they publish a .zip file as a release. |
Yes, @sknebel and I discussed possibly setting up a build tool (I don’t know a lot for PHP … Phing possibly?). Another option is to go with multifile and distribute a PHAR file, but server support is probably not there for that. See @cweiske’s great Working with .phar files. |
No, it will take a while: http://cweiske.de/tagebuch/phar-webserver2.htm |
What is the exact reason to needing it to all be one file? I know that was the original idea, but its already using the configs as a separate file. As long as the files are kept simple, where is the issue? Unless there is a very good reason to not just have an extra file, i would strongly suggest this be done as just multiple files and avoid any build mess. It would also clean up any duplicate code between setup and index as well. |
Per discussion in IRC today (https://chat.indieweb.org/dev/2017-07-18#t1500403860546000) and offline talks with people, it might be interesting to allow people to easily modify selfauth to use different authentication methods. Right now, a password-based one can already be easily implemented by replacing the password verification function, but e.g. for social logins changes to the form presented to the user are also necessary (and maybe handling of special callbacks?).
An idea in the IRC discussion was to build selfauth as a class, so forks/variations can easily override parts of the functionality.
We want to keep selfauth as one file, so we need a way for variations to include it without actually running the existing code. Given that PHP
require
seems to work basically as an include, we could check for the presence of a special variable, that code including it could set to disable automatically running functionality. If the file is loaded directly, the variable doesn't exist and it works as it does now.The text was updated successfully, but these errors were encountered: