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

[policy] policy to check existing param #650

Closed
vdelattre opened this Issue Jun 19, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@vdelattre

vdelattre commented Jun 19, 2017

It could be useful to have policy to check that query param or header exists in request and / or check that value is in good type and good value

Your Environment

  • Version used: 1.6.3
@Matsa59

This comment has been minimized.

Matsa59 commented Jul 17, 2017

You can use the groovy policy to check query param, header, content, ...
Have a look on onRequest and onRequestContent

for example :

if (request.headers.containsKey('X-Gravitee-Break')) {
    result.state = FAILURE
    result.code = 500
    result.error = 'Stop request processing due to X-Gravitee-Break header'
} else {
    request.headers.'X-Groovy-Policy' = 'ok'
}

Wait for the new version, it will implement everything that you need

brasseld added a commit to gravitee-io/gravitee-policy-request-validation that referenced this issue Sep 7, 2017

brasseld added a commit to gravitee-io/gravitee-policy-request-validation that referenced this issue Sep 8, 2017

@NicolasGeraud NicolasGeraud added this to the 1.9.0 milestone Sep 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment