mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 00:26:01 +00:00
test secrets extraction
This commit is contained in:
@@ -46,20 +46,6 @@ export const guardRoleSchema = s.strictObject({
|
||||
implicit_allow: s.boolean().optional(),
|
||||
});
|
||||
|
||||
const a = s.record(strategiesSchema, {
|
||||
// ^?
|
||||
title: "Strategies",
|
||||
default: {
|
||||
password: {
|
||||
type: "password",
|
||||
enabled: true,
|
||||
config: {
|
||||
hashing: "sha256",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const authConfigSchema = s.strictObject(
|
||||
{
|
||||
enabled: s.boolean({ default: false }),
|
||||
@@ -85,9 +71,7 @@ export const authConfigSchema = s.strictObject(
|
||||
},
|
||||
{ title: "Authentication" },
|
||||
);
|
||||
const b = authConfigSchema.properties.basepath;
|
||||
// ^?
|
||||
const c = authConfigSchema.properties.strategies;
|
||||
// ^?
|
||||
|
||||
export type AppAuthJWTConfig = s.Static<typeof jwtConfig>;
|
||||
|
||||
export type AppAuthSchema = s.Static<typeof authConfigSchema>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { CookieOptions } from "hono/utils/cookie";
|
||||
import type { ServerEnv } from "modules/Controller";
|
||||
import { pick } from "lodash-es";
|
||||
import { InvalidConditionsException } from "auth/errors";
|
||||
import { s, parse } from "core/object/schema";
|
||||
import { s, parse, secret } from "core/object/schema";
|
||||
|
||||
type Input = any; // workaround
|
||||
export type JWTPayload = Parameters<typeof sign>[0];
|
||||
@@ -72,7 +72,7 @@ export const jwtConfig = s
|
||||
.object(
|
||||
{
|
||||
// @todo: autogenerate a secret if not present. But it must be persisted from AppAuth
|
||||
secret: s.string({ default: "" }),
|
||||
secret: secret({ default: "" }),
|
||||
alg: s.string({ enum: ["HS256", "HS384", "HS512"], default: "HS256" }).optional(),
|
||||
expires: s.number().optional(), // seconds
|
||||
issuer: s.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user