Skip to content

Commit

Permalink
Adjusting formatting and addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrichlake committed Oct 4, 2023
1 parent 359013f commit 36aa411
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# CDC Trusted Intermediary

## Requirements

Any distribution of the Java 17 JDK.

For apple silicon you will want to enable the Docker option for `Use Rosetta for x86/amd64 emulation on Apple Silicon`.
After enabling this option it is recommended that you delete all docker images and containers and rebuild them
with this option enabled.

## Using and Running

To run the application directly, execute...

```shell
Expand All @@ -18,6 +12,15 @@ To run the application directly, execute...

This will run the web API on port 8080. You can view the API documentation at `/openapi`.

### Generating and using a token
1. Run `brew install mike-engel/jwt-cli/jwt-cli`
2. Run `jwt encode --exp='+5min' --jti $(uuidgen) --alg RS256 --no-iat -S @/PATH_TO_FILE_ON_YOUR_MACHINE/trusted-intermediary/mock_credentials/organization-trusted-intermediary-private-key-local.pem`
3. Copy token from terminal and paste into your postman body with the key `client_assertion`
4. Add a key to the body with the key `scope` and value of `trusted-intermediary`
5. Body type should be `x-wwww-form-urlencoded`
6. You should be able to run the post call against the `v1/auth/token` endpoint to receive a bearer token [to be used in this step](#submit-request-to-reportstream)


## Development

### Additional Requirements
Expand Down Expand Up @@ -215,15 +218,12 @@ CDC including this GitHub page may be subject to applicable federal law, includi
```
3. Run TI with `REPORT_STREAM_URL_PREFIX=http://localhost:7071 ./gradlew clean app:run`

#### ReportStream Setup
## ReportStream Setup

For Apple Silicon you will want to enable the Docker option for `Use Rosetta for x86/amd64 emulation on Apple Silicon`.
After enabling this option it is recommended that you delete all docker images and containers and rebuild them
with this option enabled.

### Generating and using a token
1. Run `brew install mike-engel/jwt-cli/jwt-cli`
2. Run `jwt encode --exp='+5min' --jti $(uuidgen) --alg RS256 --no-iat -S @/PATH_TO_FILE_ON_YOUR_MACHINE/trusted-intermediary/mock_credentials/organization-trusted-intermediary-private-key-local.pem`
3. Copy token from terminal and paste into your postman body with the key `client_assertion`
4. Add a key to the body with the key `scope` and value of `trusted-intermediary`
5. Body type should be `x-wwww-form-urlencoded`
6. You should be able to run the post call against the `v1/auth/token` endpoint to receive a bearer token [to be used in this step](#submit-request-to-reportstream)

### Running TI with ReportStream

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public Map<HttpEndpoint, Function<DomainRequest, DomainResponse>> domainRegistra
ApplicationContext.register(OrderController.class, OrderController.getInstance());
ApplicationContext.register(SendOrderUseCase.class, SendOrderUseCase.getInstance());

if (ApplicationContext.getEnvironment().equalsIgnoreCase("local")) {
ApplicationContext.register(OrderSender.class, LocalFileOrderSender.getInstance());
} else {
// if (ApplicationContext.getEnvironment().equalsIgnoreCase("local")) {
// ApplicationContext.register(OrderSender.class, LocalFileOrderSender.getInstance());
// } else {
ApplicationContext.register(OrderSender.class, ReportStreamOrderSender.getInstance());
}
// }

return endpoints;
}
Expand Down

0 comments on commit 36aa411

Please sign in to comment.