873 Commits

Author SHA1 Message Date
Johannes Meyer
e21071ce0f Drop obsolete route references
The related controller action is gone since
b6b5caace373aade21e7a2c7fe24272f05d11dfd
2025-07-08 16:41:18 +02:00
Johannes Meyer
078fdc84ab Manager: Perform module loading asynchronously
So that authentication can suspend it. There are cases,
e.g. cube, where authentication is required in run.php.
During bootstrapping loading modules is mostly required
to load libraries, register routes and hooks. Most of the
time authentication is not required for these, but if
it is, evaluation is now interrupted and continued
after authentication has actually been performed.

I don't see a real risk for any breaking change here,
since authentication happens shortly after. It actually
avoids a breaking change, since without this, cube's
Icinga DB support would break or at least malfunction.

And cube is only a single example.

refs #5265
2025-07-08 16:41:18 +02:00
Johannes Meyer
4ebd1e42e0 Auth: Perform authentication only once and not lazily
Since authentication is now performed even for static
resources, there's no reason anymore to support implicit
authentication. This also limits authentication attempts
to a single one, previously failed attempts were repeated.

Requiring authentication during bootstrapping, i.e. before
authentication has been performed, will now trigger a
deprecation notice.

refs #5265
2025-07-08 16:41:18 +02:00
Johannes Meyer
a28eb4beb8 EmbeddedWeb: Explicitly perform authentication
It is nowadays no exception that stylesheet may be dependent
on who's using the app. So to avoid race conditions like
in #5385 authentication is an explicit step during bootstrap
now.

fixes #5385
2025-07-08 16:39:29 +02:00
Johannes Meyer
dadff36660 Module: Expect user and group backends upon registration
Providing a user or user group backend in configuration.php
now has no effect anymore. They are expected to be announced
in run.php, just like hooks. A warning appears in the log
for cases where a configuration.php still attempts it. Should
help with troubleshooting since it will appear after an error
that a specific backend has not been found.

refs #5265
2025-07-08 16:39:29 +02:00
Alexander Aleksandrovič Klimov
5333f2deb7
Disable deprecation warnings unless ICINGAWEB_ENVIRONMENT is set to "dev" (#5359)
in ApplicationBootstrap#setupErrorHandling(). In webrouter.php disable
them unconditionally (until ApplicationBootstrap#setupErrorHandling())
not to duplicate the check. ApplicationBootstrap#setupErrorHandling())
is called pretty early, so we won't miss much.

fixes #5117

* In addition, this provides #5269 and mitigates #5152 in production
where ICINGAWEB_ENVIRONMENT isn't set.
2025-05-05 17:58:28 +02:00
Johannes Meyer
e98a776509 Raise version to 2.12.4 2025-03-26 16:41:23 +01:00
Johannes Meyer
01fb35dd4a Raise version to 2.12.3 2025-03-26 10:31:04 +01:00
Johannes Meyer
b403918cc1 Raise version to 2.12.2 2024-11-13 09:59:05 +01:00
Johannes Meyer
b23cbd796f Raise version to 2.12.1 2023-11-15 12:22:46 +01:00
Yonas Habteab
bcdad8c9b3 MigrationManager: Enhance how pgsql privileges are checked
For mysql it's just enough to check whether the privileges are granted
at database or table label, but for PostgreSQL it's necessary that the
privileges are granted at database and at table level.
2023-10-26 17:07:17 +02:00
Yonas Habteab
a99f685d15 Add missing pgsql USAGE privilege 2023-10-26 17:07:17 +02:00
Johannes Meyer
21d631ad7e Raise version to 2.12.0 2023-09-21 16:35:31 +02:00
Yonas Habteab
c3eef5f607 DbMigrationHook: Pad matching groups to the desired length before using them 2023-09-20 15:35:39 +02:00
Johannes Meyer
9c6d930e17 MigrationManager: Also check table privileges 2023-09-19 14:37:55 +02:00
Yonas Habteab
167ff54947 Enhance logging 2023-09-19 14:37:55 +02:00
Yonas Habteab
47b214ee1b Use PDO::fetchColumn() where applicable 2023-09-19 14:37:55 +02:00
Yonas Habteab
2505e79a2d DbMigration: Check for mysql collation name whether to check 2.11 is migrated 2023-09-19 14:37:55 +02:00
Yonas Habteab
dc738ec4ce DbMigrationHook: Adjust regex pattern & add missing argument docs 2023-09-19 14:37:55 +02:00
Yonas Habteab
96a6321569 DbMigration: Adjust usage of Database::getDb() 2023-09-19 14:37:55 +02:00
Yonas Habteab
fac3855a86 DbMigrationStep: Don't cache sql statements unnecessarily 2023-09-19 14:37:55 +02:00
Yonas Habteab
26cae8b882 Rename MigrationHook -> DbMigrationHook 2023-09-19 14:37:55 +02:00
Yonas Habteab
ce89d4a7cb Rename Common\DbMigration -> DbMigrationStep 2023-09-19 14:37:55 +02:00
Yonas Habteab
2657f032dc Allow to automatically fix missing grants & elevalte database users
Co-authored-by: Johannes Meyer
2023-09-19 14:37:55 +02:00
Yonas Habteab
ac24c6d34b Don't traverse schema query if the last successfully migrated version is found 2023-09-19 14:37:55 +02:00
Yonas Habteab
73b1041816 Fix phpstan claims & php code sniffer errors 2023-09-19 14:37:55 +02:00
Yonas Habteab
13569a34b7 Check explicitly for false before raising an unknown error 2023-09-19 14:37:55 +02:00
Yonas Habteab
4b2784f85e Use Icinga Web as a component name 2023-09-19 14:37:55 +02:00
Yonas Habteab
2944ceaa52 Rename getSchemaQueryFor() & drop $version param 2023-09-19 14:37:55 +02:00
Yonas Habteab
ce012dcdb2 Hook: Don't abort loading remaining hooks due to one broken hook
`Hook::all()` shouldn't abort loading the remaining hooks when one of
the provided hook is broken.
2023-09-19 14:37:55 +02:00
Yonas Habteab
15792fb59a Provide DbMigration hook & register when bootstrapping 2023-09-19 14:37:55 +02:00
Yonas Habteab
81c9e5cfc5 Introduce MigrationManager class 2023-09-19 14:37:55 +02:00
Yonas Habteab
babc59437f Introduce base MigrationHook class & helpers 2023-09-19 14:37:54 +02:00
Eric Lippmann
b693369412 Fix class in Platform::hasOracleSupport() 2023-09-07 08:51:22 +02:00
Johannes Meyer
c027282d8c Test: Load a module's composer autoloader 2023-08-31 10:18:37 +02:00
raviks789
33b6c01fe2 Create fake session to write csp nonces to it
`Csp::createnonces()` writes to a window aware session and hence a fake base session
is created in `BaseTestCase::setUp()` method
2023-08-28 16:56:51 +02:00
Sukhwinder Dhillon
ee9d139a3a PhpDoc: Fix incorrect @param and @return type hints 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon
a88d0fe348 Web: Method hasAccessToSharedNavigationItem() requires param #2 of type Config 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon
e3036c41a2 Web: Add $accessibleMenuItems explicitly as non-dynamic property 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon
391eede52f StderrWriter::log(): Fix Variable '$color' is probably undefined 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon
8358dc1c5e Hook::has(): Method expects only one parameter 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon
a0ed272cb8 ApplicationBootstrap: Fix method name case 2023-08-23 10:53:14 +02:00
raviks789
58938f6636 Config: Import exception NotWritableError 2023-08-23 10:53:13 +02:00
raviks789
1b9d977da4 Config: Fix parameter type for $fromDisk of method module() 2023-08-23 10:53:13 +02:00
raviks789
11c7f913c8 Benchmark: Define parameter $what as nullable 2023-08-23 10:53:13 +02:00
raviks789
dd8875f99f ConfigFormEventsHook: Use self to access static property $lastErrors 2023-08-23 10:53:13 +02:00
raviks789
2265b9d27b LegacyWeb: Import Exception class 2023-08-23 10:53:13 +02:00
raviks789
1c0480d484 Module: Use correct name case for Web::getFrontController() method 2023-08-23 10:53:13 +02:00
Alexander A. Klimov
6de4bd6e7e Explicitly add Module#configdir as (non-dynamic) property
W/o this the login page, if on PHP 8.2, says:

Deprecated: Creation of dynamic property Icinga\Application\Modules\Module::$configdir is deprecated in /usr/share/icingaweb2/library/Icinga/Application/Modules/Module.php on line 264

This breaks modules (if any) which use the property and not the getter.
2023-08-23 10:53:13 +02:00
Johannes Meyer
65b3006adf Check if \Throwable instead of \Exception..
..everywhere else...

fixes #5079
2023-08-10 14:12:06 +02:00