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

Getting Started: Authenticate Users #207

Merged
merged 23 commits into from
Sep 11, 2019
Merged

Getting Started: Authenticate Users #207

merged 23 commits into from
Sep 11, 2019

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer requested review from engelke and dwsupplee August 16, 2019 23:14
@bshaffer bshaffer changed the title Adds code for "authenticate users" tutorial Getting Started: Authenticate Users Aug 21, 2019
Copy link
Contributor

@grayside grayside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, from a couple of clues, I've inferred the auth involved here is verifying requests that come in via IAP. Standalone it seems like it may be worth explicitly calling that out, maybe a README?

@@ -0,0 +1,2 @@
vendor
composer.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on the fence because I don't want to be too strict on the requirements here, since it's a sample app. If it's strict to one set of packages, it could break on the next version (e.g. composer.lock is for PHP 7.2 and so it fails on PHP 7.3). However, if we omit composer.lock, the opposite could happen (e.g. a newer, incompatible version of a package is installed and breaks).

But if semantic versioning is observed, I think the second is not very likely, so I'd prefer to leave it out. What do you think?

authenticate-users/composer.json Outdated Show resolved Hide resolved
authenticate-users/composer.json Outdated Show resolved Hide resolved
authenticate-users/index.php Outdated Show resolved Hide resolved
Copy link

@dwsupplee dwsupplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use lumen like the bookshelf example? It would be nice to wrap some of the functions in something that can contain a bit of state, so you don't need to create multiple guzzle clients per get_metadata request and can cache some of the static bits of information.

authenticate-users/getallheaders.php Outdated Show resolved Hide resolved
authenticate-users/getallheaders.php Outdated Show resolved Hide resolved
authenticate-users/composer.json Show resolved Hide resolved
authenticate-users/index.php Outdated Show resolved Hide resolved
authenticate-users/index.php Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Outdated Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Outdated Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Show resolved Hide resolved
@bshaffer
Copy link
Contributor Author

bshaffer commented Sep 4, 2019

@dwsupplee I think Lumen would be a bit much for this sample, since it'd add several additional files and this is essentially a single endpoint. Although I do agree the switch statement is not my favorite thing in the world, I still think the "microframeworks" for PHP out there are too big for examples like this.

authenticate-users/index.php Outdated Show resolved Hide resolved
authenticate-users/index.php Outdated Show resolved Hide resolved
authenticate-users/index.php Outdated Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Show resolved Hide resolved
authenticate-users/test/FunctionsTest.php Outdated Show resolved Hide resolved
authenticate-users/composer.json Show resolved Hide resolved
@bshaffer
Copy link
Contributor Author

@dwsupplee Thanks again for your super thorough review! Have I addressed all your suggestions to an acceptable extent?

@dwsupplee
Copy link

Happy to help 😄. Just one last minor item - #207 (comment) (I think it got buried since the original comment was already addressed).

@bshaffer
Copy link
Contributor Author

@dwsupplee good catch!!

@bshaffer bshaffer merged commit 5813099 into master Sep 11, 2019
bshaffer added a commit that referenced this pull request Sep 25, 2019
@bshaffer bshaffer deleted the authenticate-users branch October 9, 2019 17:56
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

Successfully merging this pull request may close these issues.

3 participants