Merge pull request #15596 from Budibase/revert-koa-sess
[Revert] store koa sessions in redis instead of cookies
This commit is contained in:
commit
3f7e5a4ab5
|
@ -62,12 +62,6 @@ http {
|
|||
proxy_connect_timeout 120s;
|
||||
proxy_send_timeout 120s;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# Enable buffering for potentially large OIDC configs
|
||||
proxy_buffering on;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_buffers 4 32k;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
"koa-body": "4.2.0",
|
||||
"koa-compress": "4.0.1",
|
||||
"koa-passport": "4.1.4",
|
||||
"koa-redis": "^4.0.1",
|
||||
"koa-send": "5.0.1",
|
||||
"koa-session": "5.13.1",
|
||||
"koa-static": "5.0.0",
|
||||
|
|
|
@ -311,7 +311,7 @@ describe("/api/global/auth", () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe.skip("GET /api/global/auth/:tenantId/oidc/callback", () => {
|
||||
describe("GET /api/global/auth/:tenantId/oidc/callback", () => {
|
||||
it("logs in", async () => {
|
||||
const email = `${generator.guid()}@example.com`
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ if (process.env.DD_APM_ENABLED) {
|
|||
|
||||
// need to load environment first
|
||||
import env from "./environment"
|
||||
import Application, { Middleware } from "koa"
|
||||
import Application from "koa"
|
||||
import { bootstrap } from "global-agent"
|
||||
import * as db from "./db"
|
||||
import { sdk as proSdk } from "@budibase/pro"
|
||||
|
@ -20,7 +20,6 @@ import {
|
|||
cache,
|
||||
features,
|
||||
} from "@budibase/backend-core"
|
||||
import RedisStore from "koa-redis"
|
||||
|
||||
db.init()
|
||||
import koaBody from "koa-body"
|
||||
|
@ -53,28 +52,7 @@ app.proxy = true
|
|||
app.use(handleScimBody)
|
||||
app.use(koaBody({ multipart: true }))
|
||||
|
||||
const sessionMiddleware: Middleware = async (ctx: any, next: any) => {
|
||||
const redisClient = await new redis.Client(
|
||||
redis.utils.Databases.SESSIONS
|
||||
).init()
|
||||
return koaSession(
|
||||
{
|
||||
// @ts-ignore
|
||||
store: new RedisStore({ client: redisClient.getClient() }),
|
||||
key: "koa:sess",
|
||||
maxAge: 86400000, // one day
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
sameSite: "strict",
|
||||
rolling: true,
|
||||
renew: true,
|
||||
},
|
||||
app
|
||||
)(ctx, next)
|
||||
}
|
||||
|
||||
app.use(sessionMiddleware)
|
||||
|
||||
app.use(koaSession(app))
|
||||
app.use(middleware.correlation)
|
||||
app.use(middleware.pino)
|
||||
app.use(middleware.ip)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
declare module "koa-redis" {}
|
28
yarn.lock
28
yarn.lock
|
@ -2695,13 +2695,6 @@
|
|||
dependencies:
|
||||
regenerator-runtime "^0.14.0"
|
||||
|
||||
"@babel/runtime@^7.8.3":
|
||||
version "7.26.9"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.9.tgz#aa4c6facc65b9cb3f87d75125ffd47781b475433"
|
||||
integrity sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.14.0"
|
||||
|
||||
"@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.25.9", "@babel/template@^7.3.3":
|
||||
version "7.25.9"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016"
|
||||
|
@ -9048,14 +9041,7 @@ co-body@^5.1.1:
|
|||
raw-body "^2.2.0"
|
||||
type-is "^1.6.14"
|
||||
|
||||
co-wrap-all@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/co-wrap-all/-/co-wrap-all-1.0.0.tgz#370ae3e8333510a53f6b2f7fdfbe4568a11b7ecf"
|
||||
integrity sha512-aru6gLi2vTUazr+MxVm3Rv6ST7/EKtFj9BrfkcOrbCO2Qv6LqJdE71m88HhHiBEviKw/ucVrwoGLrq2xHpOsJA==
|
||||
dependencies:
|
||||
co "^4.0.0"
|
||||
|
||||
co@^4.0.0, co@^4.6.0:
|
||||
co@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==
|
||||
|
@ -13191,7 +13177,7 @@ ioredis@5.3.2:
|
|||
redis-parser "^3.0.0"
|
||||
standard-as-callback "^2.1.0"
|
||||
|
||||
ioredis@^4.14.1, ioredis@^4.28.5:
|
||||
ioredis@^4.28.5:
|
||||
version "4.28.5"
|
||||
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.5.tgz#5c149e6a8d76a7f8fa8a504ffc85b7d5b6797f9f"
|
||||
integrity sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A==
|
||||
|
@ -14691,16 +14677,6 @@ koa-pino-logger@4.0.0:
|
|||
dependencies:
|
||||
pino-http "^6.5.0"
|
||||
|
||||
koa-redis@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/koa-redis/-/koa-redis-4.0.1.tgz#57ac1b46d9ab851221a9f4952c1e8d4bf289db40"
|
||||
integrity sha512-o2eTVNo1NBnloeUGhHed5Q2ZvJSLpUEj/+E1/7oH5EmH8WuQ+QLdl/VawkshxdFQ47W1p6V09lM3hCTu7D0YnQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.3"
|
||||
co-wrap-all "^1.0.0"
|
||||
debug "^4.1.1"
|
||||
ioredis "^4.14.1"
|
||||
|
||||
koa-router@^10.0.0:
|
||||
version "10.1.1"
|
||||
resolved "https://registry.yarnpkg.com/koa-router/-/koa-router-10.1.1.tgz#20809f82648518b84726cd445037813cd99f17ff"
|
||||
|
|
Loading…
Reference in New Issue