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

APIRule v2alpha1 path validation and behaviour is wrong #1282

Open
strekm opened this issue Sep 4, 2024 · 2 comments
Open

APIRule v2alpha1 path validation and behaviour is wrong #1282

strekm opened this issue Sep 4, 2024 · 2 comments
Assignees
Labels
area/api-gateway Issues or PRs related to api-gateway kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@strekm
Copy link
Collaborator

strekm commented Sep 4, 2024

Description

According to proposal path can be either exact match or wildcard *.

APIRule v2alpha1 accepts ./* as valid path. Calling workload results in 404.

Expected result

Accepted path should be either exact match or *. Workload does not return 404.

Actual result

./* is accepted as valid. Workload returns 404

Steps to reproduce

export NAMESPACE=test
export GATEWAY=kyma-system/kyma-gateway
export DOMAIN_TO_EXPOSE_WORKLOADS={KYMA_DOMAIN}

cat <<EOF | kubectl apply -f -
apiVersion: gateway.kyma-project.io/v2alpha1
kind: APIRule
metadata:
  name: httpbin
  namespace: $NAMESPACE
spec:
  hosts: 
    - httpbin.$DOMAIN_TO_EXPOSE_WORKLOADS
  service:
    name: httpbin
    namespace: $NAMESPACE
    port: 8000
  gateway: $GATEWAY
  rules:
    - path: ./*
      methods: ["GET"]
      noAuth: true
EOF

Troubleshooting
Tests for validation and first implementation to fix this can be found in the PR #1285.

PR

@strekm strekm added kind/bug Categorizes issue or PR as related to a bug. area/api-gateway Issues or PRs related to api-gateway labels Sep 4, 2024
@strekm
Copy link
Collaborator Author

strekm commented Sep 5, 2024

ok so ./* was typo on my side. either way it should not be accepted as valid. only * or exact match should be valid

@triffer triffer self-assigned this Sep 12, 2024
@triffer triffer added this to the 2.7.0 milestone Sep 13, 2024
@triffer
Copy link
Collaborator

triffer commented Sep 13, 2024

It was agreed that we will allow /* instead of * in the rule path to expose all paths. The ADR should also be updated with this topic.

@triffer triffer removed their assignment Sep 13, 2024
@barchw barchw self-assigned this Sep 13, 2024
@kolodziejczak kolodziejczak assigned triffer and unassigned barchw Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api-gateway Issues or PRs related to api-gateway kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants