@cobaltcore-dev/aurora 0.20.3 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/AuthProvider-p1e1DuKU.mjs +69 -0
- package/dist/client/AuthProvider-p1e1DuKU.mjs.map +1 -0
- package/dist/client/{ContentHeader-CIAzorGI.mjs → ContentHeader-BIScbvb4.mjs} +3 -2
- package/dist/client/{ContentHeader-CIAzorGI.mjs.map → ContentHeader-BIScbvb4.mjs.map} +1 -1
- package/dist/client/DeleteFlavorModal-lFMExcq_.mjs +713 -0
- package/dist/client/DeleteFlavorModal-lFMExcq_.mjs.map +1 -0
- package/dist/client/{DeletePcaModal-YUlNw8cw.mjs → DeletePcaModal-Dg9dej-H.mjs} +2 -2
- package/dist/client/{DeletePcaModal-YUlNw8cw.mjs.map → DeletePcaModal-Dg9dej-H.mjs.map} +1 -1
- package/dist/client/{DetailsInfo-Cv3oke-R.mjs → DetailsInfo-DwCo9P1o.mjs} +2 -2
- package/dist/client/{DetailsInfo-Cv3oke-R.mjs.map → DetailsInfo-DwCo9P1o.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-PLN6CWZ9.mjs → FloatingIpActionModals-CDF8LVtX.mjs} +2 -2
- package/dist/client/{FloatingIpActionModals-PLN6CWZ9.mjs.map → FloatingIpActionModals-CDF8LVtX.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-BQM7HOyE.mjs → ImageToastNotifications-Dzq6jNTm.mjs} +2 -2
- package/dist/client/{ImageToastNotifications-BQM7HOyE.mjs.map → ImageToastNotifications-Dzq6jNTm.mjs.map} +1 -1
- package/dist/client/Slot-CWb612-_.mjs +28 -0
- package/dist/client/Slot-CWb612-_.mjs.map +1 -0
- package/dist/client/{_auth-BtRCgHQe.mjs → _auth-Dut7CaMR.mjs} +2 -2
- package/dist/client/{_auth-BtRCgHQe.mjs.map → _auth-Dut7CaMR.mjs.map} +1 -1
- package/dist/client/{_flavorId-BaNJ1CDY.mjs → _flavorId-BMJcnI7H.mjs} +2 -2
- package/dist/client/{_flavorId-BaNJ1CDY.mjs.map → _flavorId-BMJcnI7H.mjs.map} +1 -1
- package/dist/client/{_flavorId-BMX239RH.mjs → _flavorId-DUWdFEMH.mjs} +13 -14
- package/dist/client/{_flavorId-BMX239RH.mjs.map → _flavorId-DUWdFEMH.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-DQFtZNeg.mjs → _floatingIpId-CjQLzpC5.mjs} +2 -2
- package/dist/client/{_floatingIpId-DQFtZNeg.mjs.map → _floatingIpId-CjQLzpC5.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-E6x99cmW.mjs → _floatingIpId-KcWWq9ZW2.mjs} +4 -4
- package/dist/client/_floatingIpId-KcWWq9ZW2.mjs.map +1 -0
- package/dist/client/{_imageId-C2662dZr.mjs → _imageId-BkEpwbCr.mjs} +3 -3
- package/dist/client/{_imageId-C2662dZr.mjs.map → _imageId-BkEpwbCr.mjs.map} +1 -1
- package/dist/client/{_pcaId-CNbmhUF8.mjs → _pcaId-BcwGho7g.mjs} +4 -4
- package/dist/client/{_pcaId-CNbmhUF8.mjs.map → _pcaId-BcwGho7g.mjs.map} +1 -1
- package/dist/client/{_projectId-B4ScifQf.mjs → _projectId-CoMD6nq6.mjs} +3 -3
- package/dist/client/{_projectId-B4ScifQf.mjs.map → _projectId-CoMD6nq6.mjs.map} +1 -1
- package/dist/client/{_projectId-CYq4KZXB.mjs → _projectId-D8FHe0gr.mjs} +3 -3
- package/dist/client/{_projectId-CYq4KZXB.mjs.map → _projectId-D8FHe0gr.mjs.map} +1 -1
- package/dist/client/{_projectId-DxgPaiA7.mjs → _projectId-MjFv839t.mjs} +2 -2
- package/dist/client/{_projectId-DxgPaiA7.mjs.map → _projectId-MjFv839t.mjs.map} +1 -1
- package/dist/client/{_projectId-DJLjspKf.mjs → _projectId-hMtrqW6m.mjs} +24 -23
- package/dist/client/{_projectId-DJLjspKf.mjs.map → _projectId-hMtrqW6m.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-ju2ZSIYe.mjs → _securityGroupId-B5-gJe1u.mjs} +3 -3
- package/dist/client/{_securityGroupId-ju2ZSIYe.mjs.map → _securityGroupId-B5-gJe1u.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-a46ExjsA.mjs → _securityGroupId-fPJWtDPU.mjs} +2 -2
- package/dist/client/{_securityGroupId-a46ExjsA.mjs.map → _securityGroupId-fPJWtDPU.mjs.map} +1 -1
- package/dist/client/{_storageType-BkhbKG_G.mjs → _storageType-CI5f4CsI.mjs} +2 -2
- package/dist/client/{_storageType-BkhbKG_G.mjs.map → _storageType-CI5f4CsI.mjs.map} +1 -1
- package/dist/client/{_storageType-ByLL106s.mjs → _storageType-DePX1Aah.mjs} +3 -3
- package/dist/client/{_storageType-ByLL106s.mjs.map → _storageType-DePX1Aah.mjs.map} +1 -1
- package/dist/client/{aurora-Owys0YMN.mjs → aurora-Dp_NPGe8.mjs} +2 -2
- package/dist/client/{aurora-Owys0YMN.mjs.map → aurora-Dp_NPGe8.mjs.map} +1 -1
- package/dist/client/components/Auth/LoginForm.d.ts +1 -0
- package/dist/client/{flavors-C7PVJUqZ.mjs → flavors-DLxUiBhE.mjs} +2 -2
- package/dist/client/{flavors-C7PVJUqZ.mjs.map → flavors-DLxUiBhE.mjs.map} +1 -1
- package/dist/client/{flavors-Bwjig3k2.mjs → flavors-DkGuWvge.mjs} +11 -12
- package/dist/client/{flavors-Bwjig3k2.mjs.map → flavors-DkGuWvge.mjs.map} +1 -1
- package/dist/client/{floatingips-D98DrjA0.mjs → floatingips-DC5OrR8h.mjs} +3 -3
- package/dist/client/{floatingips-D98DrjA0.mjs.map → floatingips-DC5OrR8h.mjs.map} +1 -1
- package/dist/client/{hooks-BsbKkpZc.mjs → hooks-D0wGUhRF.mjs} +2 -2
- package/dist/client/{hooks-BsbKkpZc.mjs.map → hooks-D0wGUhRF.mjs.map} +1 -1
- package/dist/client/{images-CfBrglGJ.mjs → images-D9nfOtSC.mjs} +5 -5
- package/dist/client/{images-CfBrglGJ.mjs.map → images-D9nfOtSC.mjs.map} +1 -1
- package/dist/client/{images-CD7DNwru.mjs → images-h9i7S4LN.mjs} +2 -2
- package/dist/client/{images-CD7DNwru.mjs.map → images-h9i7S4LN.mjs.map} +1 -1
- package/dist/client/index.js +302 -502
- package/dist/client/index.js.map +1 -1
- package/dist/client/{objects-CEBrL7k-.mjs → objects-B3Z8h4RU.mjs} +2 -2
- package/dist/client/{objects-CEBrL7k-.mjs.map → objects-B3Z8h4RU.mjs.map} +1 -1
- package/dist/client/{objects-DvIxpzGI.mjs → objects-CGOfO00N.mjs} +3 -3
- package/dist/client/{objects-DvIxpzGI.mjs.map → objects-CGOfO00N.mjs.map} +1 -1
- package/dist/client/{pca-ZgGU0UPF.mjs → pca-C7cMT8fW.mjs} +2 -2
- package/dist/client/{pca-ZgGU0UPF.mjs.map → pca-C7cMT8fW.mjs.map} +1 -1
- package/dist/client/{pca-CpMqoF00.mjs → pca-Nppb8aVa.mjs} +5 -5
- package/dist/client/{pca-CpMqoF00.mjs.map → pca-Nppb8aVa.mjs.map} +1 -1
- package/dist/client/routeInfo-CdTRlSxv.mjs +32 -0
- package/dist/client/routeInfo-CdTRlSxv.mjs.map +1 -0
- package/dist/client/routes-Bz4zb2H4.mjs +10 -0
- package/dist/client/routes-Bz4zb2H4.mjs.map +1 -0
- package/dist/client/routes-CaqfgBYu.mjs +112 -0
- package/dist/client/routes-CaqfgBYu.mjs.map +1 -0
- package/dist/client/{securitygroups-BwhVyNmZ.mjs → securitygroups-JMvcJLpb.mjs} +2 -2
- package/dist/client/{securitygroups-BwhVyNmZ.mjs.map → securitygroups-JMvcJLpb.mjs.map} +1 -1
- package/dist/client/store/AuthProvider.d.ts +10 -11
- package/dist/server/index.js +1 -10
- package/package.json +1 -2
- package/dist/client/AuthProvider-Cj_Btfnc.mjs +0 -56
- package/dist/client/AuthProvider-Cj_Btfnc.mjs.map +0 -1
- package/dist/client/DeleteFlavorModal-Dwm0Hh84.mjs +0 -638
- package/dist/client/DeleteFlavorModal-Dwm0Hh84.mjs.map +0 -1
- package/dist/client/_floatingIpId-E6x99cmW.mjs.map +0 -1
- package/dist/client/routeInfo-Ct5r4Gen.mjs +0 -56
- package/dist/client/routeInfo-Ct5r4Gen.mjs.map +0 -1
- package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs +0 -83
- package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs.map +0 -1
|
@@ -3,21 +3,20 @@ import { TokenData } from '../../server/Authentication/types/models';
|
|
|
3
3
|
export type User = TokenData["user"] | null;
|
|
4
4
|
export interface AuthContext {
|
|
5
5
|
isAuthenticated: boolean;
|
|
6
|
-
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: string | null;
|
|
8
|
+
login: (credentials: {
|
|
9
|
+
domain: string;
|
|
10
|
+
user: string;
|
|
11
|
+
password: string;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
success: boolean;
|
|
14
|
+
}>;
|
|
7
15
|
logout: () => Promise<void>;
|
|
8
16
|
user?: User;
|
|
9
17
|
expiresAt?: Date;
|
|
10
18
|
}
|
|
11
|
-
|
|
12
|
-
navigate: (options: {
|
|
13
|
-
to: string;
|
|
14
|
-
search?: Record<string, unknown>;
|
|
15
|
-
}) => void;
|
|
16
|
-
invalidate: () => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function AuthProvider({ children, router }: {
|
|
19
|
+
export declare function AuthProvider({ children }: {
|
|
19
20
|
children: React.ReactNode;
|
|
20
|
-
router: RouterNavigation;
|
|
21
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare function useAuth(): AuthContext;
|
|
23
|
-
export {};
|
package/dist/server/index.js
CHANGED
|
@@ -27925,7 +27925,6 @@ var import_static = __toESM(require("@fastify/static"));
|
|
|
27925
27925
|
var import_vite = __toESM(require("@fastify/vite"));
|
|
27926
27926
|
var import_cookie2 = __toESM(require("@fastify/cookie"));
|
|
27927
27927
|
var import_helmet = __toESM(require("@fastify/helmet"));
|
|
27928
|
-
var import_rate_limit = __toESM(require("@fastify/rate-limit"));
|
|
27929
27928
|
var import_multipart = __toESM(require("@fastify/multipart"));
|
|
27930
27929
|
var import_fastify2 = require("@trpc/server/adapters/fastify");
|
|
27931
27930
|
|
|
@@ -38221,10 +38220,6 @@ async function createServer(config) {
|
|
|
38221
38220
|
server.register(import_cookie2.default, {
|
|
38222
38221
|
secret: void 0
|
|
38223
38222
|
});
|
|
38224
|
-
await server.register(import_rate_limit.default, {
|
|
38225
|
-
max: 200,
|
|
38226
|
-
timeWindow: "1 minute"
|
|
38227
|
-
});
|
|
38228
38223
|
await server.register(import_multipart.default, {
|
|
38229
38224
|
limits: {
|
|
38230
38225
|
fileSize: 5 * 1024 * 1024 * 1024,
|
|
@@ -38238,11 +38233,7 @@ async function createServer(config) {
|
|
|
38238
38233
|
});
|
|
38239
38234
|
server.post(`${bffEndpoint}/upload-image-direct`, {
|
|
38240
38235
|
config: {
|
|
38241
|
-
rawBody: false
|
|
38242
|
-
rateLimit: {
|
|
38243
|
-
max: 10,
|
|
38244
|
-
timeWindow: "1 minute"
|
|
38245
|
-
}
|
|
38236
|
+
rawBody: false
|
|
38246
38237
|
},
|
|
38247
38238
|
bodyLimit: 5 * 1024 * 1024 * 1024
|
|
38248
38239
|
}, async (request, reply) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobaltcore-dev/aurora",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Aurora OpenStack dashboard — server and client library",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"@fastify/csrf-protection": "^7.1.0",
|
|
47
47
|
"@fastify/helmet": "^13.0.2",
|
|
48
48
|
"@fastify/multipart": "^10.0.0",
|
|
49
|
-
"@fastify/rate-limit": "^10.3.0",
|
|
50
49
|
"@fastify/static": "^9.0.0",
|
|
51
50
|
"@headlessui/react": "^2.2.2",
|
|
52
51
|
"@lingui/core": "^5.9.5",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import t, { useCallback as n, useEffect as r, useRef as i } from "react";
|
|
3
|
-
//#region src/client/store/AuthProvider.tsx
|
|
4
|
-
var a = /*#__PURE__*/ t.createContext(null);
|
|
5
|
-
function o({ children: o, router: s }) {
|
|
6
|
-
let [c, l] = t.useState(null), [u, d] = t.useState(void 0), f = i(null), p = !!c, m = n(() => {
|
|
7
|
-
f.current &&= (clearTimeout(f.current), null);
|
|
8
|
-
}, []), h = n(async () => {
|
|
9
|
-
m(), l(null), d(void 0);
|
|
10
|
-
let e = window.location.pathname === "/" ? null : window.location.pathname + window.location.search;
|
|
11
|
-
s.navigate({
|
|
12
|
-
to: "/",
|
|
13
|
-
search: e ? { redirect: e } : void 0
|
|
14
|
-
}), s.invalidate();
|
|
15
|
-
}, [s, m]), g = n(async (e, t) => {
|
|
16
|
-
l(e), d(t ? new Date(t) : void 0);
|
|
17
|
-
}, []);
|
|
18
|
-
return r(() => {
|
|
19
|
-
if (m(), c && u) {
|
|
20
|
-
let e = u.getTime() - Date.now();
|
|
21
|
-
if (e <= 0) {
|
|
22
|
-
h();
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
f.current = setTimeout(() => {
|
|
26
|
-
h();
|
|
27
|
-
}, e);
|
|
28
|
-
}
|
|
29
|
-
return () => {
|
|
30
|
-
m();
|
|
31
|
-
};
|
|
32
|
-
}, [
|
|
33
|
-
c,
|
|
34
|
-
u,
|
|
35
|
-
h,
|
|
36
|
-
m
|
|
37
|
-
]), /*#__PURE__*/ e(a.Provider, {
|
|
38
|
-
value: {
|
|
39
|
-
isAuthenticated: p,
|
|
40
|
-
user: c,
|
|
41
|
-
login: g,
|
|
42
|
-
logout: h,
|
|
43
|
-
expiresAt: u
|
|
44
|
-
},
|
|
45
|
-
children: o
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function s() {
|
|
49
|
-
let e = t.useContext(a);
|
|
50
|
-
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
51
|
-
return e;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { s as n, o as t };
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=AuthProvider-Cj_Btfnc.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthProvider-Cj_Btfnc.mjs","names":["React","useEffect","useRef","useCallback","AuthContext","createContext","AuthProvider","children","router","user","setUser","useState","expiresAt","setExpiresAt","undefined","logoutTimerRef","isAuthenticated","clearLogoutTimer","current","clearTimeout","logout","currentPath","window","location","pathname","search","navigate","to","redirect","invalidate","login","expires_at","expiration","Date","timeUntilExpiry","getTime","now","setTimeout","Provider","value","useAuth","context","useContext","Error"],"sources":["../../src/client/store/AuthProvider.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback } from \"react\"\nimport { TokenData } from \"../../server/Authentication/types/models\"\n\nexport type User = TokenData[\"user\"] | null\n\nexport interface AuthContext {\n isAuthenticated: boolean\n login: (user: User, expires_at?: string) => Promise<void>\n logout: () => Promise<void>\n user?: User\n expiresAt?: Date\n}\n\ninterface RouterNavigation {\n navigate: (options: { to: string; search?: Record<string, unknown> }) => void\n invalidate: () => void\n}\n\nconst AuthContext = React.createContext<AuthContext | null>(null)\n\nexport function AuthProvider({ children, router }: { children: React.ReactNode; router: RouterNavigation }) {\n const [user, setUser] = React.useState<User | null>(null)\n const [expiresAt, setExpiresAt] = React.useState<Date | undefined>(undefined)\n\n const logoutTimerRef = useRef<NodeJS.Timeout | null>(null)\n\n const isAuthenticated = !!user\n\n const clearLogoutTimer = useCallback(() => {\n if (logoutTimerRef.current) {\n clearTimeout(logoutTimerRef.current)\n logoutTimerRef.current = null\n }\n }, [])\n\n const logout = useCallback(async () => {\n clearLogoutTimer()\n\n setUser(null)\n setExpiresAt(undefined)\n\n // Navigate to login page; include a redirect back to the current path when not already on \"/\"\n const currentPath = window.location.pathname !== \"/\" ? window.location.pathname + window.location.search : null\n\n router.navigate({\n to: \"/\",\n search: currentPath ? { redirect: currentPath } : undefined,\n })\n\n router.invalidate()\n }, [router, clearLogoutTimer])\n\n const login = useCallback(async (user: User, expires_at?: string) => {\n setUser(user)\n\n if (expires_at) {\n const expiration = new Date(expires_at)\n setExpiresAt(expiration)\n } else {\n setExpiresAt(undefined)\n }\n }, [])\n\n useEffect(() => {\n clearLogoutTimer()\n\n if (user && expiresAt) {\n const timeUntilExpiry = expiresAt.getTime() - Date.now()\n\n if (timeUntilExpiry <= 0) {\n logout()\n return\n }\n\n logoutTimerRef.current = setTimeout(() => {\n logout()\n }, timeUntilExpiry)\n }\n\n return () => {\n clearLogoutTimer()\n }\n }, [user, expiresAt, logout, clearLogoutTimer])\n\n return (\n <AuthContext.Provider\n value={{\n isAuthenticated,\n user,\n login,\n logout,\n expiresAt,\n }}\n >\n {children}\n </AuthContext.Provider>\n )\n}\n\nexport function useAuth() {\n const context = React.useContext(AuthContext)\n if (!context) {\n throw new Error(\"useAuth must be used within an AuthProvider\")\n }\n return context\n}\n"],"mappings":";;;AAkBA,IAAMI,IAAcJ,gBAAMK,cAAkC,IAAA;AAE5D,SAAgBC,EAAa,EAAEC,aAAUC,aAAiE;CACxG,IAAM,CAACC,GAAMC,KAAWV,EAAMW,SAAsB,IAAA,GAC9C,CAACC,GAAWC,KAAgBb,EAAMW,SAA2BG,KAAAA,CAAAA,GAE7DC,IAAiBb,EAA8B,IAAA,GAE/Cc,IAAkB,CAAC,CAACP,GAEpBQ,IAAmBd,QAAY;EACnC,AAEEY,EAAeG,aADfC,aAAaJ,EAAeG,OAAO,GACV;CAE7B,GAAG,CAAA,CAAE,GAECE,IAASjB,EAAY,YAAA;EAIzBU,AAHAI,EAAAA,GAEAP,EAAQ,IAAA,GACRG,EAAaC,KAAAA,CAAAA;EAGb,IAAMO,IAAcC,OAAOC,SAASC,aAAa,MAA0D,OAApDF,OAAOC,SAASC,WAAWF,OAAOC,SAASE;EAOlGjB,AALAA,EAAOkB,SAAS;GACdC,IAAI;GACJF,QAAQJ,IAAc,EAAEO,UAAUP,EAAY,IAAIP,KAAAA;EACpD,CAAA,GAEAN,EAAOqB,WAAU;CACnB,GAAG,CAACrB,GAAQS,CAAAA,CAAiB,GAEvBa,IAAQ3B,EAAY,OAAOM,GAAYsB,MAAAA;EAG3C,AAFArB,EAAQD,CAAAA,GAINI,EAFEkB,IAEWC,IADUC,KAAKF,CACfC,IAEAlB,KAAAA,CAAAA;CAEjB,GAAG,CAAA,CAAE;CAuBL,OArBAb,QAAU;EAGR,IAFAgB,EAAAA,GAEIR,KAAQG,GAAW;GACrB,IAAMsB,IAAkBtB,EAAUuB,QAAO,IAAKF,KAAKG,IAAG;GAEtD,IAAIF,KAAmB,GAAG;IACxBd,EAAAA;IACA;GACF;GAEAL,EAAeG,UAAUmB,iBAAW;IAClCjB,EAAAA;GACF,GAAGc,CAAAA;EACL;EAEA,aAAO;GACLjB,EAAAA;EACF;CACF,GAAG;EAACR;EAAMG;EAAWQ;EAAQH;EAAiB,GAG5C,gBAACb,EAAYkC,UAAQ;EACnBC,OAAO;GACLvB;GACAP;GACAqB;GACAV;GACAR;EACF;EAECL;;AAGP;AAEA,SAAgBiC,IAAAA;CACd,IAAMC,IAAUzC,EAAM0C,WAAWtC,CAAAA;CACjC,IAAI,CAACqC,GACH,MAAUE,MAAM,6CAAA;CAElB,OAAOF;AACT"}
|