Skip to content

Commit

Permalink
jwt implementation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IN40068837 authored and IN40068837 committed Dec 10, 2024
1 parent 2f45084 commit bc62684
Show file tree
Hide file tree
Showing 13 changed files with 499 additions and 41 deletions.
40 changes: 29 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.3.2</version>
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.3.2</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -189,17 +189,15 @@
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>7.0.2</version>
</dependency>


<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
Expand Down Expand Up @@ -235,6 +233,27 @@
<artifactId>json-path</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.12.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-impl -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-jackson -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>


</dependencies>

Expand All @@ -250,7 +269,7 @@
<format>HTML</format>
<nvdApiServerId>nvd</nvdApiServerId>
</configuration>

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -329,8 +348,7 @@
${target-properties} and
${source-properties}
</echo>
<concat destfile="${target-properties}"
append="yes"
<concat destfile="${target-properties}" append="yes"
force="yes">
<fileset file="${source-properties}">
</fileset>
Expand Down
3 changes: 2 additions & 1 deletion src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ logging.level.com.iemr=DEBUG
logging.level.org.springframework=INFO

#ELK logging file name
logging.file.name=@env.FHIR_API_LOGGING_FILE_NAME@
logging.file.name=@env.FHIR_API_LOGGING_FILE_NAME@
jwt.secret=@JWT_SECRET_KEY@
1 change: 1 addition & 0 deletions src/main/environment/common_dev.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
logging.level.com.iemr=DEBUG
logging.level.org.springframework=INFO
jwt.secret=@JWT_SECRET_KEY@
1 change: 1 addition & 0 deletions src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
logging.level.com.iemr=DEBUG
logging.level.org.springframework=INFO
jwt.secret=@JWT_SECRET_KEY@
1 change: 1 addition & 0 deletions src/main/environment/common_test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
logging.level.com.iemr=DEBUG
logging.level.org.springframework=INFO
jwt.secret=@JWT_SECRET_KEY@
74 changes: 74 additions & 0 deletions src/main/java/com/wipro/fhir/data/users/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.wipro.fhir.data.users;

import java.sql.Timestamp;

import com.google.gson.annotations.Expose;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

@Entity
@Table(name = "m_user")
@Data
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose
@Column(name = "UserID")
private Long userID;

@Expose
@Column(name = "TitleID")
private Integer titleID;
@Expose
@Column(name = "FirstName")
private String firstName;
@Expose
@Column(name = "MiddleName")
private String middleName;
@Expose
@Column(name = "LastName")
private String lastName;

@Expose
@Column(name = "GenderID")
private Integer genderID;

@Expose
@Column(name = "MaritalStatusID")
private Integer maritalStatusID;

@Expose
@Column(name = "StatusID")
private Integer statusID;

@Expose
@Column(name = "DOB")
private Timestamp dOB;
@Expose
@Column(name = "DOJ")
private Timestamp dOJ;
@Expose
@Column(name = "QualificationID")
private Integer qualificationID;
@Expose
@Column(name = "userName")
private String userName;
@Expose
@Column(name = "Deleted", insertable = false, updatable = true)
private Boolean deleted;
@Expose
@Column(name = "CreatedBy")
private String createdBy;
@Column(name = "CreatedDate", insertable = false, updatable = false)
private Timestamp createdDate;
@Column(name = "ModifiedBy")
private String modifiedBy;
@Column(name = "LastModDate", insertable = false, updatable = false)
private Timestamp lastModDate;
}
11 changes: 11 additions & 0 deletions src/main/java/com/wipro/fhir/repo/user/UserRepository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.wipro.fhir.repo.user;

import org.springframework.data.repository.CrudRepository;

import com.wipro.fhir.data.users.User;

public interface UserRepository extends CrudRepository<User, Long> {

User findByUserID(Long userID);

}
Loading

0 comments on commit bc62684

Please sign in to comment.