mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 00:35:38 +02:00
feat: Start working on Auth
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actor-core/bun": "^0.8.0",
|
"@actor-core/bun": "^0.8.0",
|
||||||
"@actor-core/file-system": "^0.8.0",
|
"@actor-core/file-system": "^0.8.0",
|
||||||
|
"@openauthjs/openauth": "catalog:",
|
||||||
"@aws-sdk/client-lambda": "^3.821.0",
|
"@aws-sdk/client-lambda": "^3.821.0",
|
||||||
"@aws-sdk/client-s3": "^3.806.0",
|
"@aws-sdk/client-s3": "^3.806.0",
|
||||||
"@aws-sdk/client-sqs": "^3.806.0",
|
"@aws-sdk/client-sqs": "^3.806.0",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { AccountApi } from "./account";
|
|||||||
import { openAPISpecs } from "hono-openapi";
|
import { openAPISpecs } from "hono-openapi";
|
||||||
import { patchLogger } from "../utils/patch-logger";
|
import { patchLogger } from "../utils/patch-logger";
|
||||||
import { HTTPException } from "hono/http-exception";
|
import { HTTPException } from "hono/http-exception";
|
||||||
import { handle, streamHandle } from "hono/aws-lambda";
|
|
||||||
import { ErrorCodes, VisibleError } from "@nestri/core/error";
|
import { ErrorCodes, VisibleError } from "@nestri/core/error";
|
||||||
|
|
||||||
patchLogger();
|
patchLogger();
|
||||||
@@ -21,7 +20,7 @@ app
|
|||||||
c.header("Cache-Control", "no-store");
|
c.header("Cache-Control", "no-store");
|
||||||
return next();
|
return next();
|
||||||
})
|
})
|
||||||
.use(auth)
|
.use(auth);
|
||||||
|
|
||||||
const routes = app
|
const routes = app
|
||||||
.get("/", (c) => c.text("Hello World!"))
|
.get("/", (c) => c.text("Hello World!"))
|
||||||
@@ -64,7 +63,8 @@ app.get(
|
|||||||
documentation: {
|
documentation: {
|
||||||
info: {
|
info: {
|
||||||
title: "Nestri API",
|
title: "Nestri API",
|
||||||
description: "The Nestri API gives you the power to run your own customized cloud gaming platform.",
|
description:
|
||||||
|
"The Nestri API gives you the power to run your own customized cloud gaming platform.",
|
||||||
version: "0.0.1",
|
version: "0.0.1",
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -74,11 +74,11 @@ app.get(
|
|||||||
scheme: "bearer",
|
scheme: "bearer",
|
||||||
bearerFormat: "JWT",
|
bearerFormat: "JWT",
|
||||||
},
|
},
|
||||||
TeamID: {
|
SteamID: {
|
||||||
type: "apiKey",
|
type: "apiKey",
|
||||||
description: "The steam ID to use for this query",
|
description: "The steam ID to use for this query",
|
||||||
in: "header",
|
in: "header",
|
||||||
name: "x-nestri-steam"
|
name: "x-nestri-steam",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -93,4 +93,4 @@ app.get(
|
|||||||
|
|
||||||
export type Routes = typeof routes;
|
export type Routes = typeof routes;
|
||||||
|
|
||||||
export const handler = process.env.SST_LIVE ? handle(app) : streamHandle(app);
|
export default app;
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -17,21 +17,23 @@
|
|||||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||||
"sso": "aws sso login --sso-session=nestri --no-browser --use-device-code"
|
"sso": "aws sso login --sso-session=nestri --no-browser --use-device-code"
|
||||||
},
|
},
|
||||||
"overrides": {
|
|
||||||
"@openauthjs/openauth": "0.4.3",
|
|
||||||
"steam-session": "1.9.3"
|
|
||||||
},
|
|
||||||
"trustedDependencies": [
|
"trustedDependencies": [
|
||||||
"core-js-pure",
|
"core-js-pure",
|
||||||
"esbuild",
|
"esbuild",
|
||||||
"protobufjs",
|
"protobufjs",
|
||||||
"workerd"
|
"workerd"
|
||||||
],
|
],
|
||||||
"workspaces": [
|
"workspaces": {
|
||||||
|
"packages": [
|
||||||
"apps/*",
|
"apps/*",
|
||||||
"packages/*",
|
"packages/*",
|
||||||
"cloud/packages/*"
|
"cloud/packages/*"
|
||||||
],
|
],
|
||||||
|
"catalog": {
|
||||||
|
"@openauthjs/openauth": "0.0.0-20250322224806",
|
||||||
|
"steam-session": "1.9.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sst": "^3.17.13"
|
"sst": "^3.17.13"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user