Skip to content

Commit 9a46f3f

Browse files
committed
Cleanup
1 parent 95f6417 commit 9a46f3f

5 files changed

Lines changed: 5 additions & 37 deletions

File tree

docs/PER_SHARE_EGRESS_MONITORING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ accessLogging:
124124
sourceRegion: "us-central1" # GCP region where server runs
125125
detectGcpTraffic: true # Enable GCP IP range lookup
126126
clientRegionHeader: "x-client-region" # Header with country code
127-
clientRegionSubdivisionHeader: "x-client-region-subdivision"
128127
clientIpHeader: "x-forwarded-for" # Header with client IP chain
129-
defaultPricingGroup: "unknown" # Fallback when location unknown
130128
```
131129
132130
### GCP Load Balancer Headers
@@ -184,8 +182,6 @@ X-Client-Region-Subdivision: {client_region_subdivision}
184182
**Client IP Headers:**
185183
1. Configured `clientIpHeader` (default: `x-forwarded-for`)
186184
2. `x-envoy-external-address`
187-
3. `x-real-ip`
188-
4. `true-client-ip`
189185

190186
---
191187

server/src/main/scala/io/delta/sharing/server/DeltaSharingService.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,9 @@ object DeltaSharingService {
888888
"x-appengine-country",
889889
"cf-ipcountry",
890890
"cloudfront-viewer-country")
891-
private val DefaultSubdivisionHeaders = Seq(
892-
"x-client-region-subdivision",
893-
"x-appengine-region")
894891
private val DefaultIpHeaders = Seq(
895892
"x-forwarded-for",
896-
"x-envoy-external-address",
897-
"x-real-ip",
898-
"true-client-ip")
893+
"x-envoy-external-address")
899894
private val DefaultPricingGroupsByRegion = Map(
900895
"US" -> "na_eu",
901896
"CA" -> "na_eu",

server/src/main/scala/io/delta/sharing/server/config/ServerConfig.scala

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,12 @@ case class AccessLoggingConfig(
139139
@BeanProperty var enabled: Boolean,
140140
// Header that contains the client region code (for example: US, DE).
141141
@BeanProperty var clientRegionHeader: String,
142-
// Header that contains the client region subdivision (for example: USCA, DEBE).
143-
@BeanProperty var clientRegionSubdivisionHeader: String,
144142
// Header that contains client IP or forwarding chain (for example: X-Forwarded-For).
145143
@BeanProperty var clientIpHeader: String,
146-
// Optional mapping from region/subdivision codes to pricing group labels.
147-
// Keys should be uppercase location codes (for example: US, DE, USCA).
144+
// Optional mapping from region codes to pricing group labels.
145+
// Keys should be uppercase location codes (for example: US, DE).
148146
// A wildcard key "*" can be used as a catch-all default.
149147
@BeanProperty var pricingGroups: java.util.Map[String, String],
150-
// Fallback group when no mapping and no region are available.
151-
@BeanProperty var defaultPricingGroup: String,
152148
// The GCP region where this server runs (for example: us-central1).
153149
// Used for pricing tier calculation based on source→destination pairs.
154150
@BeanProperty var sourceRegion: String,
@@ -161,19 +157,14 @@ case class AccessLoggingConfig(
161157
this(
162158
enabled = false,
163159
clientRegionHeader = "x-client-region",
164-
clientRegionSubdivisionHeader = "x-client-region-subdivision",
165160
clientIpHeader = "x-forwarded-for",
166161
pricingGroups = Collections.emptyMap(),
167-
defaultPricingGroup = "unknown",
168162
sourceRegion = "",
169163
detectGcpTraffic = true)
170164
}
171165

172166
override def checkConfig(): Unit = {
173-
if (defaultPricingGroup == null || defaultPricingGroup.trim.isEmpty) {
174-
throw new IllegalArgumentException(
175-
"'defaultPricingGroup' in 'accessLogging' must be provided")
176-
}
167+
// No required fields to validate
177168
}
178169
}
179170

server/src/test/scala/io/delta/sharing/server/config/ServerConfigSuite.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ class ServerConfigSuite extends FunSuite {
125125
val accessLogging = new AccessLoggingConfig()
126126
accessLogging.setEnabled(true)
127127
accessLogging.setClientRegionHeader("x-client-region")
128-
accessLogging.setClientRegionSubdivisionHeader("x-client-region-subdivision")
129128
accessLogging.setClientIpHeader("x-forwarded-for")
130129
accessLogging.setPricingGroups(Collections.singletonMap("US", "na-tier-1"))
131-
accessLogging.setDefaultPricingGroup("unknown")
132130
serverConfig.setAccessLogging(accessLogging)
133131
testConfig(
134132
"""version: 1
@@ -142,11 +140,9 @@ class ServerConfigSuite extends FunSuite {
142140
|accessLogging:
143141
| enabled: true
144142
| clientRegionHeader: x-client-region
145-
| clientRegionSubdivisionHeader: x-client-region-subdivision
146143
| clientIpHeader: x-forwarded-for
147144
| pricingGroups:
148145
| US: na-tier-1
149-
| defaultPricingGroup: unknown
150146
|""".stripMargin,
151147
serverConfig)
152148
}
@@ -209,11 +205,6 @@ class ServerConfigSuite extends FunSuite {
209205
val accessLogging = new AccessLoggingConfig()
210206
accessLogging.setEnabled(true)
211207
accessLogging.checkConfig()
212-
213-
accessLogging.setDefaultPricingGroup(" ")
214-
assertInvalidConfig("'defaultPricingGroup' in 'accessLogging' must be provided") {
215-
accessLogging.checkConfig()
216-
}
217208
}
218209

219210
test("SSLConfig") {

server/src/universal/conf/delta-sharing-server.yaml.template

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,13 @@ accessLogging:
7474
# In GCP, configure your load balancer backend custom request headers to inject this.
7575
# Example: X-Client-Region:{client_region}
7676
clientRegionHeader: "x-client-region"
77-
# Name of the incoming header that carries client subdivision (for example: USCA).
78-
# Example: X-Client-Region-Subdivision:{client_region_subdivision}
79-
clientRegionSubdivisionHeader: "x-client-region-subdivision"
8077
# Name of the incoming header that carries client IP information.
8178
# This is typically a forwarding chain header and does not require LB changes when already present.
8279
clientIpHeader: "x-forwarded-for"
83-
# Optional mapping from region/subdivision codes to billing price groups.
80+
# Optional mapping from region codes to billing price groups.
8481
# Use uppercase keys. A wildcard key "*" can be used as a catch-all.
8582
# If empty, server applies a built-in default map (na_eu/apac/latam buckets).
8683
pricingGroups: {}
87-
# Fallback pricing group when no location can be resolved.
88-
defaultPricingGroup: "unknown"
8984
# GCP region where this server runs (for example: us-central1).
9085
# Required for GCP pricing tier calculation.
9186
# Used to determine source→destination pairs for egress cost attribution.

0 commit comments

Comments
 (0)