Browse Source

Final updates

master
Adam Pippin 3 years ago
parent
commit
f0c28e9e27
  1. 33
      README.md
  2. 0
      docs/OTHER_INSTALL.md
  3. 0
      docs/OTHER_USAGE.md
  4. 7
      src/Http/Controllers/AuthenticationController.php
  5. 2
      src/Oidc/Flows/ServiceAccountFlow.php
  6. 3
      src/Providers/AuthnServiceProvider.php

33
README.md

@ -26,9 +26,36 @@ provider, however it should ostensibly work with any provider.
* [Configuration](docs/LARAVEL_CONFIG.md)
* [Usage](docs/LARAVEL_USAGE.md)
### Other
### Generic
* [Installation](docs/OTHER_INSTALL.md)
* [Usage](docs/OTHER_USAGE.md)
* [Installation](docs/GENERIC_INSTALL.md)
* [Usage](docs/GENERIC_USAGE.md)
### Other Documentation
* [Internals](docs/INTERNALS.md)
* [TODO](TODO.md)
## Contributing
Before submitting a PR, please run phan across your branch and ensure that no
issues are reported:
```
$ composer analyze
```
If any issues are returned, please resolve the underlying issue(s). Do not just
twist your code into a knot trying to work around the analysis. Any use of the
suppression comments to suppress issues require a comment immediately preceeding
explaining in detail why the code is provably correct. However, if there is any
workaround besides disabling issue reporting the change will be sent back for
further refinement.
After analysis, please ensure your changes follow the code formatting standards
used in this project by running php-cs-fixer:
```
$ composer format
```

0
docs/OTHER_INSTALL.md

0
docs/OTHER_USAGE.md

7
src/Http/Controllers/AuthenticationController.php

@ -95,6 +95,9 @@ class AuthenticationController extends Controller
if (!isset($user))
{
abort(500);
// We die() after each abort to help the static analyzer (phan)
// along, otherwise it doesn't realize that abort ends execution
// and is worried that we've hit the below code in an invalid state.
die();
}
elseif (!method_exists($user, 'save'))
@ -118,9 +121,7 @@ class AuthenticationController extends Controller
die();
}
$token->refresh_token = $refresh_token;
// @phan-suppress-next-line PhanNonClassMethodCall
$token->user_id = $user->{$user->getAuthIdentifierName()};
// @phan-suppress-next-line PhanNonClassMethodCall
$token->save();
}
else
@ -137,12 +138,12 @@ class AuthenticationController extends Controller
{
// TODO: Log a useful error message
abort(500);
die();
}
// If nothing handled the login event, assume we're using laravel default
// everything and just go ahead and update the name/email
$user->name = $user_info['name'];
$user->email = $user_info['email'];
// @phan-suppress-next-line PhanNonClassMethodCall
$user->save();
}

2
src/Oidc/Flows/ServiceAccountFlow.php

@ -35,6 +35,6 @@ class ServiceAccountFlow
*/
public function getServiceAccountToken(): Token
{
$token = $this->client->createTokenFromClient();
return $this->client->createTokenFromClient();
}
}

3
src/Providers/AuthnServiceProvider.php

@ -66,6 +66,9 @@ class AuthnServiceProvider extends ServiceProvider
// TODO: For some reason route($name) isn't working here. We're
// just looking through the routes manually for now...
// Might shoot ourselves in the foot if the routing system is
// ever changed, but for now this works and this whole method
// is a hack anyway.
// @phan-suppress-next-line PhanTypeNoPropertiesForeach
foreach (\Route::getRoutes() as $route)
{

Loading…
Cancel
Save