Commit Graph
1565 Commits
Author SHA1 Message Date
KernelDeimos 298f1cdb42 fix: incorrect accessor reference in OIDCService
During development a property named `success` was inverted to a property
named `failed` which resulted in an incorrect accessor reference with a
referring piece of code that wasn't updated. This is type error.
2026-02-19 16:21:41 -05:00
KernelDeimos 8ecd6cd13e dev(oidc): confirm email by default for OIDC 2026-02-19 16:13:45 -05:00
KernelDeimos e2068e7b9c fix(oidc): fix QR code login issues caused by OIDC
In implementing OIDC it became necessary to introduce the separation of
"GUI Tokens" and "Session Tokens". This breaks QR login because Puter
does not set the HTTP-only session cookie when logging in with this
flow.

Add a middelware to WebServerService to detect QR Code logins and set
the appropriate HTTP-only session cookie.
2026-02-19 16:13:44 -05:00
KernelDeimos 3a9a345600 tweak: make monthly username changes configurable
The monthly number of username changes was hardcoded as `2`. Being able
to configure this value makes it easier to test the username change
flow. Hosters of OSS Puter may also find this configuration beneficial.
2026-02-19 16:10:21 -05:00
KernelDeimos d532b3d47b fix(oidc): session token vs gui token issues 2026-02-19 16:10:21 -05:00
KernelDeimos 5d22ee0517 tweak: re-enable re-auth popup closing 2026-02-19 16:10:21 -05:00
KernelDeimos 4374281070 dev: add re-authentication flow for protect actions
When users make sensitive changes to their account they are asked to
re-enter their password. This prevents a hijacked session from causing
futher damage.

Users created with the new OIDC flow do not necessarily have a password
set on their account, and they need to also be able to make these
changes. While removal of the password entry requirement for these users
would solve this problem, it would also make their accounts more
vulnerable. To solve this problem while maintaining the same security
standard for OIDC users, we need them to confirm via either 2FA or
re-authentication via OIDC. Since users aren't required to have 2FA, the
re-authentication via OIDC approach is also the minimum viable solution.

This commit adds OIDC re-authentication support for all endpoints under
UserProtectedEndpointsService, and makes updates to the
UIWindowChangeUsername dialog for manual testing.

Currently this implementation fails at the final submission to change
the username because of a separate issue with the correct authentication
token not being set; this is related to the separation of GUI tokens vs
http-only tokens.
2026-02-19 16:10:21 -05:00
KernelDeimos 7c8f0d5572 dev(backend): OIDC continued [1]
This commit is rather monolithic. An attempt to split it up into smaller
changes proved too difficult (as well as frustrating) and I realized it
would absolutely increase the chance of having a broken commit (making
bisects more difficult) unless a lot of testing effort between commits
was performed, which would have very little benefit.

The changes in this commit include:
- Outcome utility used by SignupService for error handling
- SignupService, whichs implements re-usable create_user function
- Signup method in OIDCService
- flow-specific callbacks in OIDC (separates login from signup)
- **SEPARATE SESSION COOKIE AND GUI COOKIE**
  - this change "rocks the boat" the most and has the highest likelihood
    of causing problems
2026-02-19 16:10:21 -05:00
KernelDeimos 47b133d512 dev(backend): incomplete oauth2 OIDC impl 2026-02-19 16:10:20 -05:00
Neal Shah 78a4ccb9a4 make image models case insensitive for backwards compatibility reasons (#2512)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-02-18 17:01:50 -05:00
KernelDeimos cecb63b372 fix(backend): ESM/CJS interop is sad
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Fix ESM/CJS interop issue in unit tests with a hack that checks the
class name as a string instead of just doing an `instanceof` check. This
is assuming that the "rewriter must be a PermissionRewriter" error I'm
seeing on GitHub is because there are two different "copies" of
PermissionWriter due to ESM/CJS interop issues. If this is not the case,
then you're not reading this commit message on `main`; if this commit is
on `main` then that's exactly what went down.
2026-02-17 22:19:52 -05:00
KernelDeimos bfff2d20f9 dev(backend): add /auth/request-app-root-dir
Add the ability to request an app's root directory. A permission
rewriter is provided so that apps may refer to a permission when
requesting this access without knowing the path of the app's root
directory.
2026-02-17 22:19:52 -05:00
KernelDeimos d21ed31d67 dev(backend): add debug mode for 403 responses 2026-02-17 22:19:52 -05:00
Daniel Salazar 5df1ca88ca feat: sonnet-4.6 support (#2506)
* feat: sonnet-4.6 support

* fix: tests
2026-02-17 12:10:50 -08:00
Neal Shah 4279cd92df WebDAV don't fetch thumbs or associated apps (#2505)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-02-17 01:53:59 -05:00
Neal Shah 2fe4ed50c3 WebDAV don't fetch subdomains (#2504) 2026-02-17 01:47:43 -05:00
Daniel Salazar 00befdc192 fix: allow b64 srings without mime type for app icons (#2502) 2026-02-16 19:28:44 -08:00
Daniel Salazar 44bb5953b4 fix: app icon origin (#2500)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* fix: app icon origin

* fix: app icon origin size
2026-02-16 12:35:30 -08:00
Daniel Salazar 32682e73eb perf: improve app open time (#2490)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-02-16 11:00:32 -08:00
KernelDeimos d9167744ef patch(puterfs): limit directory depth to 35
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
This is a temporary measure while we fix a production issue.
2026-02-13 20:53:56 -05:00
Neal Shah c87506c7d8 workers ai realias - to dot (#2493) 2026-02-13 16:40:10 -08:00
Neal Shah a211aa04bc add more alises (#2491) 2026-02-13 13:46:42 -08:00
Neal Shah f65ab05b40 Add workers AI image model support (#2489) 2026-02-13 13:07:50 -08:00
Daniel Salazar 809d375854 fix: don't stream back bytes for icons (#2486)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* decrease global check alerts

* fix: don't stream back bytes for icons
2026-02-12 23:34:37 -08:00
Daniel Salazar 4136cb1d24 fix: do not await for puter icon write in db (#2485) 2026-02-12 22:43:23 -08:00
Daniel Salazar 354ac314a9 feat: subdomain error redirect (#2483) 2026-02-12 15:39:18 -08:00
Daniel Salazar 1292148b41 fix: app-icons protocol (#2480) 2026-02-12 13:47:23 -08:00
jelveh 9991d58613 Refine 'listing-rejected' email copy 2026-02-12 12:49:13 -08:00
Daniel Salazar 8a6d07ec1f fix: app icon again (#2478) 2026-02-12 12:07:03 -08:00
Daniel Salazar bfd8a4e16d fix: app icons saving (#2477) 2026-02-12 11:55:27 -08:00
Neal Shah 36b1499819 Ns/workers in stat attempt 2 (#2476)
* worker in stat

* add returnWorkers to stat

* workers in readdir
2026-02-12 10:45:22 -08:00
Neal Shah b209a94a80 dedup image models (#2475) 2026-02-12 10:39:23 -08:00
Daniel Salazar 1d22ab5fb7 cleanup: remove thumbnail service for client side thumbnails (#2468)
* cleanup: remove thumbnail service for client side thumbnails

* fix: emit thumbnail create event and not just use raw data

* fix: broken test
2026-02-11 17:12:47 -08:00
jelveh cbab7a30e2 Emit user signup success event
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-02-11 16:53:31 -08:00
Daniel Salazar d7a3f61902 fix: false alarm from openrouter (#2470) 2026-02-11 16:49:42 -08:00
Neal Shah d024fdda0d Add cache tokens for grok 3 mini fast (#2469) 2026-02-11 16:49:12 -08:00
Daniel Salazar 0a594bdfc3 fix: metering alerts for missing costs (#2466) 2026-02-11 15:03:23 -08:00
Neal Shah 81c88c1434 add extra model details, update grok models (#2465) 2026-02-11 13:55:20 -08:00
Daniel Salazar afeac494ac feat: remove file cache service (#2464) 2026-02-11 12:57:10 -08:00
Daniel Salazar 512986880b feat: app icons in subdomain (#2461)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* feat: app icons in subdomain

* fix: imports

* fix: icon location
2026-02-10 19:04:15 -08:00
Neal Shah 56ee3d23df Ns/web dav range fixes (#2459)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* better calculation for ContentLength

* lets try that again
2026-02-10 16:11:01 -08:00
Neal Shah 4f84decdec fix tool call blank content (#2458) 2026-02-10 14:14:27 -08:00
Neal Shah e55829623f Revert "allow empty message (#2455)" (#2457)
This reverts commit 7880ade5d7.
2026-02-10 14:01:31 -08:00
Daniel Salazar 5e8ce3a021 fix: decrease large error log from wrong model (#2456)
* [PUT-471] feat: estimate and bill input for gemini imgaes :dev:

* fix: decrease large error log from wrong model
2026-02-10 13:36:35 -08:00
Neal Shah 7880ade5d7 allow empty message (#2455) 2026-02-10 12:53:56 -08:00
Daniel SalazarandProgrammerIn-wonderland 91afa2c356 [PUT-471] feat: estimate and bill input for gemini imgaes :dev: (#2453)
* [PUT-471] feat: estimate and bill input for gemini imgaes :dev:

* [PUT-472] add input/output costs to openai image models too

* npm version bump

* remove second url log

* fix gemini pro image

---------

Co-authored-by: ProgrammerIn-wonderland <3838shah@gmail.com>
2026-02-10 12:52:33 -08:00
Neal Shah 4fb84bc117 add configurable backend (#2452)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-02-09 21:47:12 -08:00
KernelDeimos e5750d8eb7 fix: add explicit handling for access token in ACL
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
For reasons still unknown, there are circumstances where the permission
scanner denies permission to access tokens that should have been granted
permission. This change de-abstracts/flattens the logic for checking
access tokens so that it is easier to understand and maintain. The newly
implemented code does not suffer from the same issue.
2026-02-09 18:26:03 -05:00
Reynaldi Chernando e2ccaadf2f Fix gemini 3 pro image model name (#2450) 2026-02-09 12:24:40 -08:00
Daniel Salazar f9805dfffb fix: decrease log usage (#2449) 2026-02-08 22:26:23 -08:00