Refactor API URLs to use GlobalConstants and update CORS configurations for production

This commit is contained in:
liosha84
2025-07-28 13:15:44 +03:00
parent 88f0cf307e
commit c58dd4ac5c
45 changed files with 587 additions and 72 deletions
+49 -1
View File
@@ -15,6 +15,7 @@ java {
} }
repositories { repositories {
mavenCentral() mavenCentral()
} }
@@ -37,6 +38,9 @@ dependencies {
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6' implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6'
//implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai' //implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
//implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter' //implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
//implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT") //implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT")
@@ -94,8 +98,52 @@ apply plugin: 'java'
} }
}*/ }*/
tasks.register('buildAngular_dev', Exec) {
//dependsOn deleteStaticFolder
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
// Your Angular build command
args = ['run', 'build_dev']//do not forget build_dev used port 8080 for connect to backend rest api
}
tasks.register('buildAngular', Exec) {
//dependsOn deleteStaticFolder
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
// Your Angular build command
args = ['run', 'build']//do not forget build_dev used port 8080 for connect to backend rest api
}
tasks.register('deleteStaticFolder', Delete) {
dependsOn buildAngular
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
}
tasks.register('deleteStaticFolder_dev', Delete) {
dependsOn buildAngular_dev
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
}
tasks.register('copyAngularBuild', Copy) { tasks.register('copyAngularBuild', Copy) {
//dependsOn buildAngular dependsOn deleteStaticFolder
from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR
}
tasks.register('copyAngularBuild_dev', Copy) {
dependsOn deleteStaticFolder_dev
from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR into "src/main/resources/static" // Path INSIDE the WAR
} }
Binary file not shown.
+7 -1
View File
@@ -20,7 +20,6 @@
"outputPath": "dist/jambotron-ui", "outputPath": "dist/jambotron-ui",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": [ "polyfills": [
"zone.js" "zone.js"
], ],
@@ -48,6 +47,12 @@
}, },
"configurations": { "configurations": {
"production": { "production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"budgets": [ "budgets": [
{ {
"type": "initial", "type": "initial",
@@ -78,6 +83,7 @@
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"buildTarget": "jambotron-ui:build:production" "buildTarget": "jambotron-ui:build:production"
+2
View File
@@ -4,8 +4,10 @@
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"start_prod": "ng serve --configuration production",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"build_dev":"ng build --configuration development",
"test": "ng test", "test": "ng test",
"serve:ssr:jambotron-ui": "node dist/jambotron-ui/server/server.mjs" "serve:ssr:jambotron-ui": "node dist/jambotron-ui/server/server.mjs"
}, },
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {User} from '../models/user.model'; import {User} from '../models/user.model';
import {GlobalConstants} from '../global-constants';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class AdminModuleService { export class AdminModuleService {
baseUrl = 'http://localhost:8080/api'; baseUrl = GlobalConstants.API_URL;
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
+1 -1
View File
@@ -17,7 +17,7 @@ export const routes: Routes = [
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes)],//, { useHash: true } imports: [RouterModule.forRoot(routes, { useHash: true}) ],
exports: [RouterModule], exports: [RouterModule],
}) })
export class AppRoutingModule {} export class AppRoutingModule {}
@@ -0,0 +1,7 @@
import { GlobalConstants } from './global-constants';
describe('GlobalConstants', () => {
it('should create an instance', () => {
expect(new GlobalConstants()).toBeTruthy();
});
});
+15
View File
@@ -0,0 +1,15 @@
import {environment} from '../environments/environment';
export class GlobalConstants {
public static readonly API_URL = (() => {
// ... calculate the value and return it
if(environment.production) {
return `${environment.host_name}/api`;
}else {
return `${environment.host_name}:${environment.port}/api`;
}
})();
}
@@ -29,7 +29,7 @@ import { environment } from '../../../environments/environment';
MatToolbar, MatToolbar,
MatButton, MatButton,
RouterLink, RouterLink,
IconDirective,
RouterOutlet, RouterOutlet,
CommonModule, CommonModule,
MatIcon, MatIcon,
@@ -38,8 +38,7 @@ import { environment } from '../../../environments/environment';
MatMenu, MatMenu,
MatMenuItem, MatMenuItem,
MatTooltip, MatTooltip,
MatLabel, MatLabel
MatFabButton
], ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http'; import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {Tutorial} from '../models/tutorial.model'; import {Tutorial} from '../models/tutorial.model';
import {GlobalConstants} from '../global-constants';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ModeratorApiService { export class ModeratorApiService {
baseUrl = 'http://localhost:8080/api/moderator'; baseUrl = `${GlobalConstants.API_URL}/moderator`;
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
@@ -1,8 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import {GlobalConstants} from '../global-constants';
const AUTH_API = 'http://localhost:8080/api/auth/'; const AUTH_API = GlobalConstants.API_URL + '/auth/';
const httpOptions = { const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }) headers: new HttpHeaders({ 'Content-Type': 'application/json' })
@@ -15,6 +16,7 @@ export class AuthService {
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
login(username: string, password: string): Observable<any> { login(username: string, password: string): Observable<any> {
console.log(AUTH_API + 'signin');
return this.http.post(AUTH_API + 'signin', { return this.http.post(AUTH_API + 'signin', {
username, username,
password password
@@ -2,8 +2,9 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Role } from '../models/role'; import { Role } from '../models/role';
import {GlobalConstants} from '../global-constants';
const API_URL = 'http://localhost:8080/api/roles'; const API_URL = `${GlobalConstants.API_URL}/roles`;
@Injectable({ @Injectable({
@@ -4,13 +4,14 @@ import {Observable} from 'rxjs';
import {Tutorial} from '../models/tutorial.model'; import {Tutorial} from '../models/tutorial.model';
import {Bean} from '../models/Bean'; import {Bean} from '../models/Bean';
import {NameValueItem} from '../models/name-value-item'; import {NameValueItem} from '../models/name-value-item';
import {GlobalConstants} from '../global-constants';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class SystemService { export class SystemService {
baseUrl : string = 'http://localhost:8080/api/system'; baseUrl : string = `${GlobalConstants.API_URL}/system`;
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
getDataSourceProperties(): Observable<NameValueItem[]>{ getDataSourceProperties(): Observable<NameValueItem[]>{
@@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Tutorial } from '../models/tutorial.model'; import { Tutorial } from '../models/tutorial.model';
import {text} from 'node:stream/consumers'; import {GlobalConstants} from '../global-constants';
const baseUrl = 'http://localhost:8080/api/public/tutorials'; const baseUrl = `${GlobalConstants.API_URL}/public/tutorials`;
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import {User} from "../models/user.model"; import {User} from "../models/user.model";
import {Tutorial} from "../models/tutorial.model"; import {GlobalConstants} from '../global-constants';
const API_URL = 'http://localhost:8080/api/users'; const API_URL = `${GlobalConstants.API_URL}/users`;
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -4,6 +4,7 @@ import {Tutorial} from '../models/tutorial.model';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {Image} from '../models/image'; import {Image} from '../models/image';
import {SpinnerService} from './spinner.service'; import {SpinnerService} from './spinner.service';
import {GlobalConstants} from '../global-constants';
@@ -13,7 +14,7 @@ import {SpinnerService} from './spinner.service';
export class ZhipuaiImageService { export class ZhipuaiImageService {
baseUrl : string = 'http://localhost:8080/api/zhipuai'; baseUrl : string = `${GlobalConstants.API_URL}/public/zhipuai`;
constructor(private http: HttpClient,public spinnerService: SpinnerService) { constructor(private http: HttpClient,public spinnerService: SpinnerService) {
@@ -53,7 +53,7 @@
<mat-slide-toggle <mat-slide-toggle
class="example-margin" class="example-margin"
[checked]="element[column.key]" [checked]="element[column.key]"
[disabled]="column.key !== 'toBePublished'" [disabled]="column.key !== 'tobepublished'"
(change)="publish(element, $event.checked)" (change)="publish(element, $event.checked)"
> >
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
import {forkJoin, Observable} from 'rxjs'; import {forkJoin, Observable} from 'rxjs';
import {Tutorial} from '../models/tutorial.model'; import {Tutorial} from '../models/tutorial.model';
import {HttpClient, HttpHeaders} from '@angular/common/http'; import {HttpClient, HttpHeaders} from '@angular/common/http';
import {GlobalConstants} from '../global-constants';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class UserApiService { export class UserApiService {
baseUrl = 'http://localhost:8080/api/user'; baseUrl = `${GlobalConstants.API_URL}/user`;
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
@@ -1,3 +1,7 @@
export const environment = { export const environment = {
default_page: 'main/generate-image' default_page: 'main/generate-image',
port: 8080,
fromWeb: false,
production: false,
host_name: 'http://localhost',
}; };
@@ -0,0 +1,7 @@
export const environment = {
default_page: 'main/generate-image',
port: 8081,
production: true,
fromWeb: true,
host_name: 'https://jambotron.run.place'
};
+5 -1
View File
@@ -1,3 +1,7 @@
export const environment = { export const environment = {
default_page: 'main/generate-image' default_page: 'main/generate-image',
port: 8080,
production: true,
fromWeb: false,
host_name: 'http://localhost'
}; };
+9 -10
View File
@@ -1,15 +1,14 @@
#FROM openjdk:24 AS BUILD_IMAGE #FROM openjdk:24 AS BUILD_IMAGE
#ENV APP_HOME=/jambotron
#RUN mkdir -p $APP_HOME/src/main/java #WORKDIR /jambotron/
#WORKDIR $APP_HOME #COPY . ./
#COPY ./build.gradle ./gradlew ./gradlew.bat $APP_HOME/ #RUN microdnf install findutils
#COPY gradle $APP_HOME/gradle #RUN ./gradlew build -x test
#COPY ./src/ $APP_HOME/src/
#RUN ./gradlew clean build
FROM openjdk:24 FROM openjdk:24
WORKDIR /jambotron/ WORKDIR /jambotron/
COPY './build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar' COPY './build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar'
#COPY --from=BUILD_IMAGE '/jambotron/build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar' #COPY --from=BUILD_IMAGE /jambotron/build/libs/jambotron-0.0.1-SNAPSHOT.jar .
EXPOSE 8080 #EXPOSE 8080
CMD ["java","-jar","/app/jambotron.jar"] CMD ["java","-jar","/app/jambotron.jar"]
#CMD ["java","-jar","jambotron-0.0.1-SNAPSHOT.jar"]
+29 -7
View File
@@ -6,19 +6,38 @@ services:
context: ../../ context: ../../
dockerfile: ./src/Docker/Dockerfile dockerfile: ./src/Docker/Dockerfile
ports: ports:
- "8080:8080" # - "8081:80"
- "8443:443"
depends_on: depends_on:
- postgres_jambotron - postgres_jambotron
volumes:
- certs:/certs
# env_file: "webapp.env"
environment: environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB SERVER_PORT: 443
SPRING_DATASOURCE_USERNAME: koyeb-adm FULLCHAINPEM: /certs/live/jambotron.run.place/fullchain.pem
SPRING_DATASOURCE_PASSWORD: npg_HfFEUA7bay1i PRIVKEYPEM: /certs/live/jambotron.run.place/privkey.pem
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
SPRING_DATASOURCE_USERNAME: admin
SPRING_DATASOURCE_PASSWORD: postgrespw
SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true" SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true"
SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true" SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true"
SPRING_FLYWAY_USER: koyeb-adm SPRING_FLYWAY_USER: admin
SPRING_FLYWAY_PASSWORD: npg_HfFEUA7bay1i SPRING_FLYWAY_PASSWORD: postgrespw
SPRING_FLYWAY_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB SPRING_FLYWAY_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
# SPRING_DATASOURCE_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB
# SPRING_DATASOURCE_USERNAME: koyeb-adm
# SPRING_DATASOURCE_PASSWORD: npg_HfFEUA7bay1i
# SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true"
# SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true"
#
# SPRING_FLYWAY_USER: koyeb-adm
# SPRING_FLYWAY_PASSWORD: npg_HfFEUA7bay1i
# SPRING_FLYWAY_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB
# SPRING_DATASOURCE_PASSWORD: /run/secrets/db_password # SPRING_DATASOURCE_PASSWORD: /run/secrets/db_password
# secrets: # secrets:
@@ -41,3 +60,6 @@ services:
#secrets: #secrets:
# db_password: # db_password:
# file: db_password.txt # file: db_password.txt
volumes:
certs:
external: true
+3
View File
@@ -0,0 +1,3 @@
SERVER_PORT=443
FULLCHAINPEM=/certs/live/jambotron.run.place/fullchain.pem
PRIVKEYPEM=/certs/live/jambotron.run.place/privkey.pem
@@ -1,5 +1,6 @@
package com.jambotronGroup.jambotron; package com.jambotronGroup.jambotron;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.Marker; import org.slf4j.Marker;
@@ -7,6 +8,7 @@ import org.slf4j.event.Level;
import org.slf4j.helpers.BasicMarker; import org.slf4j.helpers.BasicMarker;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import java.util.Iterator; import java.util.Iterator;
@@ -19,9 +21,9 @@ public class JambotronApplication {
SpringApplication.run(JambotronApplication.class, args); SpringApplication.run(JambotronApplication.class, args);
logger.error("Application Run."); logger.error("Application Run. This is an error message.");
logger.debug("Application Run."); logger.debug("Application Run. This is a debug message.");
logger.info("Application Run."); logger.info("Application Run. This is an info message.");
} }
} }
@@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@CrossOrigin(origins = "http://localhost:4200, https://pony-sincere-chimp.ngrok-free.app/", //@CrossOrigin(origins = "http://localhost:4200, https://pony-sincere-chimp.ngrok-free.app/",
maxAge = 3600, // maxAge = 3600,
allowCredentials="true", // allowCredentials="true",
allowedHeaders = {"Content-Type", "Authorization", "X-Requested-With"} // allowedHeaders = {"Content-Type", "Authorization", "X-Requested-With"}
) //)
@RestController @RestController
@RequestMapping("/api/zhipuai") @RequestMapping("/api/public/zhipuai")
public class ImageController { public class ImageController {
@Autowired @Autowired
@@ -32,7 +32,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
//@CrossOrigin(origins = "*", maxAge = 3600) //@CrossOrigin(origins = "*", maxAge = 3600)
@CrossOrigin(origins = "http://localhost:4200,https://a576-5-248-149-207.ngrok-free.app, https://pony-sincere-chimp.ngrok-free.app", maxAge = 3600, allowCredentials="true") //@CrossOrigin(origins = "http://localhost:4200,https://a576-5-248-149-207.ngrok-free.app, https://pony-sincere-chimp.ngrok-free.app", maxAge = 3600, allowCredentials="true")
@RestController @RestController
@RequestMapping("/api/auth") @RequestMapping("/api/auth")
public class AuthController { public class AuthController {
@@ -20,7 +20,7 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
//@CrossOrigin(origins = "http://localhost:4200", maxAge = 3600, allowCredentials="true") //@CrossOrigin(origins = "http://localhost:4200,http://www.jambotron.run.place", maxAge = 3600, allowCredentials="true")
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api")
public class TutorialController { public class TutorialController {
@@ -98,10 +98,10 @@ public class TutorialController {
@PostMapping("user/tutorial-add") @PostMapping("user/tutorial-add")
public ResponseEntity<Tutorial> createTutorial(@RequestBody Tutorial tutorial) { public ResponseEntity<Tutorial> createTutorial(@RequestBody Tutorial tutorial) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); // not work from white IP port 80 to docker container port 8080 or 8081
UserDetails userDetails = (UserDetails) authentication.getPrincipal(); //UserDetails userDetails = authenticationFacade.getUserDetails();
User user = userRepository.findById(((UserDetailsImpl)userDetails).getId()).get(); User user = authenticationFacade.getUser();
try { try {
Tutorial newTutorial =new Tutorial( Tutorial newTutorial =new Tutorial(
@@ -1,29 +1,76 @@
package com.jambotronGroup.jambotron.security; package com.jambotronGroup.jambotron.security;
import com.jambotronGroup.jambotron.controllers.AuthController;
import com.jambotronGroup.jambotron.model.User;
import com.jambotronGroup.jambotron.repository.UserRepository;
import com.jambotronGroup.jambotron.security.services.UserDetailsImpl; import com.jambotronGroup.jambotron.security.services.UserDetailsImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Optional;
@Component @Component
public class AuthenticationFacade implements IAuthenticationFacade { public class AuthenticationFacade implements IAuthenticationFacade {
private static final Logger logger = LoggerFactory.getLogger(AuthenticationFacade.class);
@Autowired
UserRepository userRepository;
@Override @Override
public Authentication getAuthentication() { public Authentication getAuthentication() {
return SecurityContextHolder.getContext().getAuthentication(); return SecurityContextHolder.getContext().getAuthentication();
} }
//Deprecated method, use getUser() instead
@Override @Override
public UserDetailsImpl getUserDetails() { public UserDetailsImpl getUserDetails() {
logger.warn("Retrieving user details from the security context");
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
UserDetails userDetails = (UserDetails) authentication.getPrincipal(); if (authentication == null || !authentication.isAuthenticated()) {
throw new IllegalStateException("No authenticated user found");
}
if (!(authentication.getPrincipal() instanceof UserDetails)) {
throw new IllegalStateException("Authentication principal is not an instance of UserDetails");
}
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
if (!(userDetails instanceof UserDetailsImpl)) {
throw new IllegalStateException("UserDetails is not an instance of UserDetailsImpl");
}
return (UserDetailsImpl) userDetails; return (UserDetailsImpl) userDetails;
} }
@Override
public com.jambotronGroup.jambotron.model.User getUser() {
User returnValue = null;
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (!(authentication.getPrincipal() instanceof UserDetails)) {
logger.info("Authentication principal is not an instance of UserDetails, returning null");
logger.info(authentication.toString());
Optional<User> user = userRepository.findByUsername(authentication.getPrincipal().toString());
returnValue = user.get();
}else{
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
UserDetailsImpl userDetailsImpl = (UserDetailsImpl) userDetails;
returnValue = userRepository.findById(userDetailsImpl.getId()).get();
}
return returnValue;
}
} }
@@ -1,5 +1,6 @@
package com.jambotronGroup.jambotron.security; package com.jambotronGroup.jambotron.security;
import com.jambotronGroup.jambotron.model.User;
import com.jambotronGroup.jambotron.security.services.UserDetailsImpl; import com.jambotronGroup.jambotron.security.services.UserDetailsImpl;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
@@ -7,4 +8,6 @@ public interface IAuthenticationFacade {
Authentication getAuthentication(); Authentication getAuthentication();
UserDetailsImpl getUserDetails(); UserDetailsImpl getUserDetails();
User getUser();
} }
@@ -0,0 +1,41 @@
package com.jambotronGroup.jambotron.security;
import jakarta.servlet.*;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.io.IOException;
/*
@Configuration
public class MyCorsFilterConfig extends CorsFilter {
public MyCorsFilterConfig(CorsConfigurationSource source) {
super((CorsConfigurationSource) source);
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
response.addHeader("Access-Control-Allow-Headers",
"Access-Control-Allow-Origin, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");
if (response.getHeader("Access-Control-Allow-Origin") == null)
response.addHeader("Access-Control-Allow-Origin", "http://localhost:4200");
if(!request.getRequestURI().startsWith("/api/auth")) {
response.addHeader("Access-Control-Allow-Credentials", "true");
}
filterChain.doFilter(request, response);
}
}
*/
@@ -0,0 +1,43 @@
package com.jambotronGroup.jambotron.security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import java.util.List;
/*
@Configuration
public class RestConfig {
@Bean
public MyCorsFilterConfig corsFilter() {
CorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("http://localhost:4200,http://www.jambotron.run.place");
config.addAllowedMethod(HttpMethod.DELETE);
config.addAllowedMethod(HttpMethod.GET);
config.addAllowedMethod(HttpMethod.OPTIONS);
config.addAllowedMethod(HttpMethod.PUT);
config.addAllowedMethod(HttpMethod.POST);
// ((UrlBasedCorsConfigurationSource) source).registerCorsConfiguration("/**", config);
config = new CorsConfiguration();
config.setAllowCredentials(false);
config.setAllowedOrigins(List.of("http://localhost:4200","http://www.jambotron.run.place"));
config.addAllowedMethod(HttpMethod.DELETE);
config.addAllowedMethod(HttpMethod.GET);
config.addAllowedMethod(HttpMethod.OPTIONS);
config.addAllowedMethod(HttpMethod.PUT);
config.addAllowedMethod(HttpMethod.POST);
config.addAllowedHeader("*");
((UrlBasedCorsConfigurationSource) source).registerCorsConfiguration("api/auth/**", config);
return new MyCorsFilterConfig(source);
}
}*/
@@ -5,12 +5,14 @@ import com.jambotronGroup.jambotron.security.jwt.AuthTokenFilter;
import com.jambotronGroup.jambotron.security.services.UserDetailsServiceImpl; import com.jambotronGroup.jambotron.security.services.UserDetailsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
@@ -22,6 +24,8 @@ import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import static org.springframework.security.config.Customizer.withDefaults;
@Configuration @Configuration
@EnableMethodSecurity @EnableMethodSecurity
//@EnableWebSecurity //@EnableWebSecurity
@@ -29,6 +33,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
// securedEnabled = true, // securedEnabled = true,
// jsr250Enabled = true, // jsr250Enabled = true,
//prePostEnabled = true) //prePostEnabled = true)
@ComponentScan("com.jambotronGroup.jambotron.security")
public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecurityConfigurerAdapter { public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecurityConfigurerAdapter {
@Autowired @Autowired
UserDetailsServiceImpl userDetailsService; UserDetailsServiceImpl userDetailsService;
@@ -57,7 +62,6 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
return authProvider; return authProvider;
} }
// @Bean // @Bean
// @Override // @Override
// public AuthenticationManager authenticationManagerBean() throws Exception { // public AuthenticationManager authenticationManagerBean() throws Exception {
@@ -106,12 +110,39 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
@Bean @Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(csrf -> csrf.disable()).cors(cors -> cors.disable()) http.csrf(csrf -> csrf.disable())//cors.configurationSource(corsCongigSource()))
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler)) .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> .authorizeHttpRequests(auth ->auth
auth.requestMatchers("/api/auth/**").permitAll() // Access without authentication
.requestMatchers("/*", "/home", "/resources/**").permitAll() // Allow public access to the root and home pages
.requestMatchers("/*").permitAll()
.requestMatchers("/resources/**").permitAll()
.requestMatchers("/api/auth/**").permitAll()
// Allow public access to tutorials (without login)
.requestMatchers("/api/public/tutorials").permitAll()
//.requestMatchers("/api/public/tutorials/**").permitAll()
//TODO: need check the puth
.requestMatchers("/api/public/zhipuai/image/**").permitAll()
// need for cerbot why i don't know
.requestMatchers("/.well-known/acme-challenge/**").permitAll()
// Access permitted for specific roles
.requestMatchers("/api/user/**").hasRole("USER")
.requestMatchers("/api/moderator/**").hasRole("MODERATOR")
.requestMatchers("/api/admin/**").hasRole("ADMIN")
.anyRequest().authenticated()
/* // Allow access to specific API endpoints without authentication
.requestMatchers("/api/auth/**").permitAll()
// Allow access to specific resources
.requestMatchers("/*", "/home", "/resources/**").permitAll()
.requestMatchers("/resources/public/media/**").permitAll() .requestMatchers("/resources/public/media/**").permitAll()
.requestMatchers("/resources/public/browser/**").permitAll() .requestMatchers("/resources/public/browser/**").permitAll()
.requestMatchers("/media/**").permitAll() .requestMatchers("/media/**").permitAll()
@@ -121,7 +152,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
.requestMatchers("/api/tutorials").permitAll() .requestMatchers("/api/tutorials").permitAll()
.requestMatchers("/api/zhipuai/image/**").permitAll()
.requestMatchers("/api/users").permitAll() .requestMatchers("/api/users").permitAll()
.requestMatchers("/api/users/**").permitAll() .requestMatchers("/api/users/**").permitAll()
@@ -133,16 +164,10 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
.requestMatchers("/api/settings").permitAll() .requestMatchers("/api/settings").permitAll()
.requestMatchers("/api/system/**").permitAll() .requestMatchers("/api/system/**").permitAll()
*/
// Allow public access to tutorials (without login)
.requestMatchers("/api/public/tutorials").permitAll()
.requestMatchers("/api/public/tutorials/**").permitAll() ).redirectToHttps(withDefaults());
.requestMatchers("/api/user/**").permitAll()
.requestMatchers("/api/moderator/**").permitAll()
.anyRequest().authenticated()
);
http.authenticationProvider(authenticationProvider()); http.authenticationProvider(authenticationProvider());
@@ -151,17 +176,77 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
return http.build(); return http.build();
} }
@Bean /*@Bean
public CorsFilter corsFilter() { public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration(); CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true); // config.setAllowCredentials(true);
config.addAllowedOrigin("http://localhost:4200"); // config.addAllowedOrigin("http://localhost:4200");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
//
// config = new CorsConfiguration();
// config.setAllowCredentials(true);
// config.addAllowedOrigin("http://213.111.120.199");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
// config = new CorsConfiguration();
// config.setAllowCredentials(false);
// config.addAllowedOrigin("http://www.jambotron.run.place");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
config = new CorsConfiguration();
config.setAllowCredentials(false);
config.addAllowedOrigin("http://www.jambotron.run.place");
config.addAllowedHeader("*"); config.addAllowedHeader("*");
config.addAllowedMethod("*"); config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config); source.registerCorsConfiguration("/api/user/**", config);
return new CorsFilter(source); return new CorsFilter(source);
} }*/
/* public UrlBasedCorsConfigurationSource corsCongigSource() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
// config.setAllowCredentials(true);
// config.addAllowedOrigin("http://localhost:4200");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
//
// config = new CorsConfiguration();
// config.setAllowCredentials(true);
// config.addAllowedOrigin("http://213.111.120.199");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
// config = new CorsConfiguration();
// config.setAllowCredentials(false);
// config.addAllowedOrigin("http://www.jambotron.run.place");
// config.addAllowedHeader("*");
// config.addAllowedMethod("*");
// source.registerCorsConfiguration("/**", config);
config = new CorsConfiguration();
config.setAllowCredentials(false);
config.addAllowedOrigin("http://localhost:4200, http://www.jambotron.run.place");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/api/user/**", config);
return source;
}*/
/* @Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring().requestMatchers("/images/**", "/js/**", "/webjars/**");
}*/
} }
@@ -9,7 +9,9 @@ import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
@@ -19,6 +21,9 @@ import java.io.IOException;
public class AuthTokenFilter extends OncePerRequestFilter { public class AuthTokenFilter extends OncePerRequestFilter {
@Autowired
AuthenticationManager authenticationManager;
@Autowired @Autowired
private JwtUtils jwtUtils; private JwtUtils jwtUtils;
@@ -35,8 +40,15 @@ public class AuthTokenFilter extends OncePerRequestFilter {
if (jwt != null && jwtUtils.validateJwtToken(jwt)) { if (jwt != null && jwtUtils.validateJwtToken(jwt)) {
String username = jwtUtils.getUserNameFromJwtToken(jwt); String username = jwtUtils.getUserNameFromJwtToken(jwt);
logger.warn("Username from JWT: {}", username);
UserDetails userDetails = userDetailsService.loadUserByUsername(username); UserDetails userDetails = userDetailsService.loadUserByUsername(username);
// Authentication authentication = authenticationManager.authenticate(
// new UsernamePasswordAuthenticationToken(userDetails.getUsername(),userDetails.getPassword()));
UsernamePasswordAuthenticationToken authentication = UsernamePasswordAuthenticationToken authentication =
new UsernamePasswordAuthenticationToken(userDetails, new UsernamePasswordAuthenticationToken(userDetails,
null, null,
@@ -40,6 +40,8 @@ public class UserDetailsImpl implements UserDetails {
.map(role -> new SimpleGrantedAuthority(role.getName().name())) .map(role -> new SimpleGrantedAuthority(role.getName().name()))
.collect(Collectors.toList()); .collect(Collectors.toList());
return new UserDetailsImpl( return new UserDetailsImpl(
user.getId(), user.getId(),
user.getUsername(), user.getUsername(),
@@ -23,6 +23,8 @@ public class UserDetailsServiceImpl implements UserDetailsService {
.orElseThrow(() -> new UsernameNotFoundException("User Not Found with username: " + username)); .orElseThrow(() -> new UsernameNotFoundException("User Not Found with username: " + username));
return UserDetailsImpl.build(user); return UserDetailsImpl.build(user);
// UserDetailsImpl userDetails = UserDetailsImpl.build(user);
// return new org.springframework.security.core.userdetails.User(userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities());
} }
} }
@@ -1,5 +1,6 @@
spring.application.name=jambotron spring.application.name=jambotron
server.port=443
#============Localhost Configurations======================== #============Localhost Configurations========================
spring.datasource.url= jdbc:postgresql://localhost:5432/jambotronDB spring.datasource.url= jdbc:postgresql://localhost:5432/jambotronDB
@@ -10,3 +10,10 @@ logging:
name: logs/application.log name: logs/application.log
max-size: 10MB max-size: 10MB
max-history: 30 max-history: 30
server:
ssl:
enabled: true
certificate: ${FULLCHAINPEM}
certificate-private-key: ${PRIVKEYPEM}
# port: ${SERVER_PORT:443} # Default to 443 if SERVER_PORT is not set
+71
View File
@@ -0,0 +1,71 @@
-----BEGIN CERTIFICATE-----
MIIG1TCCBL2gAwIBAgIQbFWr29AHksedBwzYEZ7WvzANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHA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2S0IRSH8tlYhJrtJJXLKQ"}
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2J6xGUz1qlxnQseQcPde
gt3h+ZFhxqSEBYcAjsCeyzMLWcn9ljUgYPv7Sazq8xlIeuxmOIlwg6rWNfRVuf0P
yas7/FG0DinUFGbmVqUQjAufB/N85y7z2RZzB6AUD21AE871pFpSEkLH39zfRvjo
h0kx/G4sOYFp8N3avUOQyzi8F6S5yHAwzf8BIA10lFInZU+3fBc97Ba3uPCE2IZs
5e8E4YtGKAiQC64IVENMyHZH2NaGFWg8e4wr8VpKSMdTf6OhhaLYuQAHQuIzYi0y
V5LcqNTm38U2I0vG8jddMVvE+xf+2S+cVydb3G4EJAaly2S0IRSH8tlYhJrtJJXL
KQIDAQAB
-----END PUBLIC KEY-----