Skip to content

Commit

Permalink
Add to pact readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-in-a-Jar committed Oct 30, 2023
1 parent 68d1a53 commit b31ea48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions pact4s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The credentials for authenticating with the Pact Broker can be found here:
On the command line, you can try the following:

```shell
source env/local.env
source src/main/resources/rendered/secrets.env
export PACT_BROKER_URL="https://pact-broker.dsp-eng-tools.broadinstitute.org/"
export PACT_BROKER_USERNAME=$(vault read -field=basic_auth_read_only_username secret/dsp/pact-broker/users/read-only)
export PACT_BROKER_PASSWORD=$(vault read -field=basic_auth_read_only_password secret/dsp/pact-broker/users/read-only)
Expand All @@ -21,6 +23,12 @@ In IntelliJ, you can create a Run Configuration for `SamProviderSpec.scala` and
* `PACT_BROKER_USERNAME`
* `PACT_BROKER_USERNAME`

Or you can run the following command from the root of the project:

```shell
sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec"
```

## References
* https://broadworkbench.atlassian.net/wiki/spaces/IRT/pages/2660368406/Getting+Started+with+Pact+Contract+Testing
* https://broadworkbench.atlassian.net/wiki/spaces/IRT/pages/2681143308/Pact+Broker+Infrastructure
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ object MockTestSupport extends MockTestSupport {

// Override the withUserAllowInactive in MockSamUserDirectives to include
// support for user status info request with or without access token
override def withUserAllowInactive(samRequestContext: SamRequestContext): Directive1[SamUser] = {
override def withUserAllowInactive(samRequestContext: SamRequestContext): Directive1[SamUser] =
extractRequest.flatMap { request =>
// Use an extractRequest Directive to capture the headers for debugging purpose
val headers = request.headers
Expand All @@ -221,9 +221,9 @@ object MockTestSupport extends MockTestSupport {
complete(StatusCodes.Unauthorized)
}
}
}

override val adminConfig: AdminConfig = AdminConfig(superAdminsGroup = WorkbenchEmail(""), allowedEmailDomains = Set.empty, serviceAccountAdmins = Set.empty)
override val adminConfig: AdminConfig =
AdminConfig(superAdminsGroup = WorkbenchEmail(""), allowedEmailDomains = Set.empty, serviceAccountAdmins = Set.empty)

override def asAdminServiceUser: Directive0 = Directive.Empty
}
Expand Down

0 comments on commit b31ea48

Please sign in to comment.