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

APIGW: Update HTTPRouteConfigEntry for JWT Auth #18422

Merged
merged 6 commits into from
Aug 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update JWTFilter to be in oss file
jm96441n committed Aug 10, 2023
commit ddf25d217be64d4d4292681add6c015409f0b911
4 changes: 2 additions & 2 deletions agent/structs/config_entry_apigw_jwt_oss.go
Original file line number Diff line number Diff line change
@@ -9,5 +9,5 @@ package structs
// APIGatewayJWTRequirement holds the list of JWT providers to be verified against
type APIGatewayJWTRequirement struct{}

// APIGatewayJWTProvider defines the provider to verify a JWT against
type APIGatewayJWTProvider struct{}
// JWTFilter holds the JWT Filter configuration for an HTTPRoute
type JWTFilter struct{}
5 changes: 0 additions & 5 deletions agent/structs/config_entry_routes.go
Original file line number Diff line number Diff line change
@@ -448,11 +448,6 @@ type TimeoutFilter struct {
IdleTimeout time.Duration
}

// JWTFilter holds the JWT Filter configuration for an HTTPRoute
type JWTFilter struct {
Providers []*APIGatewayJWTProvider `json:",omitempty"`
}

// HTTPRouteRule specifies the routing rules used to determine what upstream
// service an HTTP request is routed to.
type HTTPRouteRule struct {
24 changes: 2 additions & 22 deletions proto/private/pbconfigentry/config_entry.gen.go

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

9 changes: 2 additions & 7 deletions proto/private/pbconfigentry/config_entry.pb.go

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

7 changes: 1 addition & 6 deletions proto/private/pbconfigentry/config_entry.proto
Original file line number Diff line number Diff line change
@@ -912,6 +912,7 @@ message HTTPFilters {
URLRewrite URLRewrite = 2;
RetryFilter RetryFilter = 3;
TimeoutFilter TimeoutFilter = 4;
// mog: func-to=routeJWTFilterToStructs func-from=routeJWTFilterFromStructs
JWTFilter JWT = 5;
}

@@ -948,13 +949,7 @@ message TimeoutFilter {
google.protobuf.Duration IdleTimeout = 2;
}

// mog annotation:
//
// target=github.com/hashicorp/consul/agent/structs.JWTFilter
// output=config_entry.gen.go
// name=Structs
message JWTFilter {
// mog: func-to=gwJWTProviderToStructs func-from=gwJWTProviderFromStructs
repeated APIGatewayJWTProvider Providers = 1;
}

8 changes: 4 additions & 4 deletions proto/private/pbconfigentry/config_entry_oss.go
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ func gwJWTRequirementFromStructs(*structs.APIGatewayJWTRequirement) *APIGatewayJ
return &APIGatewayJWTRequirement{}
}

func gwJWTProviderToStructs(m []*APIGatewayJWTProvider) []*structs.APIGatewayJWTProvider {
return []*structs.APIGatewayJWTProvider{}
func routeJWTFilterToStructs(m *JWTFilter) *structs.JWTFilter {
return &structs.JWTFilter{}
}

func gwJWTProviderFromStructs([]*structs.APIGatewayJWTProvider) []*APIGatewayJWTProvider {
return []*APIGatewayJWTProvider{}
func routeJWTFilterFromStructs(*structs.JWTFilter) *JWTFilter {
return &JWTFilter{}
}