This commit is contained in:
Morten Olsen
2025-10-23 13:47:07 +02:00
commit b851dc3006
91 changed files with 7578 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare type ExplicitAny = any;

View File

@@ -0,0 +1,24 @@
import { z } from "@morten-olsen/box-k8s";
const valueOrSecret = z.object({
value: z.string().optional(),
secret: z.string().optional(),
key: z.string().optional(),
});
const serverSpec = z.object({
allowedNamespaces: z.array(z.string()).optional(),
domain: z.string(),
storageClass: z.string().optional(),
redis: z.object({
url: valueOrSecret,
}),
database: z.object({
url: valueOrSecret,
}),
clients: z.object({
substitutions: z.record(z.string(), z.string()).optional()
}).optional(),
});
export { serverSpec };

View File

@@ -0,0 +1,27 @@
import { CustomResource, Secret, type CustomResourceOptions } from "@morten-olsen/box-k8s";
import { serverSpec } from "./server.schemas.js";
import { API_VERSION } from '@morten-olsen/box-utils/consts';
type SecretData = {
secret: string;
};
class AuthentikServer extends CustomResource<typeof serverSpec> {
public static readonly apiVersion = API_VERSION;
public static readonly kind = 'AuthentikServer';
public static readonly spec = serverSpec;
public static readonly scope = 'Namespaced';
#secret: Secret<SecretData>;
constructor(options: CustomResourceOptions<typeof serverSpec>) {
super(options);
this.#secret = this.resources.get(Secret<SecretData>, `${this.name}-secret`, this.namespace);
this.#secret.on('changed', this.queueReconcile);
}
public reconcile = async () => {
};
}
export { AuthentikServer }