@@ -54,8 +54,6 @@ use crate::types::{
5454pub const REST_CATALOG_PROP_URI : & str = "uri" ;
5555/// REST catalog warehouse location
5656pub const REST_CATALOG_PROP_WAREHOUSE : & str = "warehouse" ;
57- /// Disable header redaction in error logs (defaults to false for security)
58- pub const REST_CATALOG_PROP_DISABLE_HEADER_REDACTION : & str = "disable-header-redaction" ;
5957
6058const ICEBERG_REST_SPEC_VERSION : & str = "0.14.1" ;
6159const CARGO_PKG_VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
@@ -332,17 +330,6 @@ impl RestCatalogConfig {
332330 params
333331 }
334332
335- /// Check if header redaction is disabled in error logs.
336- ///
337- /// Returns true if the `disable-header-redaction` property is set to "true".
338- /// Defaults to false for security (headers are redacted by default).
339- pub ( crate ) fn disable_header_redaction ( & self ) -> bool {
340- self . props
341- . get ( REST_CATALOG_PROP_DISABLE_HEADER_REDACTION )
342- . map ( |v| v. eq_ignore_ascii_case ( "true" ) )
343- . unwrap_or ( false )
344- }
345-
346333 /// Merge the `RestCatalogConfig` with the a [`CatalogConfig`] (fetched from the REST server).
347334 pub ( crate ) fn merge_with_config ( mut self , mut config : CatalogConfig ) -> Self {
348335 if let Some ( uri) = config. overrides . remove ( "uri" ) {
@@ -443,11 +430,7 @@ impl RestCatalog {
443430
444431 match http_response. status ( ) {
445432 StatusCode :: OK => deserialize_catalog_response ( http_response) . await ,
446- _ => Err ( deserialize_unexpected_catalog_error (
447- http_response,
448- client. disable_header_redaction ( ) ,
449- )
450- . await ) ,
433+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
451434 }
452435 }
453436
@@ -551,13 +534,7 @@ impl RestCatalog {
551534 "Tried to load a table that does not exist" ,
552535 ) ) ;
553536 }
554- _ => {
555- return Err ( deserialize_unexpected_catalog_error (
556- http_response,
557- context. client . disable_header_redaction ( ) ,
558- )
559- . await ) ;
560- }
537+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
561538 } ;
562539
563540 // Build config with proper precedence, with each next config overriding previous one:
@@ -657,11 +634,7 @@ impl RestCatalog {
657634 ErrorKind :: Unexpected ,
658635 "Tried to load credentials for a table that does not exist" ,
659636 ) ) ,
660- _ => Err ( deserialize_unexpected_catalog_error (
661- http_response,
662- context. client . disable_header_redaction ( ) ,
663- )
664- . await ) ,
637+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
665638 }
666639 }
667640
@@ -721,13 +694,7 @@ impl Catalog for RestCatalog {
721694 "The parent parameter of the namespace provided does not exist" ,
722695 ) ) ;
723696 }
724- _ => {
725- return Err ( deserialize_unexpected_catalog_error (
726- http_response,
727- context. client . disable_header_redaction ( ) ,
728- )
729- . await ) ;
730- }
697+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
731698 }
732699 }
733700
@@ -762,11 +729,7 @@ impl Catalog for RestCatalog {
762729 ErrorKind :: Unexpected ,
763730 "Tried to create a namespace that already exists" ,
764731 ) ) ,
765- _ => Err ( deserialize_unexpected_catalog_error (
766- http_response,
767- context. client . disable_header_redaction ( ) ,
768- )
769- . await ) ,
732+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
770733 }
771734 }
772735
@@ -790,11 +753,7 @@ impl Catalog for RestCatalog {
790753 ErrorKind :: Unexpected ,
791754 "Tried to get a namespace that does not exist" ,
792755 ) ) ,
793- _ => Err ( deserialize_unexpected_catalog_error (
794- http_response,
795- context. client . disable_header_redaction ( ) ,
796- )
797- . await ) ,
756+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
798757 }
799758 }
800759
@@ -811,11 +770,7 @@ impl Catalog for RestCatalog {
811770 match http_response. status ( ) {
812771 StatusCode :: NO_CONTENT | StatusCode :: OK => Ok ( true ) ,
813772 StatusCode :: NOT_FOUND => Ok ( false ) ,
814- _ => Err ( deserialize_unexpected_catalog_error (
815- http_response,
816- context. client . disable_header_redaction ( ) ,
817- )
818- . await ) ,
773+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
819774 }
820775 }
821776
@@ -846,11 +801,7 @@ impl Catalog for RestCatalog {
846801 ErrorKind :: Unexpected ,
847802 "Tried to drop a namespace that does not exist" ,
848803 ) ) ,
849- _ => Err ( deserialize_unexpected_catalog_error (
850- http_response,
851- context. client . disable_header_redaction ( ) ,
852- )
853- . await ) ,
804+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
854805 }
855806 }
856807
@@ -887,13 +838,7 @@ impl Catalog for RestCatalog {
887838 "Tried to list tables of a namespace that does not exist" ,
888839 ) ) ;
889840 }
890- _ => {
891- return Err ( deserialize_unexpected_catalog_error (
892- http_response,
893- context. client . disable_header_redaction ( ) ,
894- )
895- . await ) ;
896- }
841+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
897842 }
898843 }
899844
@@ -947,13 +892,7 @@ impl Catalog for RestCatalog {
947892 "The table already exists" ,
948893 ) ) ;
949894 }
950- _ => {
951- return Err ( deserialize_unexpected_catalog_error (
952- http_response,
953- context. client . disable_header_redaction ( ) ,
954- )
955- . await ) ;
956- }
895+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
957896 } ;
958897
959898 let metadata_location = response. metadata_location . as_ref ( ) . ok_or ( Error :: new (
@@ -1010,11 +949,7 @@ impl Catalog for RestCatalog {
1010949 ErrorKind :: Unexpected ,
1011950 "Tried to drop a table that does not exist" ,
1012951 ) ) ,
1013- _ => Err ( deserialize_unexpected_catalog_error (
1014- http_response,
1015- context. client . disable_header_redaction ( ) ,
1016- )
1017- . await ) ,
952+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
1018953 }
1019954 }
1020955
@@ -1032,11 +967,7 @@ impl Catalog for RestCatalog {
1032967 match http_response. status ( ) {
1033968 StatusCode :: NO_CONTENT | StatusCode :: OK => Ok ( true ) ,
1034969 StatusCode :: NOT_FOUND => Ok ( false ) ,
1035- _ => Err ( deserialize_unexpected_catalog_error (
1036- http_response,
1037- context. client . disable_header_redaction ( ) ,
1038- )
1039- . await ) ,
970+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
1040971 }
1041972 }
1042973
@@ -1065,11 +996,7 @@ impl Catalog for RestCatalog {
1065996 ErrorKind :: Unexpected ,
1066997 "Tried to rename a table to a name that already exists" ,
1067998 ) ) ,
1068- _ => Err ( deserialize_unexpected_catalog_error (
1069- http_response,
1070- context. client . disable_header_redaction ( ) ,
1071- )
1072- . await ) ,
999+ _ => Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
10731000 }
10741001 }
10751002
@@ -1113,13 +1040,7 @@ impl Catalog for RestCatalog {
11131040 "The given table already exists." ,
11141041 ) ) ;
11151042 }
1116- _ => {
1117- return Err ( deserialize_unexpected_catalog_error (
1118- http_response,
1119- context. client . disable_header_redaction ( ) ,
1120- )
1121- . await ) ;
1122- }
1043+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
11231044 } ;
11241045
11251046 let metadata_location = response. metadata_location . as_ref ( ) . ok_or ( Error :: new (
@@ -1191,13 +1112,7 @@ impl Catalog for RestCatalog {
11911112 "A server-side gateway timeout occurred; the commit state is unknown." ,
11921113 ) ) ;
11931114 }
1194- _ => {
1195- return Err ( deserialize_unexpected_catalog_error (
1196- http_response,
1197- context. client . disable_header_redaction ( ) ,
1198- )
1199- . await ) ;
1200- }
1115+ _ => return Err ( deserialize_unexpected_catalog_error ( http_response) . await ) ,
12011116 } ;
12021117
12031118 // TODO: Support vended credentials here.
0 commit comments