Skip to content
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

Support bearer token with JUnit annotations - Fixes gh-925 #951

Merged
merged 2 commits into from
Oct 27, 2019

Conversation

tinexw
Copy link

@tinexw tinexw commented Oct 5, 2019

I decided to do the first option since it was easier to implement. Should I add checks somewhere that the correct combination of values is set?

@uglyog
Copy link
Member

uglyog commented Oct 13, 2019

I think the scheme can be defaulted if the token property is set. That way people will only need to set the token value. I.e.,

authentication = @PactBrokerAuth(token = "test")

instead of

authentication = @PactBrokerAuth(scheme = "bearer", token = "test")

@tinexw
Copy link
Author

tinexw commented Oct 13, 2019

Yes, makes sense. Will add this.

@tinexw tinexw force-pushed the 925-bearer-token branch 5 times, most recently from b47236b to d62b05b Compare October 21, 2019 08:18
@tinexw
Copy link
Author

tinexw commented Oct 21, 2019

I changed the implementation so that it is now possible to say

authentication = @PactBrokerAuth(token = "test")

I marked the scheme attribute as deprecated. It is now automatically set to

  • Basic if the username is set
  • Bearer if the token is set

I hope marking it as deprecated is ok. It did not see it being used anywhere. Please let me know if it is actually of use somewhere and we should keep it.

@uglyog
Copy link
Member

uglyog commented Oct 27, 2019

Deprecated makes sense. It's really there in case other authentication schemes are required, but the implementation would not be supported so it is redundant.

@uglyog uglyog merged commit 079e673 into pact-foundation:master Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants