From 41ea2ae5ac16c904b4e0701d4c3bf3e62bcf0cbe Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Fri, 17 Jan 2025 14:59:29 +0100 Subject: [PATCH] Fixed swagger 404 --- cloc_definitions.txt | 7 ----- myconext-server/pom.xml | 11 ++++++-- .../security/SecurityConfiguration.java | 3 +- ...eslint.config.js.nope => eslint.config.js} | 0 servicedesk-gui/src/App.jsx | 28 ++++--------------- 5 files changed, 16 insertions(+), 33 deletions(-) rename servicedesk-gui/{eslint.config.js.nope => eslint.config.js} (100%) diff --git a/cloc_definitions.txt b/cloc_definitions.txt index 6e40deb4..7fd01b87 100644 --- a/cloc_definitions.txt +++ b/cloc_definitions.txt @@ -1061,13 +1061,6 @@ Objective C filter call_regexp_common C++ 3rd_gen_scale 2.96 end_of_line_continuation \\$ -Objective C++ - filter rm_comments_in_strings " /* */ - filter rm_comments_in_strings " // - filter call_regexp_common C++ - extension mm - 3rd_gen_scale 2.96 - end_of_line_continuation \\$ Octave filter remove_matches ^\s*# filter remove_inline #.*$ diff --git a/myconext-server/pom.xml b/myconext-server/pom.xml index e60d7f48..39490b9e 100644 --- a/myconext-server/pom.xml +++ b/myconext-server/pom.xml @@ -164,11 +164,18 @@ logstash-logback-encoder 6.4 + org.springdoc - springdoc-openapi-ui - 1.8.0 + springdoc-openapi-starter-webmvc-ui + 2.8.3 + + + + + + org.springframework.boot spring-boot-starter-test diff --git a/myconext-server/src/main/java/myconext/security/SecurityConfiguration.java b/myconext-server/src/main/java/myconext/security/SecurityConfiguration.java index 81584919..e8a969c1 100644 --- a/myconext-server/src/main/java/myconext/security/SecurityConfiguration.java +++ b/myconext-server/src/main/java/myconext/security/SecurityConfiguration.java @@ -230,7 +230,8 @@ public SecurityFilterChain shibbolethSecurityFilterChain( "/myconext/api/idp/**", "/myconext/api/sp/create-from-institution", "/myconext/api/sp/create-from-institution/**", - "/myconext/api/sp/idin/issuers") + "/myconext/api/sp/idin/issuers", + "myconext/api/swagger-ui/**") .permitAll()) .authorizeHttpRequests(authz -> authz.requestMatchers( "/myconext/api/servicedesk/**" diff --git a/servicedesk-gui/eslint.config.js.nope b/servicedesk-gui/eslint.config.js similarity index 100% rename from servicedesk-gui/eslint.config.js.nope rename to servicedesk-gui/eslint.config.js diff --git a/servicedesk-gui/src/App.jsx b/servicedesk-gui/src/App.jsx index fd6b69b6..533483be 100644 --- a/servicedesk-gui/src/App.jsx +++ b/servicedesk-gui/src/App.jsx @@ -3,38 +3,20 @@ import {Loader} from "@surfnet/sds"; import './App.scss' // import {useNavigate} from "react-router-dom"; // import {useAppStore} from "./stores/AppStore.js"; -import {configuration, me} from "./api/index.js"; +import {configuration} from "./api/index.js"; import {useAppStore} from "./stores/AppStore.js"; const App = () => { + const [loading, setLoading] = useState(true); - // async function fetchConfig() { - // try { - // setConf(await configuration()); - // setLoading(false) - // } catch (e) { - // console.log(e); - // } - // } useEffect(() => { - // fetchConfig(); - // configurationAsync().then(res => { - // setConf(res); - - // setLoading(false); - // }) configuration().then(res => { - useAppStore.setState(() => ({config: res})); - me().then(json => { - useAppStore.setState(() => ({user: json, authenticated: true})); - setLoading(false); - // const {user, config} = useAppStore(state => state); - }); - + useAppStore.setState(() => ({config: res, authenticated: res.authenticated, user: res.user})); + setLoading(false); }); - }, []);// eslint-disable-line react-hooks/exhaustive-deps + }, []); if (loading) { return