Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
on bind to slugs=true then add a path separator on oauth paths (TykTe…
…chnologies#3015) Behaviour of `/{yourapi}/oauth/token` change depending of the value of `slave_options.bind_to_slugs` ## Description On bind to slugs we are not setting a slash at the end of the route, then, in `addOAuthHandlers` we concatenate a route to that path without adding a separator between slug and `oauthPath`, so, was added that slash depending of the value of `slave_options.bind_to_slugs` otherwise we would need to hit the route `/{yourapi}oauth/token` to have the same result (current behaviour). Other Oauth routes were affected by this same behaviour, so was added the separator as well. Now, we need to be able to revoke tokens issued locally, currently we revoke tokens issued from dashboard/master GW, this change will be done in a different PR ## Related Issue TykTechnologies/tyk-analytics#1842 ## Motivation and Context Solves TykTechnologies/tyk-analytics#1842 so in slave GW we are allowed to issue oauth tokens no matter what is the value of `bind_to_slugs` ## How This Has Been Tested - Created an API (from dashboard) - Created an Oauth Client (from dashboard) - Run Slave gateway - Request a token with `slave_options.bind_to_slugs=true` - Request a token with `slave_options.bind_to_slugs=false` ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If you're unsure about any of these, don't hesitate to ask; we're here to help! --> - [x] Make sure you are requesting to **pull a topic/feature/bugfix branch** (right side). If pulling from your own fork, don't request your `master`! - [x] Make sure you are making a pull request against the **`master` branch** (left side). Also, you should start *your branch* off *our latest `master`*. - [ ] My change requires a change to the documentation. - [ ] If you've changed APIs, describe what needs to be updated in the documentation. - [ ] I have updated the documentation accordingly. - [ ] Modules and vendor dependencies have been updated; run `go mod tidy && go mod vendor` - [ ] I have added tests to cover my changes. - [x] All new and existing tests passed. - [x] Check your code additions will not fail linting checks: - [x] `go fmt -s` - [ ] `go vet`
- Loading branch information