Closed ABGEO closed 4 years ago
Hi there @ABGEO, and thanks a lot for your contribution!
Would you be able to add some tests and docs for this feature as well?
@christeredvartsen sure. I will provide them.
@christeredvartsen I added some tests and updated the documentation. I think this PR is ready for review.
Could you please grant me write-access to your fork so I can push some small changes?
@christeredvartsen sure. I have invited you.
I've been doing some thinking (big words!), and what about we do the following change before merging:
@Given
that includes all the params@Given
's for other grant typesWhat do you think about this? Using a client configuration restricts the extension to be using only one set of "rules" at a time, while having the details in the Given
's, developers can have as many combinations as they want.
For this to work though, the Given
will be a bit longer, but given good enough documentation I don't think this is a huge issue. The existing one could for instance look like this:
@Given I get an OAuth access token from :path with :username and :password in scope :scope using :clientId and :clientSecret
If we want to add support for the authorization_code
grant type, we could do something like this:
@Given I get an OAuth access token from :path with code :code in scope :scope using :clientId and :clientSecret
If you think this sounds like a good idea I can push some changes to your branch and we can see where it goes?
Also, when using the password
grant type, the client_secret
is usually not sent, right? So the existing Given
won't be as long as the one I wrote above.
So the Given
could be for instance:
@Given I get an OAuth token using password grant from :path with :username and :password in scope :scope using client ID :clientId( and :clientSecret)
If you think this sounds like a good idea I can push some changes to your branch and we can see where it goes?
@christeredvartsen sounds good to me. I think we can go this way.
@ABGEO Could you go over my latest commit and give it :+1: or :-1:? The step text is pretty long (a clear :-1:) but it removes the client configuration requirement which in my mind is :+1:.
@christeredvartsen great work :+1:
In my opinion, developers will use this step only once per Feature - in the Background
block, so I think that this will not cause any problems.
Thanks a lot for the pull request. I will add some other minor stuff and release 3.0.0
in a short while.
Hi,
I implemented a feature that will enable us to send an OAuth request and set the
Authorization
header with the returned access token.Now you can use:
Given I use OAuth with "my_username" and "my_password" in scope "my_scope"
I think it will be useful. To have this feature in my project, I expanded the
ApiContext
class :)