Skip to content

Commit

Permalink
(chore) format output of api keys listing
Browse files Browse the repository at this point in the history
  • Loading branch information
AHarmlessPyro committed Oct 4, 2022
1 parent 7cf7135 commit 89f4677
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion backend/src/api/keys/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const listKeys = async (req: Request, res: Response): Promise<void> => {
const keys = await AppDataSource.getRepository(ApiKey).find()
return ApiResponseHandler.success(
res,
keys.map(v => "metlo." + v.keyIdentifier),
keys.map(v => ({
name: v.name,
identifier: `metlo.${v.keyIdentifier}`,
created: v.createdAt
})),
)
}

Expand Down
16 changes: 11 additions & 5 deletions common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ export interface STEP_RESPONSE<T extends ConnectionType = ConnectionType> {
err: string
}
data: CONNECTIONS_BASE &
(T extends ConnectionType.AWS
? Partial<AWS_CONNECTION & AWS_CONNECTION_MISC & SSH_INFO>
: T extends ConnectionType.GCP
? Partial<GCP_CONNECTION & GCP_CONNECTION_MISC>
: never)
(T extends ConnectionType.AWS
? Partial<AWS_CONNECTION & AWS_CONNECTION_MISC & SSH_INFO>
: T extends ConnectionType.GCP
? Partial<GCP_CONNECTION & GCP_CONNECTION_MISC>
: never)
returns?: {
os_types?: [{ name: string; ami: string }]
instance_types?: string[]
Expand Down Expand Up @@ -485,4 +485,10 @@ export interface ConnectionInfo {
export interface MinimizedSpecContext {
lineNumber: number
minimizedSpec: string
}

export interface ApiKey {
name: string
identifier: string
created: string
}

0 comments on commit 89f4677

Please sign in to comment.