Add security models and docker config

This commit is contained in:
Lina Rusakova committed 2026-11-04 18:48:36 +03:00
1 parent 7b96b275c1
commit 51181c70dc
5 files changed
+1933

No files matched your search

File diff suppressed because it is too large. Load diff
+4
View File
@@ -21,15 +21,19 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-liquibase'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-security'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-starter-liquibase-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
testCompileOnly 'org.projectlombok:lombok'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testAnnotationProcessor 'org.projectlombok:lombok'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
@@ -7,3 +7,4 @@ services:
- POSTGRES_DB=${MESSAGESERV_DB_NAME}
ports:
- '${MESSAGESERV_DB_PORT}:5432'
# docker compose --env-file ~/Documents/venv/messageserv.env up -d
@@ -0,0 +1,22 @@
package com.example.messageserv.security.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.userdetails.UserDetails;
@Setter
@Getter
@Entity
@Table(schema = "identity", name="user_accounts")
public class UserAccount implements UserDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(unique = true, nullable = false)
private String username;
}
@@ -0,0 +1,19 @@
package com.example.messageserv.security.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
@Setter
@Getter
@Entity
@Table(schema = "identity", name="user_roles")
public class UserRole implements GrantedAuthority {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String authorirty;
}