summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/DependencyInjection
Commit message (Collapse)AuthorAgeFilesLines
* Add a debug message when throttling without definingJoas Schilling2023-03-081-1/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat(app-framework): Add support for global middlewaresChristoph Wurst2023-01-261-1/+2
| | | | | | | This allows apps to register middlewares that always register, not just for the app's own requests Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* perf(app-framework): Make the app middleware registration lazyChristoph Wurst2023-01-251-0/+11
| | | | | | | | | Before this patch, app middlewares were registered on the dispatcher for every app loaded in a Nextcloud process. With the patch, only middlewares belonging to the same app of a dispatcher instance are loaded. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat(app framework)!: Inject services into controller methodsChristoph Wurst2023-01-181-1/+2
| | | | | | | | | | | | | | | Usually Nextcloud DI goes through constructor injection. This has the implication that each instance of a class builds the full DI tree. That is the injected services, their services, etc. Occasionally there is a service that is only needed for one controller method. Then the DI tree is build regardless if used or not. If services are injected into the method, we only build the DI tree if that method gets executed. This is also how Laravel allows injection. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Move to str_starts_withJulius Härtl2022-12-071-3/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Skip querying the app container for server namespaceJulius Härtl2022-12-071-0/+6
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Avoid container dance for appNameJulius Härtl2022-12-071-4/+9
| | | | | | | Sicne the appName is always passed for the DIContainer we can avoid using the container query logic and instead store and use a property Signed-off-by: Julius Härtl <jus@bitgrid.net>
* use bruteforce protection on all methods wrapped by PublicShareMiddlewareJulien Veyssier2022-12-071-1/+2
| | | | | | if an invalid token is provided or when share password is wrong Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
* Clean up and deprecate app container aliasesChristoph Wurst2022-11-021-6/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Diagnostics event logging to Nextcloud logJulius Härtl2022-02-281-1/+3
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net> Add config samples Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add admin privilege delegation for admin settingsCarl Schwan2021-09-291-1/+4
| | | | | | | This makes it possible for selected groups to access some settings pages. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix unit testsJoas Schilling2021-04-271-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix types in the Group ManagerRoeland Jago Douma2021-03-031-1/+3
| | | | | | | | | Psalm found an issue. However the issue found was because of lying docblocks. Fixed those and did some typing to make it all better. For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Log the number of queries built and executedJoas Schilling2020-09-251-1/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-1/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add a scoped PSR logger for appsChristoph Wurst2020-07-161-1/+10
| | | | | | | | Just like for ILogger we should have a version that has the app ID pre-set for the context (unless overwritten) so that each log entry can be traced back to the app that produced it. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use PSR container interface and deprecate our own abstractionChristoph Wurst2020-07-161-78/+94
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix AppFramework servicesRoeland Jago Douma2020-07-141-2/+14
| | | | | | | | | * We can't just register an alias as the services need the appId to be injected. if we just register an alias this blows up since the main container doesn't have the appId. * Moved the Authtokens over to show the PoC works Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move the notmodified check to middleware where it belongsRoeland Jago Douma2020-05-131-0/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add AppFramework GZip middleware to gzip responsesRoeland Jago Douma2020-05-121-0/+5
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #20786 from nextcloud/enh/dicontainer_cleanupRoeland Jago Douma2020-05-091-8/+0
|\ | | | | DI Cleanup
| * Move over the IConfig for globalscaleRoeland Jago Douma2020-05-081-5/+0
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
| * Remove double registrationsRoeland Jago Douma2020-05-071-3/+0
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Add InitialState Appframework serviceRoeland Jago Douma2020-05-071-0/+2
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Simple AppConfig wrapper for the AppFrameworkRoeland Jago Douma2020-05-021-0/+3
| | | | | | | | | | 9 out of 10 cases apps want to access their own appconfig. Hence it would be nice not to have to enter the app id all the time. This simple wrapper just passes on the appid in all calls. Basically this allows for simpler code in the apps. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-4/+3
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-8/+8
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for 18Christoph Wurst2019-12-201-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Decouple resource provider registrationDaniel Kesselberg2019-12-071-0/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update license headersChristoph Wurst2019-12-051-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-3/+2
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Do DI on registered middleware as wellRoeland Jago Douma2019-10-161-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* SessionMiddleware: declare session propertyRoeland Jago Douma2019-08-281-1/+0
| | | | | | | * Remove request since we don't useit * Update tests as well Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add feature policy headerRoeland Jago Douma2019-08-101-0/+3
| | | | | | | This adds the events and the classes to modify the feature policy. It also adds a default restricted feature policy. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Split up security middlewareRoeland Jago Douma2019-07-271-3/+7
| | | | | | | | | | With upcoming work for the feature policy header. Splitting this in smaller classes that just do 1 thing makes sense. I rather have a few small classes that are tiny and do 1 thing right (and we all understand what is going on) than have big ones. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Do not try to autoload built in typesRoeland Jago Douma2019-06-041-7/+2
| | | | | | | | This avoids calls to the autoloader (or chain of autoloaders) to see if for example 'principalPrefix' class can be found. While we already know it is a string. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make it possible to show admin settings for sub adminsChristoph Wurst2019-05-231-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make sure all middlewares are only registered onceJoas Schilling2019-05-061-0/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Make names mandatoryJoas Schilling2019-03-011-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Do not do redirect handling when loggin outRoeland Jago Douma2019-02-061-0/+4
| | | | | | | | | | | | | Fixes #12568 Since the clearing of the execution context causes another reload. We should not do the redirect_uri handling as this results in redirecting back to the logout page on login. This adds a simple middleware that will just check if the ClearExecutionContext session variable is set. If that is the case it will just redirect back to the login page. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Emit to load additionalscriptsRoeland Jago Douma2019-01-311-0/+3
| | | | | | | | | | | | | Fixes #13662 This will fire of an event after a Template Response has been returned. There is an event for the generic loading and one when logged in. So apps can chose to load only on loged in pages. This is a more generic approach than the files app event. As some things we might want to load on other pages as well besides the files app. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Cleanup middleware registeringRoeland Jago Douma2019-01-031-102/+77
| | | | | | | | | Fixes #12224 Since we only use the middleware at 1 location it makes no sense to register them in each and every container. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Properly query the methodreflectorRoeland Jago Douma2018-11-021-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-11-021-11/+12
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* The identityproof manager should be in ServerRoeland Jago Douma2018-11-021-8/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* No need to register it also in the DI ContainerRoeland Jago Douma2018-11-021-4/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* The Encryption manager belongs in Server.phpRoeland Jago Douma2018-11-021-4/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>