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

Parametric headers or looser value matching. #75

Closed
zakhenry opened this issue Jul 23, 2015 · 3 comments
Closed

Parametric headers or looser value matching. #75

zakhenry opened this issue Jul 23, 2015 · 3 comments
Labels

Comments

@zakhenry
Copy link

Is it possible to have the same loose matching on route segments with parameters for matching against headers?

I have a use case where one of the required request headers is an Authorization: Bearer <token> header, but the<token> can change for many different reasons.

Is it possible to loose matching on the headers?

@yakovkhalinsky
Copy link
Contributor

Thanks for the question @xiphiaz we'll discuss this over the next week and we'll have a look at how easy it will be to implement, and respond in this issue as to our thoughts 👍

@marcelogo
Copy link
Contributor

@xiphiaz

I wonder if you are also using your contract files for documentation purposes.

If you are only describing scenarios you could double that example and make another one without Authorization header.

Eg

FORMAT: 1A

# The api

## A rest resource [/api/resource]

### Link it [GET]

+ Request

    + Headers

            Authorization: something

+ Response 204 

+ Request

+ Response 201 

In this case when Drakov cannot match the Authorization header it will fallback to the second example.

Would that anyhow help you?

We are closing this issue.

Please let us know if you need help.

@zakhenry
Copy link
Author

@marcelogo The scenario is the use of drakov to mock an api that requires authorization. Without this feature it means I would have to set the authorization header to a fixed value defined in the contract file. It's not really a big problem, it just makes for an extra step the use drakov as a mock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants