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

Normalize path #405

Merged
merged 4 commits into from
Dec 22, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class AdminRouteProperties {
class StatusRouteProperties {
var enabled = false
var endpoints: MutableList<EndpointMatch> = mutableListOf()
var blockedStatusEndpoints: MutableList<EndpointMatch> = mutableListOf()
var createVirtualCluster = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class HttpConnectionManagerFactory(
.setUseRemoteAddress(BoolValue.newBuilder().setValue(listenersConfig.useRemoteAddress).build())
.setDelayedCloseTimeout(Duration.newBuilder().setSeconds(0).build())
.setCommonHttpProtocolOptions(httpProtocolOptions)
.setNormalizePath(BoolValue.newBuilder().setValue(true).build())
.setMergeSlashes(true)
.setCodecType(HttpConnectionManager.CodecType.AUTO)
.setHttpProtocolOptions(ingressHttp1ProtocolOptions(group.serviceName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,13 @@ class RBACFilterFactory(

private fun createStatusRoutePolicy(statusRouteProperties: StatusRouteProperties): Map<String, Policy.Builder> {
return if (statusRouteProperties.enabled) {
val notRules = statusRouteProperties.blockedStatusEndpoints.map {
rBACFilterPermissions.createPathPermission(
path = it.path,
matchingType = it.matchingType
).build()
}
val permissions = statusRouteProperties.endpoints
.map {
val permission = rBACFilterPermissions.createPathPermission(
rBACFilterPermissions.createPathPermission(
path = it.path,
matchingType = it.matchingType
)
notRules.forEach { permission.setNotRule(it) }
permission.build()
).build()
}

val policy = Policy.newBuilder()
.addPrincipals(anyPrincipal)
.addPermissions(anyOf(permissions))
Expand Down Expand Up @@ -377,18 +368,15 @@ class RBACFilterFactory(
principal
)
)

OAuth.Policy.STRICT -> mergePrincipals(
listOf(
strictPolicyPrincipal,
principal
)
)

OAuth.Policy.ALLOW_MISSING_OR_FAILED -> {
principal
}

null -> {
principal
}
Expand Down
Loading