mansehajsingh commented on code in PR #4: URL: https://github.com/apache/polaris-tools/pull/4#discussion_r2047987579
########## polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/service/impl/PolarisIcebergCatalogService.java: ########## @@ -0,0 +1,150 @@ +/* + * 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.tools.sync.polaris.service.impl; + +import org.apache.iceberg.CatalogUtil; +import org.apache.iceberg.Table; +import org.apache.iceberg.catalog.Namespace; +import org.apache.iceberg.catalog.TableIdentifier; +import org.apache.polaris.core.admin.model.PrincipalWithCredentials; +import org.apache.polaris.tools.sync.polaris.catalog.PolarisCatalog; +import org.apache.polaris.tools.sync.polaris.service.IcebergCatalogService; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PolarisIcebergCatalogService implements IcebergCatalogService { + + private final PolarisCatalog catalog; + + public PolarisIcebergCatalogService(String uri, String catalogName, PrincipalWithCredentials migratorPrincipal) { + Map<String, String> catalogProperties = new HashMap<>(); + catalogProperties.put("uri", uri); + catalogProperties.put("warehouse", catalogName); + + String clientId = migratorPrincipal.getCredentials().getClientId(); + String clientSecret = migratorPrincipal.getCredentials().getClientSecret(); Review Comment: I have added a new property `omnipotent-principal-oauth2-server-uri` that defaults to the `v1/oauth/tokens` endpoint, but now is configurable from the CLI. The current omnipotent principal workflow outputs client credentials at the moment, so I'm not sure an auth token is necessary right now. We should explore this with external OAuth. -- 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]
