-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:added project access account templates
- Loading branch information
Showing
30 changed files
with
959 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
ledgers-account-access/ledgers-acount-access-repository/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
~ All rights are reserved. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>de.adorsys.ledgers</groupId> | ||
<artifactId>ledgers-account-access</artifactId> | ||
<version>6.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>ledgers-acount-access-repository</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<ruleset.basedir>../..</ruleset.basedir> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.persistence</groupId> | ||
<artifactId>jakarta.persistence-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.data</groupId> | ||
<artifactId>spring-data-jpa</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-autoconfigure</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
11 changes: 11 additions & 0 deletions
11
...nt-access-repository/src/main/java/de/adorsys/ledgers/aa/db/AccountAccessBasePackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db; | ||
//Purpose Package used to document this module. We user this | ||
//to reference the package to be scanned for repositories. | ||
|
||
public class AccountAccessBasePackage { | ||
} |
16 changes: 16 additions & 0 deletions
16
...pository/src/main/java/de/adorsys/ledgers/aa/db/AccountAccessRepositoryConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db; | ||
|
||
import org.springframework.context.annotation.*; | ||
import org.springframework.data.jpa.repository.config.*; | ||
@Configuration | ||
@ComponentScan(basePackageClasses = {AccountAccessBasePackage.class}) | ||
@EnableJpaRepositories | ||
//@EntityScan(basePackages = "de.adorsys.ledgers.aa.db.domain") | ||
|
||
public class AccountAccessRepositoryConfiguration { | ||
} |
19 changes: 19 additions & 0 deletions
19
...cess-repository/src/main/java/de/adorsys/ledgers/aa/db/EnableAccountAccessRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db; | ||
import org.springframework.context.annotation.Import; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
@Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) | ||
@Target(value = {java.lang.annotation.ElementType.TYPE}) | ||
@Documented | ||
@Import({ | ||
AccountAccessRepositoryConfiguration.class | ||
}) | ||
public @interface EnableAccountAccessRepository { | ||
} |
35 changes: 35 additions & 0 deletions
35
...-access-repository/src/main/java/de/adorsys/ledgers/aa/db/domain/AccountAccessEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.domain; | ||
import java.util.UUID; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Entity; | ||
import lombok.Data; | ||
@Entity | ||
@Data | ||
public class AccountAccessEntity { | ||
@Id | ||
@GeneratedValue | ||
private UUID id; | ||
|
||
private UUID entityId; | ||
private UUID accountId; | ||
private String name; | ||
private UUID template; // Reference to AccountAccessTemplateEntity | ||
|
||
// Constructors, getters and setters | ||
public AccountAccessEntity() { | ||
} | ||
|
||
public AccountAccessEntity(UUID entityId, UUID accountId, String name, UUID template) { | ||
this.entityId = entityId; | ||
this.accountId = accountId; | ||
this.name = name; | ||
this.template = template; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...repository/src/main/java/de/adorsys/ledgers/aa/db/domain/AccountAccessTemplateEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.domain; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
import lombok.Data; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.ElementCollection; | ||
|
||
@Entity | ||
@Data | ||
public class AccountAccessTemplateEntity { | ||
|
||
@Id | ||
@GeneratedValue | ||
private UUID id; | ||
|
||
private String templateName; | ||
@ElementCollection | ||
private List<String> permissions; | ||
@ElementCollection | ||
private List<String> parameters; | ||
|
||
// Constructors, getters and setters | ||
public AccountAccessTemplateEntity() { | ||
} | ||
|
||
public AccountAccessTemplateEntity(String templateName, List<String> permissions, List<String> parameters) { | ||
this.templateName = templateName; | ||
this.permissions = permissions; | ||
this.parameters = parameters; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...nt-access-repository/src/main/java/de/adorsys/ledgers/aa/db/domain/AgentAccessEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.domain; | ||
|
||
import java.util.UUID; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import lombok.Data; | ||
|
||
|
||
@Entity | ||
@Data | ||
public class AgentAccessEntity { | ||
|
||
@Id | ||
@GeneratedValue | ||
private UUID id; | ||
|
||
private UUID agentId; | ||
private UUID accountAccessId; | ||
private UUID subTemplate; // Reference to AccountAccessTemplateEntity | ||
|
||
// Constructors, getters and setters | ||
public AgentAccessEntity() { | ||
} | ||
|
||
public AgentAccessEntity(UUID agentId, UUID accountAccessId, UUID subTemplate) { | ||
this.agentId = agentId; | ||
this.accountAccessId = accountAccessId; | ||
this.subTemplate = subTemplate; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...repository/src/main/java/de/adorsys/ledgers/aa/db/repository/AccountAccessRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.repository; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import de.adorsys.ledgers.aa.db.domain.AccountAccessEntity; | ||
import java.util.UUID; | ||
|
||
public interface AccountAccessRepository extends JpaRepository<AccountAccessEntity, UUID> { | ||
} |
12 changes: 12 additions & 0 deletions
12
...ry/src/main/java/de/adorsys/ledgers/aa/db/repository/AccountAccessTemplateRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.repository; | ||
import de.adorsys.ledgers.aa.db.domain.AccountAccessTemplateEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import java.util.UUID; | ||
|
||
public interface AccountAccessTemplateRepository extends JpaRepository<AccountAccessTemplateEntity, UUID> { | ||
} |
13 changes: 13 additions & 0 deletions
13
...s-repository/src/main/java/de/adorsys/ledgers/aa/db/repository/AgentAccessRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.repository; | ||
import de.adorsys.ledgers.aa.db.domain.AgentAccessEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import java.util.UUID; | ||
import org.springframework.stereotype.Repository; | ||
@Repository | ||
public interface AgentAccessRepository extends JpaRepository<AgentAccessEntity, UUID> { | ||
} |
13 changes: 13 additions & 0 deletions
13
...ccess-repository/src/test/java/de/adorsys/ledgers/aa/db/test/AaRepositoryApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.db.test; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.SpringApplication; | ||
@SpringBootApplication | ||
public class AaRepositoryApplication { | ||
public static void main(String[] args){SpringApplication.run(AaRepositoryApplication.class, args);} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
ledgers-account-access/ledgers-acount-access-rest-api/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
~ All rights are reserved. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>de.adorsys.ledgers</groupId> | ||
<artifactId>ledgers-account-access</artifactId> | ||
<version>6.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>ledgers-acount-access-rest-api</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<ruleset.basedir>../..</ruleset.basedir> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>de.adorsys.ledgers</groupId> | ||
<artifactId>ledgers-acount-access-repository</artifactId> | ||
<version>6.1-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springdoc</groupId> | ||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
39 changes: 39 additions & 0 deletions
39
...-rest-api/src/main/java/de/adorsys/ledgers/aa/rest/api/resource/AccountAccessRestAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.rest.api.resource; | ||
|
||
import de.adorsys.ledgers.aa.db.domain.*; | ||
import io.swagger.v3.oas.annotations.*; | ||
import io.swagger.v3.oas.annotations.tags.*; | ||
import org.springframework.http.*; | ||
import org.springframework.web.bind.annotation.*; | ||
import java.util.*; | ||
@Tag(name = "Account Access", description = "Provide endpoint for managing account access.") | ||
@RequestMapping(AccountAccessRestAPI.BASE_PATH) | ||
public interface AccountAccessRestAPI { | ||
|
||
String BASE_PATH = "/api/accesses"; | ||
|
||
@Operation(summary = "Create an Account Access", description = "Create a new account access entity") | ||
@PostMapping | ||
ResponseEntity<AccountAccessEntity> createAccess(@RequestBody AccountAccessEntity access); | ||
|
||
@Operation(summary = "Get Account Access by ID", description = "Retrieve an account access entity by its unique ID") | ||
@GetMapping("/{id}") | ||
ResponseEntity<AccountAccessEntity> getAccessById(@PathVariable UUID id); | ||
|
||
@Operation(summary = "Get All Account Accesses", description = "Retrieve a list of all account access entities") | ||
@GetMapping | ||
ResponseEntity<List<AccountAccessEntity>> getAllAccesses(); | ||
|
||
@Operation(summary = "Update an Account Access", description = "Update an existing account access entity by its ID") | ||
@PutMapping("/{id}") | ||
ResponseEntity<AccountAccessEntity> updateAccess(@PathVariable UUID id, @RequestBody AccountAccessEntity access); | ||
|
||
@Operation(summary = "Delete an Account Access", description = "Delete an account access entity by its unique ID") | ||
@DeleteMapping("/{id}") | ||
ResponseEntity<Void> deleteAccess(@PathVariable UUID id); | ||
} |
38 changes: 38 additions & 0 deletions
38
...i/src/main/java/de/adorsys/ledgers/aa/rest/api/resource/AccountAccessTemplateRestAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG | ||
* All rights are reserved. | ||
*/ | ||
|
||
package de.adorsys.ledgers.aa.rest.api.resource; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import de.adorsys.ledgers.aa.db.domain.AccountAccessTemplateEntity; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@RequestMapping("/api/templates") | ||
public interface AccountAccessTemplateRestAPI { | ||
|
||
@PostMapping | ||
ResponseEntity<AccountAccessTemplateEntity> createTemplate(@RequestBody AccountAccessTemplateEntity template); | ||
|
||
@GetMapping("/{id}") | ||
ResponseEntity<AccountAccessTemplateEntity> getTemplateById(@PathVariable UUID id); | ||
|
||
@GetMapping | ||
ResponseEntity<List<AccountAccessTemplateEntity>> getAllTemplates(); | ||
|
||
@PutMapping("/{id}") | ||
ResponseEntity<AccountAccessTemplateEntity> updateTemplate(@PathVariable UUID id, @RequestBody AccountAccessTemplateEntity template); | ||
|
||
@DeleteMapping("/{id}") | ||
ResponseEntity<Void> deleteTemplate(@PathVariable UUID id); | ||
} |
Oops, something went wrong.