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] [ip-filtering] Policy needs gravitee-policy-api.version to be updated #755

Closed
YaytayAtWork opened this Issue Aug 29, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@YaytayAtWork

YaytayAtWork commented Aug 29, 2017

The IPFilteringPolicy generates:
Caused by: java.lang.AbstractMethodError: io.gravitee.policy.ipfiltering.IPFilteringPolicy$1.contentType()Ljava/lang/String;
at io.gravitee.gateway.handlers.api.ApiReactorHandler.sendPolicyFailure(ApiReactorHandler.java:218)
at io.gravitee.gateway.handlers.api.ApiReactorHandler.lambda$doHandle$11(ApiReactorHandler.java:110)

when the request fails the policy.

This is because the Request interface has had "contentType" added to it, but the policy hasn't been updated to reflect this.

Searching for gravitee-policy-api.version shows that quite a few other policies are also still on 1.0.0.

Expected Behavior

A 403 Forbidden response.

Current Behavior

A 500 response, with the stack trace above in the gravitee log.

Possible Solution

Update gravitee-policy-api.version in the pom and implement contentType for PolicyResult.

Steps to Reproduce (for bugs)

  1. Configure an API with an IP Filter Policy.
  2. Send in a request that break the policy.

Context

Getting a confusing error message.

Your Environment

  • Version used: 1.8.3
  • Operating System and version: CentOS 7
  • JDK: 1.8.141
@YaytayAtWork

This comment has been minimized.

YaytayAtWork commented Aug 29, 2017

Also, SubnetUtils.isInRange doesn't work correctly for some CIDRs with version 3.4 of commons.net.
This appears to be fixed in 3.6.

@brasseld

This comment has been minimized.

Member

brasseld commented Aug 29, 2017

Hi @YaytayAtWork,

Can you provide a PR for these issues ?

@brasseld

This comment has been minimized.

Member

brasseld commented Aug 29, 2017

Ok, let me fix it.
The issue is accurate for this policy.

brasseld added a commit to gravitee-io/gravitee-policy-ipfiltering that referenced this issue Aug 29, 2017

@brasseld brasseld self-assigned this Aug 29, 2017

@brasseld brasseld changed the title from IPFilteringPolicy (and many others?) needs gravitee-policy-api.version to be updated to [policy] [ip-filtering] Policy needs gravitee-policy-api.version to be updated Aug 29, 2017

@brasseld brasseld added the type: bug label Aug 30, 2017

@brasseld brasseld added this to the 1.9.0 milestone Sep 1, 2017

NicolasGeraud added a commit to gravitee-io/gravitee-policy-ipfiltering that referenced this issue Sep 3, 2017

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