diff --git a/api/src/graphql/generated/api/operations.ts b/api/src/graphql/generated/api/operations.ts index d4a193d92..751621237 100755 --- a/api/src/graphql/generated/api/operations.ts +++ b/api/src/graphql/generated/api/operations.ts @@ -323,7 +323,6 @@ export function ContainerPortSchema(): z.ZodObject> { export function CreateApiKeyInputSchema(): z.ZodObject> { return z.object({ description: z.string().nullish(), - memory: z.boolean().nullish(), name: z.string(), overwrite: z.boolean().nullish(), permissions: z.array(z.lazy(() => AddPermissionInputSchema())).nullish(), diff --git a/api/src/graphql/generated/api/types.ts b/api/src/graphql/generated/api/types.ts index 8137395b7..faaf57df1 100644 --- a/api/src/graphql/generated/api/types.ts +++ b/api/src/graphql/generated/api/types.ts @@ -347,8 +347,6 @@ export enum ContainerState { export type CreateApiKeyInput = { description?: InputMaybe; - /** Whether to create the key in memory only (true), or on disk (false) - memory only keys will not persist through reboots of the API */ - memory?: InputMaybe; name: Scalars['String']['input']; /** This will replace the existing key if one already exists with the same name, otherwise returns the existing key */ overwrite?: InputMaybe; diff --git a/api/src/graphql/schema/types/api-key/api-key.graphql b/api/src/graphql/schema/types/api-key/api-key.graphql index 141fc8b8d..b35f8c6b1 100644 --- a/api/src/graphql/schema/types/api-key/api-key.graphql +++ b/api/src/graphql/schema/types/api-key/api-key.graphql @@ -29,8 +29,6 @@ input CreateApiKeyInput { permissions: [AddPermissionInput!] """ This will replace the existing key if one already exists with the same name, otherwise returns the existing key """ overwrite: Boolean - """ Whether to create the key in memory only (true), or on disk (false) - memory only keys will not persist through reboots of the API """ - memory: Boolean } input AddPermissionInput { diff --git a/api/src/unraid-api/auth/api-key.service.ts b/api/src/unraid-api/auth/api-key.service.ts index e8bd34d40..4607f0962 100644 --- a/api/src/unraid-api/auth/api-key.service.ts +++ b/api/src/unraid-api/auth/api-key.service.ts @@ -103,14 +103,12 @@ export class ApiKeyService implements OnModuleInit { roles, permissions, overwrite = false, - memory = false, }: { name: string; description: string | undefined; roles?: Role[]; permissions?: Permission[] | AddPermissionInput[]; overwrite?: boolean; - memory?: boolean; }): Promise { const trimmedName = name?.trim(); const sanitizedName = this.sanitizeName(trimmedName); @@ -144,11 +142,7 @@ export class ApiKeyService implements OnModuleInit { // Update createdAt date apiKey.createdAt = new Date().toISOString(); - if (memory) { - this.memoryApiKeys.push(apiKey as ApiKeyWithSecret) - } else { - await this.saveApiKey(apiKey as ApiKeyWithSecret); - } + await this.saveApiKey(apiKey as ApiKeyWithSecret); return apiKey as ApiKeyWithSecret; } diff --git a/api/src/unraid-api/graph/resolvers/api-key/api-key.resolver.ts b/api/src/unraid-api/graph/resolvers/api-key/api-key.resolver.ts index 912104887..19e9f4301 100644 --- a/api/src/unraid-api/graph/resolvers/api-key/api-key.resolver.ts +++ b/api/src/unraid-api/graph/resolvers/api-key/api-key.resolver.ts @@ -60,7 +60,6 @@ export class ApiKeyResolver { description: input.description ?? undefined, roles: input.roles ?? [], permissions: input.permissions ?? [], - memory: input.memory ?? false, overwrite: input.overwrite ?? false });