Skip to content

Commit 89f4677

Browse files
committed
(chore) format output of api keys listing
1 parent 7cf7135 commit 89f4677

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

backend/src/api/keys/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export const listKeys = async (req: Request, res: Response): Promise<void> => {
1010
const keys = await AppDataSource.getRepository(ApiKey).find()
1111
return ApiResponseHandler.success(
1212
res,
13-
keys.map(v => "metlo." + v.keyIdentifier),
13+
keys.map(v => ({
14+
name: v.name,
15+
identifier: `metlo.${v.keyIdentifier}`,
16+
created: v.createdAt
17+
})),
1418
)
1519
}
1620

common/src/types.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ export interface STEP_RESPONSE<T extends ConnectionType = ConnectionType> {
358358
err: string
359359
}
360360
data: CONNECTIONS_BASE &
361-
(T extends ConnectionType.AWS
362-
? Partial<AWS_CONNECTION & AWS_CONNECTION_MISC & SSH_INFO>
363-
: T extends ConnectionType.GCP
364-
? Partial<GCP_CONNECTION & GCP_CONNECTION_MISC>
365-
: never)
361+
(T extends ConnectionType.AWS
362+
? Partial<AWS_CONNECTION & AWS_CONNECTION_MISC & SSH_INFO>
363+
: T extends ConnectionType.GCP
364+
? Partial<GCP_CONNECTION & GCP_CONNECTION_MISC>
365+
: never)
366366
returns?: {
367367
os_types?: [{ name: string; ami: string }]
368368
instance_types?: string[]
@@ -485,4 +485,10 @@ export interface ConnectionInfo {
485485
export interface MinimizedSpecContext {
486486
lineNumber: number
487487
minimizedSpec: string
488+
}
489+
490+
export interface ApiKey {
491+
name: string
492+
identifier: string
493+
created: string
488494
}

0 commit comments

Comments
 (0)