-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple secrets manager library usage (#66)
* start refactor using templates * dirs creation using json template * generate model using templates * remove redundant dirs from json array * refactor default task name * extract base task methods to module builder, build azure pipeline with templates * update usecase generation with template * update usecase generation with template * generate rest entrypoints with template * generate rest entrypoints with template * generate adapters and entrypoints using templates * append dependencies to subproject, update yaml properties * add some unit tests * add some unit tests * update version and readme * update gitignore * add new projec dependencies automatically to build.gradle, update h2 setup for jpa, generate generic driven adapter and entry point * release new version with mustache templates * add some test * fix source compatibility * fix source compatibility * move jpa commons directly in jpa driven adapter * move mongo commons directly in mongodb driven adapter * update functional test * fix merge * setup config model for mongodb * add some unit test assertions * allow secrets manager option creating a datasource driven adapter * update readme task options * create some unit test * update version, fix some code smell * remove unused autogenerated methods * remove module depencency
- Loading branch information
1 parent
bee277d
commit 9d747ae
Showing
37 changed files
with
367 additions
and
114 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
package=co.com.bancolombia | ||
systemProp.version=1.6.0 | ||
systemProp.version=1.6.1 |
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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/co/com/bancolombia/factory/adapters/DrivenAdapterSecrets.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,22 @@ | ||
package co.com.bancolombia.factory.adapters; | ||
|
||
import co.com.bancolombia.Constants; | ||
import co.com.bancolombia.exceptions.CleanException; | ||
import co.com.bancolombia.factory.ModuleBuilder; | ||
import co.com.bancolombia.factory.ModuleFactory; | ||
|
||
import java.io.IOException; | ||
|
||
public class DrivenAdapterSecrets implements ModuleFactory { | ||
@Override | ||
public void buildModule(ModuleBuilder builder) throws IOException, CleanException { | ||
if (builder.getBooleanParam("include-secret")) { | ||
builder.setupFromTemplate("driven-adapter/secrets"); | ||
builder.appendDependencyToModule("app-service", | ||
"compile 'co.com.bancolombia:secretsmanager:" + Constants.SECRETS_VERSION + "'"); | ||
builder.appendToProperties("aws") | ||
.put("region", "us-east-1") | ||
.put("secretName", "my-secret"); | ||
} | ||
} | ||
} |
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
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
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
8 changes: 6 additions & 2 deletions
8
src/main/java/co/com/bancolombia/models/TemplateDefinition.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
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
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
5 changes: 2 additions & 3 deletions
5
src/main/resources/driven-adapter/jpa-repository/build.gradle.mustache
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
22 changes: 22 additions & 0 deletions
22
src/main/resources/driven-adapter/jpa-repository/config/db-secret.java.mustache
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,22 @@ | ||
package {{package}}.jpa.config; | ||
|
||
{{#include-secret}} | ||
import lombok.Data; | ||
{{/include-secret}} | ||
{{^include-secret}} | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
{{/include-secret}} | ||
|
||
{{#include-secret}} | ||
@Data | ||
{{/include-secret}} | ||
{{^include-secret}} | ||
@Builder | ||
@Getter | ||
{{/include-secret}} | ||
public class DBSecret { | ||
private {{^include-secret}}final {{/include-secret}}String url; | ||
private {{^include-secret}}final {{/include-secret}}String username; | ||
private {{^include-secret}}final {{/include-secret}}String password; | ||
} |
Oops, something went wrong.