Commit Graph
1595 Commits
Author SHA1 Message Date
Eric Dubé 4554331eff dev(oidc): redirect to login/signup on error (#2531)
Redirect to the login or signup page when there is an error signing in
or creating an account using OIDC, instead of displaying the error on a
new page. Alter the flow in cases where the suggested action is not the
same as the initial action taken by the user (based on the error case).
2026-02-23 17:56:38 -05:00
Daniel Salazar eda9f117c7 fix: default timeout on user caches of 15 min (#2530)
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-23 14:21:24 -08:00
Daniel Salazar e60f55f20e fix: stricter invalidation for 2fa and confirm email codes (#2528) 2026-02-23 09:01:59 -08:00
P3il4 779321d334 fix nano banana pro pricing and resolutions (#2501)
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 nano banana pro pricing and resolutions

* move gemini resolution map into models.ts

* require gemini 3 model for specific resolution and price logic

* fix usageamount for mp models
2026-02-23 03:39:48 -05:00
Daniel Salazar 9f87ccb460 fix: cleanup some app es and app service validation (#2523)
we saw some errors with icons not allowed when being objects, this likely user error, but this adds some validation to at least avoid nulls being flagged wrong
2026-02-21 00:10:55 -08:00
Daniel Salazar 3834571ab8 fix: don't call stat on each file in dir (#2522)
* fix: decrease metering service gloabl rate of change check

* fix: don't call stat on each file in dir
2026-02-20 19:07:16 -08:00
Daniel Salazar d418976ee4 perf: batching get_apps cache look ups (#2521)
should not be slow in any case, but this should help a bit more with speed in trade of more ram and cpu usage
2026-02-20 18:02:47 -08:00
Daniel Salazar 3b32b4a437 fix: don't await for cache writes (#2519)
* fix: allow healthcheck from other hosts

* fix: don't await for cache writes

we think some awaiting on redis writes was causing issues, we shouldn't need to await really, so removing now. will have optimistic caching for these

some style changes from a recently changed rule that seems to clash with prior one
2026-02-20 17:19:01 -08:00
KernelDeimos ef0a665a5f fix(oidc): add code lost due to editing a .js
This code was previously lost because I edited `outcomeutil.js` instead
of `outcomeutil.ts`. We're not building into a `dist/` directory and
`tsc` has a most peculiar lack of generating a comment at the top of
output files stating something like "// GENERATED - DO NOT EDIT" as I've
seen from every other code generator or transpiler I've worked with.

This caused the bug with duplicate confirmed emails and "account not
found" during testing on the staging server.
2026-02-19 21:25:24 -05:00
Daniel Salazar b39bbe0a0a Merge remote-tracking branch 'origin/main' into eric/262A0_PUT-453 2026-02-19 16:45:10 -08:00
Daniel Salazar 2e7765004c fix: redis cache deletions (#2518) 2026-02-19 16:43:56 -08:00
Daniel Salazar 0cca9d5535 fix : import 2026-02-19 16:08:48 -08:00
KernelDeimos 1be3eca335 fix: rate limits for oidc too extreme 2026-02-19 19:00:01 -05:00
Daniel Salazar 7493573c61 Merge remote-tracking branch 'origin/main' into eric/262A0_PUT-453 2026-02-19 15:28:14 -08:00
Daniel Salazar ec412eaff6 feat: cleanup cache invalidation and pull out keys to be easily used in other places that need the same cache (#2515)
fix: tests
2026-02-19 15:07:04 -08:00
KernelDeimos 4e01608e4a dev: remove guarded debug log 2026-02-19 17:02:33 -05:00
KernelDeimos b3b32980db clean(oidc): remove jwt remap in ESM code 2026-02-19 16:32:41 -05:00
KernelDeimos f3bf40a3c0 style(oidc): rename httpPowers to hasHttpOnlyCookie 2026-02-19 16:29:19 -05:00
KernelDeimos 4de6d38604 style(oidc): make this a private method 2026-02-19 16:23:40 -05:00
KernelDeimos 4c518830ea clean(oidc): remove "ghost files" 2026-02-19 16:23:40 -05:00
KernelDeimos b5d719e110 lint: [+] no-useless-computed-key:error 2026-02-19 16:23:38 -05:00
KernelDeimos c97a499bc9 style(oidc): private members in OIDCService 2026-02-19 16:21:43 -05:00
KernelDeimos 16f2f5bf5f style(oidc): address PR rev on oidcCallbackPreamble_ 2026-02-19 16:21:42 -05:00
KernelDeimos 720277c9bd style(oidc): migrate cjs to esm 2026-02-19 16:21:42 -05:00
KernelDeimos ccecf0a86e fix(oidc): remove generated source file
I forgot that our transpile tooling requires manually gitignoring
individual javascript files because we don't actually create a full
generated build of backend.
2026-02-19 16:21:42 -05:00
KernelDeimos 8d18ee527c refactor(oidc): address review comment
https://github.com/HeyPuter/puter/pull/2460/changes#r2819861213
2026-02-19 16:21:42 -05:00
KernelDeimos 7858f5ba3e fix(oidc): add error log for QR login flow 2026-02-19 16:21:42 -05:00
KernelDeimos a2b9193287 clean(oidc): remove temporary debugging logs
These logs were temporary. I have a pre-merge TODO list item that says
to remove these. They were caught in review so I'm removing them early.
2026-02-19 16:21:42 -05:00
KernelDeimos d0c2e9b7fc fix(oidc): rate-limit identity for username 2026-02-19 16:21:41 -05:00
KernelDeimos 42d3f9e816 fix(oidc): http-only cookie sync for switch user 2026-02-19 16:21:41 -05:00
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