-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
642 additions
and
532 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 +1,104 @@ | ||
# 03-simulation | ||
# 03-simulation | ||
Use this to add Company specific Simulation stuff like the configuration of the auth method. | ||
|
||
The following structure is generated by `./helperCompany.scala init`: | ||
|
||
```bash | ||
03-simulation/src | ||
| main/resources | ||
| main/scala/company/simulation | ||
| | CompanySimulation.scala | ||
| test/scala/company/simulation | ||
``` | ||
## CompanySimulation | ||
The Company's base class to run the Simulations. | ||
|
||
Example (generated by `./helperCompany.scala init`): | ||
|
||
```scala | ||
package mycompany.camundala.simulation | ||
|
||
import camundala.simulation.custom.* | ||
|
||
/** | ||
* Add here company specific stuff, to run the Simulations. | ||
*/ | ||
trait CompanySimulation extends BasicSimulationDsl: | ||
|
||
override def config = | ||
super.config //TODO Adjust config if needed | ||
|
||
end CompanySimulation | ||
``` | ||
|
||
## SimulationConfig | ||
You can customize the Simulation Configuration. | ||
|
||
```scala | ||
super.config | ||
.withTenantId("myTenant") | ||
``` | ||
### Default Config | ||
|
||
```scala | ||
// define tenant if you have one | ||
tenantId: Option[String] = None, | ||
// the Camunda Port | ||
// there are Requests that wait until the process is ready - like getTask. | ||
// the Simulation waits 1 second between the Requests. | ||
// so with a timeout of 10 sec it will try 10 times (retryDuration = 1.second) | ||
maxCount: Int = 10, | ||
// REST endpoint of Camunda | ||
endpoint: String = "http://localhost:8080/engine-rest", | ||
// you can add authentication with this - default there is none. | ||
// see BasicSimulationDsl / OAuthSimulationDsl for examples | ||
authHeader: B => B = (b: B) => b, | ||
// the maximum LogLevel you want to print the LogEntries. | ||
logLevel: LogLevel = LogLevel.INFO | ||
``` | ||
|
||
|
||
## Authentication | ||
We provide at the moment the following authentication methods: | ||
|
||
### Basic Authentication | ||
|
||
```scala | ||
import camundala.simulation.custom.* | ||
|
||
trait CompanySimulation extends BasicSimulationDsl: | ||
|
||
override lazy val username = sys.env.getOrElse("CAMUNDA_USER", "demo") | ||
override lazy val password = sys.env.getOrElse("CAMUNDA_PASSWORD", "demo") | ||
//... | ||
``` | ||
|
||
You can override the `username` and `password` to use your credentials, | ||
default is `demo`/`demo`. | ||
|
||
### OAuth2 Authentication | ||
|
||
```scala | ||
import camundala.simulation.custom.* | ||
|
||
trait CompanySimulation extends OAuthSimulationDsl: | ||
|
||
lazy val fsso: Fsso = Fsso( | ||
s"$fssoBaseUrl/auth/realms/${config.tenantId.get}/protocol/openid-connect", | ||
Map( | ||
"grant_type" -> "password", | ||
"client_id" -> "bpf", | ||
"client_secret" -> fssoClientSecret, | ||
"username" -> fssoUser, | ||
"password" -> fssoPassword, | ||
"scope" -> "fcs" | ||
)) | ||
//... | ||
private lazy val fssoBaseUrl = sys.env.getOrElse("FSSO_BASE_URL", "http://host.lima.internal:8090") | ||
//... | ||
``` | ||
|
||
Here you have to provide the FSSO configuration. | ||
- `Fsso.url` is the URL of the FSSO Server. | ||
- `Fsso.bodyForm` is the body of the POST request to get the token. | ||
|
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
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
Oops, something went wrong.