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

Fix JWT requirements for multi-environment #2860

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions adapter/internal/discovery/xds/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ func GenerateEnvoyResoucesForGateway(gatewayName string) ([]types.Resource,
}
}
}
if envoyInternalAPI.adapterInternalAPI.RemoveJWTRequirements {
for _, route := range envoyInternalAPI.routes {
delete(route.TypedPerFilterConfig, envoyconf.EnvoyJWT)
}
}
vhost, err := ExtractVhostFromAPIIdentifier(apiKey)
if err != nil {
logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1411, logging.MAJOR, "Error extracting vhost from API identifier: %v for Organization %v. Ignore deploying the API, error: %v", apiKey, organizationID, err))
Expand Down
1 change: 1 addition & 0 deletions adapter/internal/oasparser/config_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ func GetAPILevelJWTRequirements(adapterAPI *model.AdapterInternalAPI, selectedIs
},
}}
}
adapterAPI.RemoveJWTRequirements = true
return nil
}

Expand Down
1 change: 1 addition & 0 deletions adapter/internal/oasparser/model/adapter_internal_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type AdapterInternalAPI struct {
AIProvider InternalAIProvider
AIModelBasedRoundRobin InternalModelBasedRoundRobin
HTTPRouteIDs []string
RemoveJWTRequirements bool
}

// InternalModelBasedRoundRobin holds the model based round robin configurations
Expand Down
Loading