aicam commented on code in PR #6896: URL: https://github.com/apache/texera/pull/6896#discussion_r3991100222
########## access-control-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitMountResource.scala: ########## @@ -0,0 +1,221 @@ +/* + * 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.texera.service.resource + +import com.typesafe.scalalogging.LazyLogging +import io.dropwizard.auth.Auth +import jakarta.annotation.security.RolesAllowed +import jakarta.ws.rs._ +import jakarta.ws.rs.core.MediaType +import org.apache.texera.auth.JwtAuth.{jwtClaims, jwtToken} +import org.apache.texera.auth.SessionUser +import org.apache.texera.auth.util.ComputingUnitAccess +import org.apache.texera.common.config.{EnvironmentalVariable, KubernetesConfig} +import org.apache.texera.dao.SqlServer +import org.apache.texera.dao.SqlServer.withTransaction +import org.apache.texera.dao.jooq.generated.Tables.{DATASET_VERSION, MODEL_VERSION} +import org.apache.texera.dao.jooq.generated.enums.PrivilegeEnum +import org.apache.texera.dao.jooq.generated.tables.daos.{DatasetDao, ModelDao} +import org.apache.texera.service.resource.ComputingUnitMountResource._ +import org.apache.texera.service.util.{ + ComputingUnitNodeLocator, + MountRequestValidation, + MounterClient +} + +import scala.jdk.CollectionConverters._ + +/** + * The mount authority: this service decides whether a user may act on a computing unit, so + * it is where a mount request is authorized before being forwarded to that unit's node. + * + * Read access to the data is not decided here. file-service's S3 proxy authorizes every + * read, so a mount of a repository the user cannot read reads nothing. + * + * Not routed at the gateway — these endpoints are reached in-cluster, by the engine. Review Comment: My bad, the comment was wrong, the function was checking both WRITE access to CU and READ access to LakeFS repo (using requireRepositoryReadAccess). Removed that part of the comment. -- 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]
