@cobaltcore-dev/aurora 0.20.2 → 0.21.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/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/{_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-BsIWL0XK.mjs} +2 -2
- package/dist/client/{_flavorId-BaNJ1CDY.mjs.map → _flavorId-BsIWL0XK.mjs.map} +1 -1
- package/dist/client/{_flavorId-BMX239RH.mjs → _flavorId-Cu1nWwOq.mjs} +13 -14
- package/dist/client/{_flavorId-BMX239RH.mjs.map → _flavorId-Cu1nWwOq.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-DQFtZNeg.mjs → _floatingIpId-8-UPUV8M.mjs} +2 -2
- package/dist/client/{_floatingIpId-DQFtZNeg.mjs.map → _floatingIpId-8-UPUV8M.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-E6x99cmW.mjs → _floatingIpId-B_M3gyMA.mjs} +4 -4
- package/dist/client/{_floatingIpId-E6x99cmW.mjs.map → _floatingIpId-B_M3gyMA.mjs.map} +1 -1
- package/dist/client/{_imageId-C2662dZr.mjs → _imageId-D1Z0xIco.mjs} +2 -2
- package/dist/client/{_imageId-C2662dZr.mjs.map → _imageId-D1Z0xIco.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/{_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-DsbBodWF.mjs → _storageType-BkhbKG_G.mjs} +2 -2
- package/dist/client/{_storageType-DsbBodWF.mjs.map → _storageType-BkhbKG_G.mjs.map} +1 -1
- package/dist/client/{_storageType-WwAATdsa.mjs → _storageType-ByLL106s.mjs} +113 -115
- package/dist/client/_storageType-ByLL106s.mjs.map +1 -0
- 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-Bwjig3k2.mjs → flavors-CT1bHP61.mjs} +11 -12
- package/dist/client/{flavors-Bwjig3k2.mjs.map → flavors-CT1bHP61.mjs.map} +1 -1
- package/dist/client/{flavors-C7PVJUqZ.mjs → flavors-q1j-y3e-.mjs} +2 -2
- package/dist/client/{flavors-C7PVJUqZ.mjs.map → flavors-q1j-y3e-.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-BklcxYWi.mjs} +4 -4
- package/dist/client/{images-CfBrglGJ.mjs.map → images-BklcxYWi.mjs.map} +1 -1
- package/dist/client/{images-CD7DNwru.mjs → images-CPYewah0.mjs} +2 -2
- package/dist/client/{images-CD7DNwru.mjs.map → images-CPYewah0.mjs.map} +1 -1
- package/dist/client/index.js +291 -492
- package/dist/client/index.js.map +1 -1
- package/dist/client/{pca-ZgGU0UPF.mjs → pca-BAuZA0K3.mjs} +2 -2
- package/dist/client/{pca-ZgGU0UPF.mjs.map → pca-BAuZA0K3.mjs.map} +1 -1
- package/dist/client/{pca-CpMqoF00.mjs → pca-Ddk0YfgK.mjs} +4 -4
- package/dist/client/{pca-CpMqoF00.mjs.map → pca-Ddk0YfgK.mjs.map} +1 -1
- package/dist/client/routes-BzBTVAjK.mjs +105 -0
- package/dist/client/routes-BzBTVAjK.mjs.map +1 -0
- package/dist/client/routes-DsisKFfG.mjs +10 -0
- package/dist/client/routes-DsisKFfG.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 +3 -4
- 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/_storageType-WwAATdsa.mjs.map +0 -1
- package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs +0 -83
- package/dist/client/useErrorTranslation-Dc0eE8Zt.mjs.map +0 -1
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.21.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",
|
|
@@ -109,8 +108,8 @@
|
|
|
109
108
|
"vite-tsconfig-paths": "^6.1.1",
|
|
110
109
|
"vitest": "^4.1.2",
|
|
111
110
|
"@cobaltcore-dev/aurora-config": "0.0.1",
|
|
112
|
-
"@cobaltcore-dev/
|
|
113
|
-
"@cobaltcore-dev/
|
|
111
|
+
"@cobaltcore-dev/signal-openstack": "1.0.0",
|
|
112
|
+
"@cobaltcore-dev/policy-engine": "2.0.0"
|
|
114
113
|
},
|
|
115
114
|
"scripts": {
|
|
116
115
|
"build": "pnpm build:server && pnpm build:client",
|
|
@@ -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"}
|