# |
May 21st 2021, 11:36 |
paolo.bragagni |
I've already made a bake theme to build all my modified actions and views |
# |
May 21st 2021, 11:35 |
paolo.bragagni |
but which is the more simple way? |
# |
May 21st 2021, 11:35 |
paolo.bragagni |
yes this is sure |
# |
May 21st 2021, 11:34 |
kevin.pfeifer |
if you want my hot topic on that: If it works and you (and your co-workers) can work with it then keep it as simple as possible and not "search for the right way" too hard |
# |
May 21st 2021, 11:33 |
paolo.bragagni |
I'm porting the same work that I mede some years ago with cake2 |
# |
May 21st 2021, 11:33 |
paolo.bragagni |
then when I have to build a new app I copy cakephp/app ? |
# |
May 21st 2021, 11:33 |
neon1024 |
I think what you’re doing is a bit too bespoke for a ‘right way’ |
# |
May 21st 2021, 11:32 |
paolo.bragagni |
but it is the right way? |
# |
May 21st 2021, 11:32 |
paolo.bragagni |
yes it is an idea |
# |
May 21st 2021, 11:32 |
paolo.bragagni |
yes, we have smartcard and access to an oauth2 server authentication |
# |
May 21st 2021, 11:32 |
ndm |
You might want to consider a custom application template, eg fork `cakephp/app` and maintain it according to your needs. |
# |
May 21st 2021, 11:31 |
neon1024 |
Sounds like OAuth :thinking_face: |
# |
May 21st 2021, 11:31 |
neon1024 |
So some kind of common way of authenticating? |
# |
May 21st 2021, 11:31 |
paolo.bragagni |
some plugins internally developed |
# |
May 21st 2021, 11:31 |
paolo.bragagni |
ssme template |
# |
May 21st 2021, 11:31 |
paolo.bragagni |
same kind of authenticator |
# |
May 21st 2021, 11:30 |
paolo.bragagni |
same kinfd of autentication and authorization |
# |
May 21st 2021, 11:30 |
paolo.bragagni |
I need something more |
# |
May 21st 2021, 11:29 |
neon1024 |
If you are going to be duplicating the same code many times, then there might be a better approach |
# |
May 21st 2021, 11:28 |
neon1024 |
Wouldn’t that just be a framework and a coding standard? |
# |
May 21st 2021, 11:28 |
paolo.bragagni |
so that my group of programmers use same structure |
# |
May 21st 2021, 11:28 |
slackebot |
!xy |
# |
May 21st 2021, 11:28 |
slackebot |
Command sent from Slack by neon1024: |
# |
May 21st 2021, 11:28 |
paolo.bragagni |
I want to make an 'internal' skeleton |
# |
May 21st 2021, 11:27 |
neon1024 |
@paolo.bragagni Are you building a multiple tenant application? |
# |
May 21st 2021, 11:19 |
paolo.bragagni |
I'm only searching best method |
# |
May 21st 2021, 11:18 |
paolo.bragagni |
Ssme template etc |
# |
May 21st 2021, 11:18 |
neon1024 |
I am trying to test when my `delete()` fails, and I’m caught between using an Integration test where I’m not sure how to mock the Table::delete() or a Unit test where I cannot assert the Flash messages. Any tips? |
# |
May 21st 2021, 11:18 |
paolo.bragagni |
I have to build many apps all of them eith same authandauth |
# |
May 21st 2021, 11:12 |
ndm |
:upside_down_face: |
# |
May 21st 2021, 11:11 |
steinkel |
lol, what @ndm said |
# |
May 21st 2021, 11:11 |
steinkel |
@paolo.bragagni if your're aiming to create a plugin to handle these items, remember you can inject middlewares from the plugin and handle all configuration so your main app will be "clea" |
# |
May 21st 2021, 11:11 |
slackebot |
collection directly to do that, like ```$plugins = \Cake\Core\Plugin::getCollection(); $plugins->add($plugins->create('Authentication'));``` To modify controllers you'd probably have to use events, like `Controller.initialize` (which is equivalent to `beforeFilter()`). Whether it makes sense to move this all into a plugin... that would be a different question :) |
# |
May 21st 2021, 11:11 |
ndm |
That can be summed up as adding middleware, which is also possible from within your plugin's `Plugin` class, it has a `middleware()` method too. However depending on the specific middleware, you might need to add it using `insertAfter()`/`insertBefore()` as otherwise they will be appended after all application level middlewares. Plugins can also add other plugins in their bootstrap, but they need to obtain and use the plugin |
# |
May 21st 2021, 11:02 |
paolo.bragagni |
etc etc |
# |
May 21st 2021, 11:02 |
paolo.bragagni |
some changes in middleware |
# |
May 21st 2021, 11:01 |
paolo.bragagni |
then $this->addPlugin('Authentication'); |
# |
May 21st 2021, 11:01 |
paolo.bragagni |
etc etc |
# |
May 21st 2021, 11:01 |
paolo.bragagni |
in class Application I've implemented AuthenticationServiceProviderInterface, AuthorizationServiceProviderInterface |
# |
May 21st 2021, 11:00 |
paolo.bragagni |
(for authentication) |
# |
May 21st 2021, 11:00 |
paolo.bragagni |
in application I add //Authentication use Authentication\AuthenticationService; use Authentication\AuthenticationServiceInterface; use Authentication\AuthenticationServiceProviderInterface; use Authentication\Identifier\IdentifierInterface; use Authentication\Middleware\AuthenticationMiddleware; |