RussellSpitzer commented on code in PR #18015:
URL: https://github.com/apache/iceberg/pull/18015#discussion_r3992976076
##########
core/src/main/java/org/apache/iceberg/rest/RESTUtil.java:
##########
@@ -436,4 +441,46 @@ public static Map<String, String>
configHeaders(Map<String, String> properties)
public static Map<String, String> idempotencyHeaders() {
return ImmutableMap.of(IDEMPOTENCY_KEY_HEADER,
UUIDUtil.generateUuidV7().toString());
}
+
+ /** Query parameters for the loadCredentials endpoint, from client-side
request context. */
+ public static Map<String, String> credentialsQueryParams(Map<String, String>
properties) {
+ ImmutableMap.Builder<String, String> queryParams = ImmutableMap.builder();
+ String planId = properties.get(RESTCatalogProperties.REST_SCAN_PLAN_ID);
+ if (planId != null) {
+ queryParams.put(RESTCatalogProperties.PLAN_ID_QUERY_PARAMETER, planId);
+ }
+
+ String referencedBy =
properties.get(RESTCatalogProperties.REST_REFERENCED_BY);
+ if (referencedBy != null) {
+ queryParams.put(RESTCatalogProperties.REFERENCED_BY_QUERY_PARAMETER,
referencedBy);
+ }
+
+ return queryParams.build();
+ }
+
+ /**
+ * Encodes a view chain (outermost first) as the {@code referenced-by} value.
+ *
+ * <p>Within an entry, the namespace levels and the view name are encoded
like the {@code parent}
+ * query parameter, as the spec requires, and joined by the namespace
separator as-is; entries are
+ * joined by a literal comma. The result is already percent-encoded and must
reach the wire
+ * verbatim, see {@link HTTPRequest#requestUri()}.
+ */
+ public static String encodeReferencedBy(
Review Comment:
Maybe package private for this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]