Commit Graph
34180 Commits
Author SHA1 Message Date
loks0nandClaude Opus 4.7 79d2cfca94 chore: use public Http::setContext() in graphql resolver
setContext() is now public on Http (utopia-php/http#251). The graphql
resolver no longer needs to reach into the per-request container
directly to swap the active match for nested resolution — it can just
ask Http to do it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:35:07 +01:00
loks0nandClaude Opus 4.7 9bee79fb76 chore: rename Adapter::getContainer() call to getContext()
Upstream removed Adapter::getContainer() in favor of a single
public reader Adapter::getContext(): Container that returns the
container for the current execution context (per-request inside
a request, global outside one). Migration is a one-line rename.

The only call site was the installer's bootstrap, which runs at
boot and therefore receives the global container — same semantics
as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:32:41 +01:00
loks0nandClaude Opus 4.7 d47cf5a558 chore: drop try/catch around getResource('match')
Upstream now returns null instead of throwing when the request hasn't
been matched yet, so the defensive try/catch wrappers in app/http.php
and Resolvers.php are no longer needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:18:03 +01:00
loks0nandClaude Opus 4.7 98f6ca347f chore: prefer ->inject('match') over \$utopia->getResource() in resource resolvers
Replaces \$utopia->match(\$request) calls in the project, team, and auth
resolvers with the per-request RouteMatch injected directly via DI:

- app/init/resources/request.php — project / team resource closures now
  declare 'match' as a dependency and read \$match?->route.
- app/controllers/shared/api/auth.php — auth init hook injects 'match'
  instead of resolving via \$utopia.
- app/controllers/shared/api.php — drop the redundant re-match in the
  storage cache init hook; \$route from the action's \$match inject is
  already in scope.

Only Resolvers::resolve still calls \$utopia->match(...) — that path
genuinely matches a synthesized sub-request URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:00:55 +01:00
loks0nandClaude Opus 4.7 2cc1f6a82a chore: migrate to RouteMatch context value
Bumps utopia-php/http to the latest fix/concurrency-shared-state, which
collapses the separate route / matchedPath / arguments context keys into
a single immutable RouteMatch under the 'match' key.

- Replace ->inject('route') / ->inject('matchedPath') with
  ->inject('match'), reading \$match->route / \$match->path.
- Replace the manual array_merge(\$route->getPathValues(), \$request->
  getParams()) workaround in api.php's shutdown hook with the framework-
  provided \$match->arguments — same data the action saw, no path-value
  reconstruction needed.
- Update GraphQL resolver to snapshot/restore the 'match' value instead
  of 'route'.
- Update top-level call sites in app/http.php that read from getResource
  ('route') to read getResource('match')->route.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:22:14 +01:00
loks0n b46ede4711 chore: untrack .claude lock file 2026-04-28 14:28:08 +01:00
loks0nandClaude Opus 4.7 391b7fa44e fix: merge path values into requestParams for cache label substitution
The api shutdown hook substitutes route labels like
\`cache.resource = 'file/{request.fileId}'\` against \$requestParams. We
were reading those from \$request->getParams(), which only returns body
or query params — path params (\`fileId\`, \`bucketId\`) were missing,
so cache documents got written with literal \`file/{request.fileId}\`
strings and subsequent cache hits 404'd because the placeholder was
treated as a real fileId.

Merge \$route->getPathValues(\$request) ahead of \$request->getParams() so
path params are available for substitution. Replicates the previous
behaviour of \$route->getParamsValues(), which was populated by the
upstream Hook param writeback that has since been removed.

Also rename the per-request container variable to \$context and the
loader callable to \$registerContext in app/http.php to match the new
upstream terminology.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:27:44 +01:00
loks0nandClaude Opus 4.7 f88d4b9bff fix: switch to inject('route') / inject('matchedPath') and fix bus resolver
- Use ->inject('route') and ->inject('matchedPath') in actions instead of
  reading via \$utopia->getResource() — this was the cause of the e2e 500s,
  the bus resolver was hitting the global container after the upstream
  Adapter::getContainer() semantics changed.
- Switch the bus resolver in app/http.php to use \$swooleAdapter->getContext()
  so per-request resources (locale, platform, dbForProject) resolve from the
  per-coroutine context container.
- Drop the dead ?->label('router', true) calls in general.php — the label was
  never read.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:09:17 +01:00
loks0nandClaude Opus 4.7 7f41f3ef49 chore: bump utopia-php/http to fix/concurrency-shared-state branch
Adopts the breaking changes from utopia-php/http#251 (concurrency races on
shared Http/Route singletons):

- Replace `Http::getRoute()` / `setRoute()` with `getResource('route')` and
  context container writes.
- Replace `Route::getMatchedPath()` with `getResource('matchedPath')`.
- Use `Adapter::getContext()` for the per-request container in `app/http.php`
  (`getContainer()` now always returns the global singleton).
- Read request params from `$request->getParams()` in the api shutdown hook
  instead of `Route::getParamsValues()`, which is no longer populated.
- Update Swoole promise context key to `__utopia_http_context`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 12:47:56 +01:00
Matej BačoandGitHub 3d3f5934c6 Merge pull request #11993 from appwrite/feat-public-oauth2-endpoints
Feat: Public project OAuth2 configuration API
2026-04-28 12:41:50 +02:00
Matej Bačo cb4cff120b Add Keycloak oauth support 2026-04-28 10:54:13 +02:00
Matej Bačo 49e6a38e7f Add fusionauth oauth 2026-04-28 10:43:16 +02:00
Matej Bačo dfa3ae5274 Fix tests 2026-04-28 10:19:36 +02:00
Matej Bačo 543765a22a Improve copy 2026-04-28 10:15:45 +02:00
Matej Bačo e2bb9a9161 Simplify oauth endpoints 2026-04-28 10:08:39 +02:00
Matej Bačo d25707346f Add console oauth endpoint 2026-04-28 09:47:27 +02:00
Damodar LohaniandGitHub cefd063c55 Merge pull request #12165 from appwrite/fix/CLO-4280-getheader-string-coerce
fix: coerce non-string header values in Request::getHeader
2026-04-28 10:43:40 +05:45
Damodar LohaniandGitHub c924cbcc59 Merge pull request #12166 from appwrite/fix/CLO-4279-favicon-empty-body
fix: guard DOMDocument::loadHTML against empty body in favicon endpoint
2026-04-28 10:32:32 +05:45
Damodar LohaniGitHubgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
81321e82d1 Update src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-28 10:05:01 +05:45
Damodar Lohani 30a511692b test: add unit coverage for Request::getHeader non-string coercion
Refs CLO-4280
2026-04-28 04:15:00 +00:00
Damodar Lohani 9637409831 fix: coerce non-string header values in Request::getHeader
Closes CLO-4280
2026-04-28 03:54:35 +00:00
Damodar Lohani c4f6b11706 fix: guard DOMDocument::loadHTML against empty body in favicon endpoint
Closes CLO-4279
2026-04-28 03:54:34 +00:00
Matej Bačo ad4178aa42 Fix missing lib params for domain 2026-04-27 18:33:30 +02:00
Matej Bačo 1f16b0d9e7 Fix failing startup 2026-04-27 18:21:21 +02:00
Matej Bačo 015aee087a Fix write only security 2026-04-27 18:04:22 +02:00
Matej Bačo 50d86c5b5d Update ci.yml 2026-04-27 17:45:52 +02:00
Matej Bačo 3d43530225 Fix failing test 2026-04-27 17:41:13 +02:00
Matej Bačo d0d536a2dd Improve test coverage 2026-04-27 17:40:49 +02:00
Matej Bačo 4b620bb31a Improve test coverage 2026-04-27 17:27:23 +02:00
Matej Bačo ca7f36a9b8 Fix bugs by improving tests 2026-04-27 17:17:57 +02:00
Matej Bačo ec3c7f1ad6 Fix failing oauth tests 2026-04-27 17:02:53 +02:00
Matej Bačo ecba11eba5 Brin back removed tests 2026-04-27 16:54:53 +02:00
Matej Bačo 7a96b024b3 Fix tests 2026-04-27 16:51:01 +02:00
Matej Bačo 4ba413fcc0 Fix bugs when implementing tests 2026-04-27 16:50:14 +02:00
Matej Bačo af95e71244 Add OAUth update tests 2026-04-27 16:02:19 +02:00
Matej Bačo ee1eea5c0c oauth tests setup 2026-04-27 15:51:54 +02:00
Matej Bačo b28b851bb2 microsoft oauth endpoint 2026-04-27 15:49:44 +02:00
Matej Bačo a781325679 Add oauth read operations 2026-04-27 14:47:47 +02:00
Matej Bačo 2e57500d7e WIP: Read endpoints for oauth 2026-04-27 14:16:43 +02:00
Matej Bačo a1a88ae57e Make oauth secret write only 2026-04-27 14:09:24 +02:00
Matej Bačo 15f94d99ca Add Kick OAuth adapter 2026-04-27 14:02:30 +02:00
Matej Bačo 2e960b90df Fix unused env variable 2026-04-27 13:38:26 +02:00
Matej Bačo 8ce7aa2abe Fix crashing http 2026-04-27 12:27:52 +02:00
Matej Bačo e4bfb38a57 add okta provider 2026-04-26 11:14:50 +02:00
Matej Bačo 0a7b7de197 Revert changes - default works as fallback for optional serverID 2026-04-26 10:59:29 +02:00
Matej Bačo 51c0767be2 Make okta server ID optional 2026-04-26 10:56:41 +02:00
Matej Bačo d25dac7d60 Manual quality improvmenets 2026-04-26 10:29:41 +02:00
Matej BačoandGitHub 1f18e16310 Merge branch '1.9.x' into feat-public-oauth2-endpoints 2026-04-25 12:45:34 +02:00
Matej Bačo d0f6daa67a Fix integration test 2026-04-25 12:05:35 +02:00
Matej Bačo 184399023c Add github integration test 2026-04-25 11:58:09 +02:00