Skip to content

Commit

Permalink
feat: oas path validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jspdown authored Jan 9, 2025
1 parent 9a0159d commit aafd8b8
Show file tree
Hide file tree
Showing 94 changed files with 116 additions and 94 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/access_control_policy.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/ai_service.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
6 changes: 5 additions & 1 deletion pkg/apis/hub/v1alpha1/api.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -86,6 +86,10 @@ type OpenAPISpec struct {
// +optional
// +kubebuilder:validation:MaxItems=100
OperationSets []OperationSet `json:"operationSets,omitempty"`

// ValidateRequestMethodAndPath validates that the path and method matches an operation defined in the OpenAPI specification.
// This option overrides the default behavior configured in the static configuration.
ValidateRequestMethodAndPath *bool `json:"validateRequestMethodAndPath,omitempty"`
}

type Override struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_access.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_bundle.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_catalog_item.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_plan.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_portal.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_rate_limit.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/api_version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/crd/embed.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/hub/v1alpha1/crd/hub.traefik.io_apis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ spec:
x-kubernetes-validations:
- message: must be a valid URL
rule: isURL(self)
validateRequestMethodAndPath:
description: |-
ValidateRequestMethodAndPath validates that the path and method matches an operation defined in the OpenAPI specification.
This option overrides the default behavior configured in the static configuration.
type: boolean
type: object
x-kubernetes-validations:
- message: path or url must be defined
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/hub/v1alpha1/crd/hub.traefik.io_apiversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ spec:
x-kubernetes-validations:
- message: must be a valid URL
rule: isURL(self)
validateRequestMethodAndPath:
description: |-
ValidateRequestMethodAndPath validates that the path and method matches an operation defined in the OpenAPI specification.
This option overrides the default behavior configured in the static configuration.
type: boolean
type: object
x-kubernetes-validations:
- message: path or url must be defined
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/managed_subscription.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/hub/v1alpha1/types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2022-2024 Traefik Labs
Copyright (C) 2022-2025 Traefik Labs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
7 changes: 6 additions & 1 deletion pkg/apis/hub/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/fake/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/scheme/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/typed/hub/v1alpha1/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/client/clientset/versioned/typed/hub/v1alpha1/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aafd8b8

Please sign in to comment.