generated from cobaltcore-dev/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): connect bff to apis (#83)
* feat(dashboard): connect bff to api * feat(dashboard): connect bff to api
- Loading branch information
Showing
31 changed files
with
176 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Compute/components/ServerCardView.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Compute/components/ServerCardView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Compute/components/ServerListView.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Compute/components/ServerListView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Project/components/ProjectCardView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Project/components/ProjectListView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/aurora-portal/src/client/Project/components/ProjectOverviewNavBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
apps/aurora-portal/src/server/Authentication/routers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { tokenRouter } from "./tokenRouter" | ||
|
||
import { auroraRouter } from "../../trpc" | ||
|
||
export const authRouters = { | ||
auth: auroraRouter({ | ||
...tokenRouter, | ||
}), | ||
} |
31 changes: 31 additions & 0 deletions
31
apps/aurora-portal/src/server/Authentication/routers/tokenRouter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { z } from "zod" | ||
import { publicProcedure } from "../../trpc" | ||
|
||
export const tokenRouter = { | ||
token: publicProcedure.query(async ({ ctx }) => { | ||
const token = ctx.openstack?.getToken() | ||
|
||
return token?.tokenData || null | ||
}), | ||
|
||
authToken: publicProcedure.query(async ({ ctx }) => { | ||
const token = ctx.openstack?.getToken() | ||
return token?.authToken || null | ||
}), | ||
|
||
login: publicProcedure | ||
.input(z.object({ user: z.string(), password: z.string(), domainName: z.string() })) | ||
.mutation(async ({ input, ctx }) => { | ||
const openstackSession = await ctx.createSession({ | ||
user: input.user, | ||
password: input.password, | ||
domain: input.domainName, | ||
}) | ||
|
||
return openstackSession.getToken()?.tokenData || null | ||
}), | ||
|
||
logout: publicProcedure.mutation(async ({ ctx }) => { | ||
ctx.terminateSession() | ||
}), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { SignalOpenstackTokenType } from "@cobaltcore-dev/signal-openstack" | ||
|
||
export interface User { | ||
id: number | ||
name: string | ||
} | ||
|
||
export type TokenData = SignalOpenstackTokenType["tokenData"] | ||
export type AuthToken = SignalOpenstackTokenType["authToken"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.