Add security models and docker config
This commit is contained in:
1 parent
7b96b275c1
commit
51181c70dc
5 files changed
+1933
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -21,15 +21,19 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-liquibase'
|
implementation 'org.springframework.boot:spring-boot-starter-liquibase'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
runtimeOnly 'org.postgresql:postgresql'
|
runtimeOnly 'org.postgresql:postgresql'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
|
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-liquibase-test'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
||||||
|
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
|
||||||
testCompileOnly 'org.projectlombok:lombok'
|
testCompileOnly 'org.projectlombok:lombok'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok'
|
testAnnotationProcessor 'org.projectlombok:lombok'
|
||||||
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
|
|||||||
+1
@@ -7,3 +7,4 @@ services:
|
|||||||
- POSTGRES_DB=${MESSAGESERV_DB_NAME}
|
- POSTGRES_DB=${MESSAGESERV_DB_NAME}
|
||||||
ports:
|
ports:
|
||||||
- '${MESSAGESERV_DB_PORT}:5432'
|
- '${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;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user