# |
Dec 29th 2018, 15:30 |
challgren |
Use a token |
# |
Dec 29th 2018, 15:29 |
NickBusey |
challgren: Ok, well anyway to disable that? Not sure how to get an API working with the normal security stuff enabled |
# |
Dec 29th 2018, 15:29 |
k4t |
I have to listeners enabled: Crud.Api and Crud.ApiQueryLog |
# |
Dec 29th 2018, 15:29 |
NickBusey |
k4t: http://www.bravo-kernel.com/2015/04/how-to-prefix-route-a-cakephp-3-rest-api/ |
# |
Dec 29th 2018, 15:29 |
NickBusey |
k4t: with both the normal api and the json api enabled, normal links without the .json should work. |
# |
Dec 29th 2018, 15:28 |
challgren |
@nickbusey it does reenable security when logging in |
# |
Dec 29th 2018, 15:28 |
k4t |
well it is working like I said. but I want to change now behavior of links without .json extension. I would like ot make them work like links without .json at the end or just throw 404 on such url |
# |
Dec 29th 2018, 15:28 |
NickBusey |
ection. Does the Users plugin set it's own security preferences? |
# |
Dec 29th 2018, 15:28 |
NickBusey |
Hmm, I'm using the CakeDC/Users plugin as well, trying to get the auth flows to work through the API. All my other API flows work fine, but when I try users/login I get `'_Token' was not found in request data.`. If I disable the `validatePost` check in the SecurityComponent, I then get an error about CSRF tokens, but I've already disabled CSRF prot |
# |
Dec 29th 2018, 15:25 |
NickBusey |
as well as the JSON api* |
# |
Dec 29th 2018, 15:25 |
NickBusey |
It should work, do you have the normal API enabled as well? |
# |
Dec 29th 2018, 15:19 |
k4t |
poke @admad, @dereuromark, @neon1024 |
# |
Dec 29th 2018, 15:18 |
k4t |
Is it possible? |
# |
Dec 29th 2018, 15:17 |
slackebot |
should just throw 404 error. |
# |
Dec 29th 2018, 15:17 |
k4t |
I am using latest CakePHP with CRUD plugin. I want to create REST API and well... it is working pretty good. Now I can type following url in the browser: /api/v1/users.json and I will get nice JSON response. But I can also use: http://be.habiticon.localhost/api/v1/users and this will get me error about missing template. How I can easily make urls without .json work like it was with .json? Or the second solution - maybe urls without .json at the |
# |
Dec 29th 2018, 15:13 |
challgren |
Hi |
# |
Dec 29th 2018, 15:13 |
k4t |
Hi |
# |
Dec 29th 2018, 15:12 |
challgren |
And In the setUp() I am using $this->getMailer(‘Users’); |
# |
Dec 29th 2018, 15:10 |
challgren |
@dereuromark I did add a Plugin.php to CakeDC/users thinking it was the missing Plugin.php but that isn’t it |
# |
Dec 29th 2018, 15:04 |
dereuromark |
@neon1024 I added a sandbox example for usefulness of dtos. when using github api for example. |
# |
Dec 29th 2018, 15:04 |
challgren |
I am going to work on some of your plugins, your stuff has helped me out tremendously |
# |
Dec 29th 2018, 15:03 |
dereuromark |
I have some cake3 apps and plugins, if you wanna try some coverage of them? ;) |
# |
Dec 29th 2018, 15:02 |
challgren |
I learned from my Cake 2.10 app the hard way |
# |
Dec 29th 2018, 15:01 |
challgren |
That 100% is killing me slowly :P |
# |
Dec 29th 2018, 15:01 |
challgren |
Haha no its obsessiveness :P kind of why Ive been on, on random hours |
# |
Dec 29th 2018, 15:01 |
dereuromark |
someone clearly has too much time :slightly_smiling_face: |
# |
Dec 29th 2018, 14:44 |
slackebot |
<challgren> |
# |
Dec 29th 2018, 14:42 |
challgren |
This is my last thing to finish and then I’ll have my entire code base 100% tested. Right now its stuck at 98.06% cause of this issue |
# |
Dec 29th 2018, 14:32 |
challgren |
Kind of want to avoid having to mock the whole Mailer class and use the new TestSuite\EmailTrait |
# |
Dec 29th 2018, 14:28 |
challgren |
Would anyone have any idea why plugins aren’t being loaded during testing? https://cakesf.slack.com/files/UF0KR5CRY/FF3C63B2N/-.txt |
# |
Dec 29th 2018, 14:12 |
dereuromark |
you need to write a bit cleaner code there IMO. bail early on !is_array() makes it much nicer to read |
# |
Dec 29th 2018, 13:11 |
birdy247 |
@admad https://github.com/birdy247/cakephp-duplicatable/commit/2ec46289d83af88e987fb72c426e856e1d9dd7bc |
# |
Dec 29th 2018, 12:41 |
admad |
though i prefer `git pull upstream --rebase` instead of merging |
# |
Dec 29th 2018, 12:41 |
admad |
yes |
# |
Dec 29th 2018, 12:40 |
birdy247 |
add the upstreat to the original project and then merge upstream/master? |
# |
Dec 29th 2018, 12:39 |
birdy247 |
@admad I have already forked this project sometime ago, I am wondering the best way to update it |
# |
Dec 29th 2018, 12:39 |
admad |
@birdy247 yes most likely likely you'll need a new config |
# |
Dec 29th 2018, 12:38 |
asdfgh |
THANKS |
# |
Dec 29th 2018, 12:38 |
asdfgh |
:D |
# |
Dec 29th 2018, 12:38 |
dereuromark |
^^ please read the beginner docs |
# |
Dec 29th 2018, 12:37 |
admad |
cake bake all |