Skip to content

Commit b84db13

Browse files
committed
fix: remove memory key generation
1 parent 36d630e commit b84db13

File tree

5 files changed

+1
-13
lines changed

5 files changed

+1
-13
lines changed

api/src/graphql/generated/api/operations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ export function ContainerPortSchema(): z.ZodObject<Properties<ContainerPort>> {
323323
export function CreateApiKeyInputSchema(): z.ZodObject<Properties<CreateApiKeyInput>> {
324324
return z.object({
325325
description: z.string().nullish(),
326-
memory: z.boolean().nullish(),
327326
name: z.string(),
328327
overwrite: z.boolean().nullish(),
329328
permissions: z.array(z.lazy(() => AddPermissionInputSchema())).nullish(),

api/src/graphql/generated/api/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,6 @@ export enum ContainerState {
347347

348348
export type CreateApiKeyInput = {
349349
description?: InputMaybe<Scalars['String']['input']>;
350-
/** Whether to create the key in memory only (true), or on disk (false) - memory only keys will not persist through reboots of the API */
351-
memory?: InputMaybe<Scalars['Boolean']['input']>;
352350
name: Scalars['String']['input'];
353351
/** This will replace the existing key if one already exists with the same name, otherwise returns the existing key */
354352
overwrite?: InputMaybe<Scalars['Boolean']['input']>;

api/src/graphql/schema/types/api-key/api-key.graphql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ input CreateApiKeyInput {
2929
permissions: [AddPermissionInput!]
3030
""" This will replace the existing key if one already exists with the same name, otherwise returns the existing key """
3131
overwrite: Boolean
32-
""" Whether to create the key in memory only (true), or on disk (false) - memory only keys will not persist through reboots of the API """
33-
memory: Boolean
3432
}
3533

3634
input AddPermissionInput {

api/src/unraid-api/auth/api-key.service.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,12 @@ export class ApiKeyService implements OnModuleInit {
103103
roles,
104104
permissions,
105105
overwrite = false,
106-
memory = false,
107106
}: {
108107
name: string;
109108
description: string | undefined;
110109
roles?: Role[];
111110
permissions?: Permission[] | AddPermissionInput[];
112111
overwrite?: boolean;
113-
memory?: boolean;
114112
}): Promise<ApiKeyWithSecret> {
115113
const trimmedName = name?.trim();
116114
const sanitizedName = this.sanitizeName(trimmedName);
@@ -144,11 +142,7 @@ export class ApiKeyService implements OnModuleInit {
144142
// Update createdAt date
145143
apiKey.createdAt = new Date().toISOString();
146144

147-
if (memory) {
148-
this.memoryApiKeys.push(apiKey as ApiKeyWithSecret)
149-
} else {
150-
await this.saveApiKey(apiKey as ApiKeyWithSecret);
151-
}
145+
await this.saveApiKey(apiKey as ApiKeyWithSecret);
152146

153147
return apiKey as ApiKeyWithSecret;
154148
}

api/src/unraid-api/graph/resolvers/api-key/api-key.resolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class ApiKeyResolver {
6060
description: input.description ?? undefined,
6161
roles: input.roles ?? [],
6262
permissions: input.permissions ?? [],
63-
memory: input.memory ?? false,
6463
overwrite: input.overwrite ?? false
6564
});
6665

0 commit comments

Comments
 (0)