Uh oh!
There was an error while loading. Please reload this page.
ApiToken docs and filter update. - #417
Conversation
jozefrebjak
commented
Sep 2, 2022
@lonnieezell Thanks for this PR. It will be nice to have an CLI command to generate Token for user at start to test functionality before implementing the whole flow with user interface to interact with API access. |
MGatner
commented
Sep 2, 2022
This looks great! It's big, and I am short on time so will have to come back to it. Ideally you pull the token changes out to its own PR to make this smaller for review 🫣 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: MGatner <mgatner@icloud.com>
lonnieezell
commented
Sep 7, 2022
@MGatner doc changes integrated. |
The following errors have nothing to do with this PR. I send #423 to fix. https://github.com/codeigniter4/shield/runs/8220322852?check_suite_focus=true |
Uh oh!
There was an error while loading. Please reload this page.
| ```php | ||
| $routes->get('/access/token', static function() { | ||
| $token = auth()->user()->generateAccessToken(request()->getVar('token_name)); |
There was a problem hiding this comment.
request() ?
Do you mean service('request') ?
There was a problem hiding this comment.
Don't mind him, Laravel gets the bills paid. Yes he meant to use the service.
There was a problem hiding this comment.
Dang it :) I've considered adding a request() and response() helper method for years on this framework, but never did. I actually had to go double-check the code to ensure we didn't have it lol. But, yes, that's what I meant.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We need a review process for reviews 🤦♂️ Thanks for catching wha to missed @kenjis. |
Co-authored-by: kenjis <kenji.uui@gmail.com>
lonnieezell
commented
Sep 7, 2022
@MGatner if you guys have the time and/or desire feel free to finish it up. I merged the suggestions. |
Uh oh!
There was an error while loading. Please reload this page.
Added the first of a handful of guides stepping through setup and use Access Tokens to handle various situations. This one covers generic API requests.
Along the way I discovered that the
TokenAuthfilter didn't support checking against a scope, so I updated the filter to handle a single permission added when used as a route filter.