Skip to content

Commit

Permalink
Merge pull request #4 from vinodbalakumar/feature/create_jwt_token
Browse files Browse the repository at this point in the history
Feature/create jwt token
  • Loading branch information
vinodbalakumar authored Oct 7, 2024
2 parents 1ffd836 + 1d00a37 commit 0799d5f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/synk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- main
- feature/**
pull_request:
branches:
- main
- feature/**

jobs:
snyk:
Expand Down Expand Up @@ -37,13 +39,17 @@ jobs:
- name: Run Snyk Test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} # Use the Snyk token
SNYK_API: "https://app.snyk.io/api"
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }} # Set JAVA_HOME explicitly
run: snyk test --all-projects
run: snyk test --severity-threshold=high --exit-code=0 --all-projects
continue-on-error: true

# Optionally monitor the project with Snyk
- name: Monitor with Snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_API: "https://app.snyk.io/api"
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }} # Set JAVA_HOME explicitly
run: snyk monitor --all-projects
run: snyk monitor --severity-threshold=high --exit-code=0 --all-projects
continue-on-error: true

13 changes: 5 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,15 @@
<version>0.9.1</version>
</dependency>

<!-- H2 Database -->
<!-- MySQL Driver -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Thymeleaf template engine (optional for frontend view rendering) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>



</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected void configure(AuthenticationManagerBuilder auth) throws Exception {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests().antMatchers("/auth/login","/auth/register").permitAll()
.authorizeRequests().antMatchers("/auth/login","/auth/register","/h2-console/**").permitAll()
.anyRequest().authenticated()
.and().sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS);
Expand Down
34 changes: 25 additions & 9 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
info.app.name=My Spring Boot Application
info.app.description=This is a demo application
info.app.name=Vls employee portal Spring Boot Application
info.app.description=Vls employee portal
info.app.version=1.0.0
info.company.name=MyCompany
info.company.name=Vls employee portal

management.endpoints.web.exposure.include=info,health
management.endpoint.info.enabled=true
management.security.enabled=true


spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.h2.console.enabled=true


# JPA Configuration
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect


spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update



# Enable SQL logging
spring.jpa.show-sql=true

# Format SQL queries for better readability
spring.jpa.properties.hibernate.format_sql=true

# Enable logging of SQL parameters
spring.jpa.properties.hibernate.use_sql_comments=false

# Optional: Log the executed SQL to a specific log level
#logging.level.org.hibernate.SQL=DEBUG
#logging.level.org.hibernate.type.descriptor.sql.BasicTypeDescriptor=TRACE


0 comments on commit 0799d5f

Please sign in to comment.