eric-maynard commented on code in PR #1000: URL: https://github.com/apache/polaris/pull/1000#discussion_r1965978795
########## polaris-core/src/main/java/org/apache/polaris/core/context/CallContext.java: ########## @@ -0,0 +1,158 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.polaris.core.context; + +import jakarta.annotation.Nonnull; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; +import org.apache.iceberg.io.CloseableGroup; +import org.apache.polaris.core.PolarisCallContext; +import org.apache.polaris.core.PolarisDiagnostics; +import org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Stores elements associated with an individual REST request such as RealmContext, caller + * identity/role, authn/authz, etc. This class is distinct from RealmContext because implementations + * may need to first independently resolve a RealmContext before resolving the identity/role + * elements of the CallContext that reside exclusively within the resolved Realm. For example, the + * principal/role entities may be defined within a Realm-specific persistence layer, and the + * underlying nature of the persistence layer may differ between different realms. + */ +public interface CallContext extends AutoCloseable { + InheritableThreadLocal<CallContext> CURRENT_CONTEXT = new InheritableThreadLocal<>(); Review Comment: Yeah after doing this revert and debugging all the test issues with ThreadLocal I am very eager to see ThreadLocal gone and injection used consistently. -- 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]
