3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-21 20:59:18 +00:00

137 Commits

Author SHA1 Message Date
7257602e51 Fixed #19457 - ignore storage proxy on login 2026-08-11 12:31:57 +01:00
9c8c180e8a Check for bearer token along wth expectsJson 2026-07-30 17:10:50 +01:00
b3f12f974b Extend middleware activation for API as well
No token revocation on deactivate - that would force users to regenerate tokens on reactivation, which admins probably don't want. Middleware refusal is enough because it fires on every request.
2026-07-25 16:02:53 +01:00
c4ea7db51c Stricter 2FA enforcement for existing PATs on API 2026-07-11 17:24:57 +01:00
0b46184f46 Fixed flaky test 2026-06-26 16:03:40 +01:00
0969ccb387 Fixed FD-56236 - 2FA guard on API 2026-06-26 13:53:24 +01:00
16bc195767 Fixed route parameter $next, updated language, added tests 2026-06-24 14:08:21 +01:00
7e617bbfa3 Switch to stripos(...) === 0
Updated the pattern check to use `stripos(...) === 0` (prefix match) instead of !== false (substring match), so scripted clients identify themselves at position 0, and prefix matching prevents a pattern from accidentally matching an unrelated UA that mentions it later. This makes surwe a UA like MyWrapper/1.0 (uses curl/8.5.0 internally) passes, and a plain curl/8.5.0 is blocked.
2026-06-24 12:18:39 +01:00
9e6c5f1b1b Updated blockedPatterns order
Get setting + UA.
  2. If UA is blank, block if blank-blocking is on, otherwise pass.
  3. Past this point UA is known non-blank.
  4. If pattern master is off, pass.
  5. Iterate patterns, reject on first match.
  6. Pass.

Side benefit: the if ($patterns === [] || $userAgent === '') short-circuit is gone — both conditions are unreachable by this point (UA is non blank by step 2; an empty pattern list just makes the foreach a no-op).
2026-06-24 12:15:23 +01:00
7714179de8 API/Settings: Added optional requirement for non-generic user agent
alternative to #19217
2026-06-23 22:59:03 +01:00
3942de9a90 Styling: Use correct column names when setting colors 2026-06-17 17:26:16 -07:00
0d745ad10f Added view composer forn sidebar counts, removed sidebar middleware 2026-05-29 01:30:34 +01:00
19f70656ee Move API singletons from SettingServiceProvider into middleware 2026-05-13 22:20:46 +01:00
c7afcf0bef Fix returning to intended URL on 2-factor success (or enrollment success) 2026-04-27 14:59:32 +01:00
a88ad35b68 Added token name and ID 2026-04-09 19:35:09 +01:00
6e60f59265 Changed the name because reasons 2026-04-09 19:24:11 +01:00
a866bfafcd Oh ffs pint 2026-04-09 19:23:29 +01:00
97d1677568 Check for bearer token in header 2026-04-09 19:23:21 +01:00
f4562db0c0 Pint 2026-04-09 19:19:56 +01:00
a616da3e5c Moved to an API-only header 2026-04-09 19:19:50 +01:00
a895566b02 Pint fixes 2026-04-09 19:09:32 +01:00
5d75765aae Optionally log the user’s ID in the header 2026-04-09 19:09:21 +01:00
ec6caf9b59 Apply pint to Middleware directory 2026-03-13 16:53:11 +00:00
0204414196 Handle /setup link colors via middleware 2025-12-05 10:55:49 +00:00
6a99132e76 More tweaks 2025-12-02 13:29:12 +00:00
6b87c90e02 Use scope for assets for show in sidebar
Signed-off-by: snipe <snipe@snipe.net>
2025-09-08 13:33:19 +01:00
9253d894d3 Removed XSS-Protection header
@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-XSS-Protection#security_considerations

Signed-off-by: snipe <snipe@snipe.net>
2025-08-18 13:30:53 +01:00
7bc4127e8c Removed dupe header
Signed-off-by: snipe <snipe@snipe.net>
2025-05-27 15:01:54 +01:00
06158cc413 Add timestamp header
Signed-off-by: snipe <snipe@snipe.net>
2025-05-27 14:58:57 +01:00
cb49e7c9a6 Updated comments
Signed-off-by: snipe <snipe@snipe.net>
2025-05-27 14:32:47 +01:00
1822027a8f Extend the built-in ThrottleRequests middleware from Laravel
Signed-off-by: snipe <snipe@snipe.net>
2025-05-27 14:04:24 +01:00
f2b10eeee8 Re-do the initial change :(
Signed-off-by: snipe <snipe@snipe.net>
2025-05-27 13:00:32 +01:00
b3813a7121 Refactorered limiting headers
Signed-off-by: snipe <snipe@snipe.net>
2025-05-26 13:48:50 +01:00
293648582a Improvements to API headers
Signed-off-by: snipe <snipe@snipe.net>
2025-05-26 10:52:14 +01:00
4d9e85026a Fixed #15439 - check database on healthcheck
Signed-off-by: snipe <snipe@snipe.net>
2024-10-02 15:36:01 +01:00
09abcb44bb Remove cookie serialization
Signed-off-by: snipe <snipe@snipe.net>
2024-07-22 13:49:47 +01:00
eed253bd2f Use app helped instead of facade
Signed-off-by: snipe <snipe@snipe.net>
2024-07-13 15:15:18 +01:00
498a443230 Derp
Signed-off-by: snipe <snipe@snipe.net>
2024-07-11 12:01:06 +01:00
34b49ef079 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2024-07-11 11:59:47 +01:00
e98823f7fa Added 403 to sad panda page
Signed-off-by: snipe <snipe@snipe.net>
2024-07-05 11:54:49 +01:00
ae9085b11f Modernize use statements, switch to auth()
Signed-off-by: snipe <snipe@snipe.net>
2024-07-04 20:49:22 +01:00
9a0db72eb4 More strings
Signed-off-by: snipe <snipe@snipe.net>
2024-06-20 15:40:38 +01:00
69cf697aa3 Added 2fa translation string
Signed-off-by: snipe <snipe@snipe.net>
2024-06-20 15:20:52 +01:00
fb233c0aa4 Cleaned up facade names and references
Signed-off-by: snipe <snipe@snipe.net>
2024-05-29 12:38:15 +01:00
f633dbba64 Merge branch 'develop' into snipeit_v7_laravel10 2024-05-20 12:55:29 +01:00
ca1555d962 Fixed #14664 - allow additional urls in env for CSP
Signed-off-by: snipe <snipe@snipe.net>
2024-05-16 22:19:18 +01:00
2adc4ffa96 Fix memory-hog query in AssetCountForSidebar middleware
https://github.com/snipe/snipe-it/pull/14702/files introduced a bug
where instead of doing a quick `select count(*)` of assets, it did a `select *` of
assets, moving the count from the database to the PHP process.

This caused OOM issues in memory-constrained environments with lots of
assets, and also presented a speed issue even when memory limited were
increased.

Additionally, given this populates the sidebar, this was likely an issue
on every page load that included the sidebar.

The fix is simply removing the `all()->`, ending up with Asset::count(),
which yields the desired `select count(*)` DB query.
2024-05-10 12:54:40 -07:00
b2a5d86e30 Fixes #14701 - wrong total asset count
The total asset count in the sidenav shows the ready to deploy count instead of the total count.
Fix this by adjusting the query to all assets. Also respect the setting for archived assets.
Add a default value for total assets, since we are now using the settings-variable, which is not available during the setup process.

While at it, move the block for total assets before the ready to deploy assets to match the ordering of the sidenav.

Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
2024-05-08 09:34:35 +02:00
4f12c86e74 Fixes #14692 - set default variables for sidebar totals
Signed-off-by: snipe <snipe@snipe.net>
2024-05-07 08:34:22 +01:00
5b02a43957 Merge branch 'develop' into snipeit_v7_laravel10 2024-05-06 18:44:03 +01:00