diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 991a8c6..3e3a22b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,7 +9,7 @@ build-job:
image: maven:3.9.8-amazoncorretto-21-al2023
script:
- echo "Building the project..."
- - mvn clean install -DskipTests
+ - mvn clean install -DskipTests -Dmaven.repo.local=/root/.m2/repository
artifacts:
paths:
- target/*.jar
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index 8f96f52..0000000
--- a/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-wrapperVersion=3.3.2
-distributionType=only-script
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
diff --git a/pom.xml b/pom.xml
index 8657c2d..0836f53 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,10 @@
1.0.0-SNAPSHOT
+
+
+
+
org.springframework.boot
spring-boot-starter-data-mongodb
@@ -109,6 +113,12 @@
2.8.8
+
+ com.olympus
+ olympus-common
+ 1.0
+
+
diff --git a/src/main/java/com/olympus/hermione/dto/external/CodeRagResponse.java b/src/main/java/com/olympus/hermione/dto/external/CodeRagResponse.java
deleted file mode 100644
index 8f74b81..0000000
--- a/src/main/java/com/olympus/hermione/dto/external/CodeRagResponse.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.olympus.hermione.dto.external;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class CodeRagResponse {
-
- private String fullyQualifiedName;
- private String code;
- private String description;
- private String similarityScore;
- private String documentId;
- private String codeType;
-}
diff --git a/src/main/java/com/olympus/hermione/dto/external/SimilaritySearchCodeInput.java b/src/main/java/com/olympus/hermione/dto/external/SimilaritySearchCodeInput.java
deleted file mode 100644
index 51e069a..0000000
--- a/src/main/java/com/olympus/hermione/dto/external/SimilaritySearchCodeInput.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.olympus.hermione.dto.external;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class SimilaritySearchCodeInput {
-
- private String query;
- private String topK;
- private String similarityThreshold;
- private String filterExpression;
-
-}
-
-
-/*
- * .withQuery(query)
- .withTopK(3)
- .withSimilarityThreshold(0.8)
- .withFilterExpression(b.eq("doc_type","GeneratedMethodDoc").build())
- */
\ No newline at end of file
diff --git a/src/main/java/com/olympus/hermione/models/ScenarioExecution.java b/src/main/java/com/olympus/hermione/models/ScenarioExecution.java
index 475fdf2..53fdac4 100644
--- a/src/main/java/com/olympus/hermione/models/ScenarioExecution.java
+++ b/src/main/java/com/olympus/hermione/models/ScenarioExecution.java
@@ -6,6 +6,7 @@ import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import com.olympus.hermione.dto.ScenarioExecutionInput;
+import com.olympus.hermione.models.Scenario;
import lombok.Getter;
import lombok.Setter;
diff --git a/src/main/java/com/olympus/hermione/security/config/CorsConfig.java b/src/main/java/com/olympus/hermione/security/config/CorsConfig.java
deleted file mode 100644
index 7ea22cb..0000000
--- a/src/main/java/com/olympus/hermione/security/config/CorsConfig.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.olympus.hermione.security.config;
-
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@Configuration
-public class CorsConfig implements WebMvcConfigurer {
-
- @Value("${hermione.fe.url}")
- private String hermione_frontend_url;
-
- @Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins(hermione_frontend_url)
- .allowedHeaders("*")
- .allowedMethods("GET", "POST", "PUT", "DELETE");
- }
-}
diff --git a/src/main/java/com/olympus/hermione/security/config/SecurityConfig.java b/src/main/java/com/olympus/hermione/security/config/SecurityConfig.java
deleted file mode 100644
index 85f741f..0000000
--- a/src/main/java/com/olympus/hermione/security/config/SecurityConfig.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.olympus.hermione.security.config;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import org.springframework.security.authentication.AuthenticationManager;
-
-import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
-import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.http.SessionCreationPolicy;
-import org.springframework.security.crypto.password.NoOpPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.web.SecurityFilterChain;
-import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
-
-import com.olympus.hermione.security.filter.JwtTokenFilter;
-import com.olympus.hermione.security.services.CustomUserDetailsService;
-
-@EnableWebSecurity
-@Configuration
-public class SecurityConfig {
-
- @Autowired
- CustomUserDetailsService userDetailsService;
-
-/* @Autowired
- private AuthEntryPointJwt unauthorizedHandler;
-*/
- @Bean
- public JwtTokenFilter authenticationJwtTokenFilter() {
- return new JwtTokenFilter();
- }
-
-//@Override
-//public void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
-// authenticationManagerBuilder.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
-//}
-
- @Bean
- public DaoAuthenticationProvider authenticationProvider() {
- DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
-
- authProvider.setUserDetailsService(userDetailsService);
- authProvider.setPasswordEncoder(passwordEncoder());
-
- return authProvider;
- }
-
-//@Bean
-//@Override
-//public AuthenticationManager authenticationManagerBean() throws Exception {
-// return super.authenticationManagerBean();
-//}
-
- @Bean
- public AuthenticationManager authenticationManager(AuthenticationConfiguration authConfig) throws Exception {
- return authConfig.getAuthenticationManager();
- }
-
-
- @Bean
- PasswordEncoder passwordEncoder() {
- return NoOpPasswordEncoder.getInstance();
- }
-
-
- @Bean
- public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
- http.csrf(csrf -> csrf.disable())
- .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
- .authorizeHttpRequests(auth -> auth.requestMatchers("/api/auth/**").permitAll()
- .requestMatchers("/api/test/**").permitAll()
- .requestMatchers("/test/**").permitAll()
- .anyRequest().permitAll());//.authenticated());
-
- http.authenticationProvider(authenticationProvider());
-
- http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
-
- return http.build();
- }
-
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/controllers/AuthController.java b/src/main/java/com/olympus/hermione/security/controllers/AuthController.java
deleted file mode 100644
index 598cb58..0000000
--- a/src/main/java/com/olympus/hermione/security/controllers/AuthController.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.olympus.hermione.security.controllers;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.olympus.hermione.security.dto.AuthenticationRequest;
-import com.olympus.hermione.security.dto.AuthenticationResponse;
-import com.olympus.hermione.security.dto.FetchUserResponse;
-import com.olympus.hermione.security.entity.User;
-import com.olympus.hermione.security.utility.JwtTokenProvider;
-
-@RestController
-@RequestMapping("/api/auth")
-public class AuthController {
-
- @Autowired
- private AuthenticationManager authenticationManager;
-
- @Autowired
- private JwtTokenProvider jwtTokenProvider;
-
- @PostMapping("/login")
- public ResponseEntity> authenticateUser(@RequestBody AuthenticationRequest authenticationRequest) {
-
- Authentication authentication = authenticationManager.authenticate(
- new UsernamePasswordAuthenticationToken(
- authenticationRequest.getUsername(),
- authenticationRequest.getPassword()
- )
- );
-
- SecurityContextHolder.getContext().setAuthentication(authentication);
- String jwt = jwtTokenProvider.createToken(authentication);
-
-
- HttpHeaders httpHeaders = new HttpHeaders();
- httpHeaders.add("authorization", jwt);
- httpHeaders.add("access-control-expose-headers", "authorization");
- AuthenticationResponse authenticationResponse = new AuthenticationResponse(jwt, (User) authentication.getPrincipal());
-
- return ResponseEntity.ok().headers(httpHeaders).body(authenticationResponse);
-
- }
-
- @GetMapping("/fetch-user")
- public FetchUserResponse fetchUser(Authentication authentication) {
- User principal = (User) authentication.getPrincipal();
- principal.setPassword(null);
- FetchUserResponse fetchUserResponse = new FetchUserResponse();
- fetchUserResponse.setData(principal);
- return fetchUserResponse;
-
- }
-
-
- @GetMapping("/refresh-token")
- public ResponseEntity> refreshToken(Authentication authentication) {
-
-
- SecurityContextHolder.getContext().setAuthentication(authentication);
- String jwt = jwtTokenProvider.createToken(authentication);
-
-
- HttpHeaders httpHeaders = new HttpHeaders();
- httpHeaders.add("authorization", jwt);
- httpHeaders.add("access-control-expose-headers", "authorization");
- AuthenticationResponse authenticationResponse = new AuthenticationResponse(jwt, (User) authentication.getPrincipal());
-
- return ResponseEntity.ok().headers(httpHeaders).body(authenticationResponse);
- }
-
- @GetMapping("/test")
- public ResponseEntity> test() {
- return ResponseEntity.ok(" you have access now ");
- }
-}
diff --git a/src/main/java/com/olympus/hermione/security/dto/AuthenticationRequest.java b/src/main/java/com/olympus/hermione/security/dto/AuthenticationRequest.java
deleted file mode 100644
index 0aa9c3a..0000000
--- a/src/main/java/com/olympus/hermione/security/dto/AuthenticationRequest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.olympus.hermione.security.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@AllArgsConstructor
-@NoArgsConstructor
-@Getter
-@Setter
-public class AuthenticationRequest {
-
- private String username;
- private String password;
-}
-
-
diff --git a/src/main/java/com/olympus/hermione/security/dto/AuthenticationResponse.java b/src/main/java/com/olympus/hermione/security/dto/AuthenticationResponse.java
deleted file mode 100644
index f799068..0000000
--- a/src/main/java/com/olympus/hermione/security/dto/AuthenticationResponse.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.olympus.hermione.security.dto;
-
-import com.olympus.hermione.security.entity.User;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@AllArgsConstructor
-@NoArgsConstructor
-public class AuthenticationResponse {
-
- private String accessToken;
- private User data;
-
-}
diff --git a/src/main/java/com/olympus/hermione/security/dto/FetchUserResponse.java b/src/main/java/com/olympus/hermione/security/dto/FetchUserResponse.java
deleted file mode 100644
index ec9e324..0000000
--- a/src/main/java/com/olympus/hermione/security/dto/FetchUserResponse.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.olympus.hermione.security.dto;
-
-import com.olympus.hermione.security.entity.User;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class FetchUserResponse {
- private User data;
-
-
-
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/entity/Role.java b/src/main/java/com/olympus/hermione/security/entity/Role.java
deleted file mode 100644
index 2216e14..0000000
--- a/src/main/java/com/olympus/hermione/security/entity/Role.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.olympus.hermione.security.entity;
-
-public enum Role {
- ADMIN,USER
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/entity/User.java b/src/main/java/com/olympus/hermione/security/entity/User.java
deleted file mode 100644
index 4bbd870..0000000
--- a/src/main/java/com/olympus/hermione/security/entity/User.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.olympus.hermione.security.entity;
-import java.util.Collection;
-
-import org.springframework.data.annotation.Id;
-import org.springframework.data.mongodb.core.mapping.Document;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.userdetails.UserDetails;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import java.util.List;
-
-
-@Document(collection = "users")
-@Getter @Setter
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class User implements UserDetails{
- @Id
- private String id;
- private String username;
- private String password;
- private String name;
- private String surname;
-
- private Role role;
-
- @Override
- public Collection extends GrantedAuthority> getAuthorities() {
- return List.of(new SimpleGrantedAuthority(role.name()));
- }
-
-
-}
diff --git a/src/main/java/com/olympus/hermione/security/filter/JwtTokenFilter.java b/src/main/java/com/olympus/hermione/security/filter/JwtTokenFilter.java
deleted file mode 100644
index dd6dd26..0000000
--- a/src/main/java/com/olympus/hermione/security/filter/JwtTokenFilter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.olympus.hermione.security.filter;
-
-import java.io.IOException;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
-import org.springframework.stereotype.Component;
-import org.springframework.web.filter.OncePerRequestFilter;
-
-import com.olympus.hermione.security.utility.JwtTokenProvider;
-
-import jakarta.servlet.FilterChain;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import lombok.AllArgsConstructor;
-import lombok.NoArgsConstructor;
-
-@Component
-@AllArgsConstructor
-@NoArgsConstructor
-public class JwtTokenFilter extends OncePerRequestFilter {
-
- @Autowired
- private JwtTokenProvider jwtTokenProvider;
-
- @Autowired
- private UserDetailsService userDetailsService;
-
- @Override
- protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
-
- String token = jwtTokenProvider.resolveToken(request);
-
- if (token != null && jwtTokenProvider.validateToken(token)) {
-
- UserDetails userDetails = userDetailsService.loadUserByUsername(jwtTokenProvider.getUsername(token));
-
- UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
-
- authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
- SecurityContextHolder.getContext().setAuthentication(authentication);
- }
-
- filterChain.doFilter(request, response);
- }
-
-
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/repository/UserRepository.java b/src/main/java/com/olympus/hermione/security/repository/UserRepository.java
deleted file mode 100644
index 1709b4a..0000000
--- a/src/main/java/com/olympus/hermione/security/repository/UserRepository.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.olympus.hermione.security.repository;
-
-import org.springframework.data.mongodb.repository.MongoRepository;
-import org.springframework.data.mongodb.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import com.olympus.hermione.security.entity.User;
-
-@Repository
-public interface UserRepository extends MongoRepository {
-
- @Query("{username:'?0'}")
- User findUserByUsername(String username);
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/services/CustomUserDetailsService.java b/src/main/java/com/olympus/hermione/security/services/CustomUserDetailsService.java
deleted file mode 100644
index 977695b..0000000
--- a/src/main/java/com/olympus/hermione/security/services/CustomUserDetailsService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.olympus.hermione.security.services;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-
-import com.olympus.hermione.security.entity.User;
-import com.olympus.hermione.security.repository.UserRepository;
-
-@Configuration
-@Service
-public class CustomUserDetailsService implements UserDetailsService {
-
- @Autowired
- private UserRepository userRepository;
-
- @Override
- public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
- try {
- User user = userRepository.findUserByUsername(username);
- if(user != null){
- return user;
- }else{
- throw new Exception("user Not found ");
- }
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/src/main/java/com/olympus/hermione/security/utility/JwtAuthenticationEntryPoint.java b/src/main/java/com/olympus/hermione/security/utility/JwtAuthenticationEntryPoint.java
deleted file mode 100644
index affcdbc..0000000
--- a/src/main/java/com/olympus/hermione/security/utility/JwtAuthenticationEntryPoint.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.olympus.hermione.security.utility;
-
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
-import org.springframework.stereotype.Component;
-
-import io.jsonwebtoken.io.IOException;
-
-
-@Component
-public class JwtAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {
-
- @Override
- public void commence(HttpServletRequest request, HttpServletResponse response,
- AuthenticationException authException) throws IOException, java.io.IOException {
-
- response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
- response.setContentType("application/json");
- response.getWriter().write("{ \"message\": \"" + authException.getMessage() + "\" }");
- }
-
- @Override
- public void afterPropertiesSet() {
- setRealmName("JWT Authentication");
- super.afterPropertiesSet();
- }
-}
-
diff --git a/src/main/java/com/olympus/hermione/security/utility/JwtTokenProvider.java b/src/main/java/com/olympus/hermione/security/utility/JwtTokenProvider.java
deleted file mode 100644
index 43bc5e2..0000000
--- a/src/main/java/com/olympus/hermione/security/utility/JwtTokenProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.olympus.hermione.security.utility;
-
-import org.springframework.stereotype.Component;
-
-import io.jsonwebtoken.*;
-import io.jsonwebtoken.io.Decoders;
-import io.jsonwebtoken.security.Keys;
-import io.jsonwebtoken.security.SignatureException;
-import jakarta.servlet.http.HttpServletRequest;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.util.StringUtils;
-import java.security.Key;
-import java.util.Date;
-
-@Component
-@Slf4j
-public class JwtTokenProvider {
-
- Key key = Keys.secretKeyFor(SignatureAlgorithm.HS512);
-
-
- public static final String SECRET = "5367566B59703373367639792F423F4528482B4D6251655468576D5A713474375367566B59703373367639792F423F4528482B4D6251655468576D5A71347437";
-
-
- private Key getSignKey() {
- byte[] keyBytes = Decoders.BASE64.decode(SECRET);
- return Keys.hmacShaKeyFor(keyBytes);
- }
-
-
- public String createToken(Authentication authentication) {
-
- UserDetails userDetails = (UserDetails) authentication.getPrincipal();
- Date now = new Date();
- Date expiryDate = new Date(now.getTime() + 3600000);
-
- return Jwts.builder()
- .setSubject(userDetails.getUsername())
- .setIssuedAt(new Date())
- .setExpiration(expiryDate)
- .signWith(getSignKey(), SignatureAlgorithm.HS512)
- //.signWith(SignatureAlgorithm.HS512, SECRET)
- .compact();
- }
-
-
- public String resolveToken(HttpServletRequest request) {
-
- String bearerToken = request.getHeader("Authorization");
- if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) {
- return bearerToken.substring(7);
- }
- return null;
- }
-
- // Check if the token is valid and not expired
- public boolean validateToken(String token) {
-
- try {
- Jwts.parser().setSigningKey(getSignKey()).parseClaimsJws(token);
- return true;
- } catch (MalformedJwtException ex) {
- log.error("Invalid JWT token");
- } catch (ExpiredJwtException ex) {
- log.error("Expired JWT token");
- } catch (UnsupportedJwtException ex) {
- log.error("Unsupported JWT token");
- } catch (IllegalArgumentException ex) {
- log.error("JWT claims string is empty");
- } catch (SignatureException e) {
- log.error("there is an error with the signature of you token ");
- }
- return false;
- }
-
- // Extract the username from the JWT token
- public String getUsername(String token) {
-
- return Jwts.parser()
- .setSigningKey(getSignKey())
- .parseClaimsJws(token)
- .getBody()
- .getSubject();
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java b/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java
index 2f1ea67..b92b7ff 100644
--- a/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java
+++ b/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java
@@ -218,7 +218,7 @@ public class ScenarioExecutionService {
scenarioExecutionRepository.save(scenarioExecution);
scenarioOutput.setScenarioExecution_id(scenarioExecution.getId());
- scenarioOutput.setStatus("IN_PROGRESS");
+ scenarioOutput.setStatus("IN_PROGRESS");
}
diff --git a/src/main/java/com/olympus/hermione/stepSolvers/AdvancedAIPromptSolver.java b/src/main/java/com/olympus/hermione/stepSolvers/AdvancedAIPromptSolver.java
index 77789a8..8abbdc2 100644
--- a/src/main/java/com/olympus/hermione/stepSolvers/AdvancedAIPromptSolver.java
+++ b/src/main/java/com/olympus/hermione/stepSolvers/AdvancedAIPromptSolver.java
@@ -13,7 +13,6 @@ import com.olympus.hermione.utility.AttributeParser;
import ch.qos.logback.classic.Logger;
-
public class AdvancedAIPromptSolver extends StepSolver {
private String qai_system_prompt_template;
diff --git a/src/main/java/com/olympus/hermione/stepSolvers/BasicAIPromptSolver.java b/src/main/java/com/olympus/hermione/stepSolvers/BasicAIPromptSolver.java
index 3c02d9f..9f7e805 100644
--- a/src/main/java/com/olympus/hermione/stepSolvers/BasicAIPromptSolver.java
+++ b/src/main/java/com/olympus/hermione/stepSolvers/BasicAIPromptSolver.java
@@ -11,7 +11,6 @@ import org.springframework.ai.chat.prompt.Prompt;
import com.olympus.hermione.models.ScenarioExecution;
import com.olympus.hermione.utility.AttributeParser;
-
import ch.qos.logback.classic.Logger;
public class BasicAIPromptSolver extends StepSolver {
diff --git a/src/main/java/com/olympus/hermione/stepSolvers/SourceCodeRagSolver.java b/src/main/java/com/olympus/hermione/stepSolvers/SourceCodeRagSolver.java
index 3817087..61d280b 100644
--- a/src/main/java/com/olympus/hermione/stepSolvers/SourceCodeRagSolver.java
+++ b/src/main/java/com/olympus/hermione/stepSolvers/SourceCodeRagSolver.java
@@ -7,10 +7,11 @@ import org.springframework.cloud.client.ServiceInstance;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
-import com.olympus.hermione.dto.external.CodeRagResponse;
-import com.olympus.hermione.dto.external.SimilaritySearchCodeInput;
+
import com.olympus.hermione.models.ScenarioExecution;
import com.olympus.hermione.utility.AttributeParser;
+import com.olympus.dto.CodeRagResponse;
+import com.olympus.dto.SimilaritySearchCodeInput;
import ch.qos.logback.classic.Logger;