-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring-cloud-stub-runner issue with downloading pact contracts #264
Comments
That's |
running 'gradlew build' generates the below error: Execution failed for task ':copyContracts'.
Having difficulty debugging locally. IntelliJ detects source and class out of sync despite manually synching the jar |
Getting back on this one. Upon further investigations, the below stacktrace results in an empty string being returned as remote repository which generates the IllegalStateException with 'Remote repositories for stubs are not specified and work offline flag wasn't passed' :
I am using 2.2.6.RELEASE version. |
It tries to use various stub downloaders. If you scroll the logs up you will see that the PACT one failed. We do support token based auth in 3.0.x https://github.com/spring-cloud/spring-cloud-contract/blob/v3.0.3/spring-cloud-contract-tools/spring-cloud-contract-pact/src/main/java/org/springframework/cloud/contract/stubrunner/PactStubDownloaderBuilder.java#L293 |
There is no indication on the log that i think there was an attempt. i upgraded 3.0.3 and updated the plugin config in gradle to following:
However, I still get error 'Could not set unknown property 'token' for ContractRepository'. I assume that is right way to configure token value. Can you confirm? |
Have you added spring-cloud-contract-pact to the plugin's classpath? |
Also what is token? We don't provide such a field to configure the Gradle plugin |
Do you have any documentation on how to to configure the token value? I was looking that source reference and your documentation here https://docs.spring.io/spring-cloud-contract/docs/3.0.0-SNAPSHOT/reference/htmlsingle/#how-to-use-pact-broker and assumed I can set the token attribute along with repo url. If that is not correct then please provide example of how to set the value. Thanks |
Any update on this issue? I am unable to determine how to correctly set auth token for pact broker. |
This is how we set up the pact properties https://github.com/spring-cloud/spring-cloud-contract/blob/main/spring-cloud-contract-tools/spring-cloud-contract-pact/src/main/java/org/springframework/cloud/contract/stubrunner/PactStubDownloaderBuilder.java#L313-L358 You can try passing
|
I've attempted to set the system property -Dpactbroker.auth.token as following: 1.
I also attempted to include in contractProperties as following:
However, I am still getting 401 in response back from the broker. This is what I gathered from DEBUG log what is being passed:
|
This is the same issue as gh-178. |
Describe the bug
I've a consumer project which published a Pact contract to a remote pact repo successfully. Now I am trying to auto-generate the verifier test in Producer project using spring-cloud-contract-pact project. I added the following bits in by build.gradle file to configure test generation:
When I build my project it fails. Upon further investigation, I found the copyContract gradle task is failing with the following:
I am following the example from your sample producer-pact directory here. Not sure what needs to be configured to resolve the issue. Also, I noticed that currently username/password based authentication is supported. However, I have configured authentication to my pact repo using bearer token. Is token based authentication supported?
The text was updated successfully, but these errors were encountered: