public void initialize()

in polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/service/impl/PolarisApiService.java [76:101]


    public void initialize(Map<String, String> properties) throws Exception {
        this.properties = properties;

        String baseUrl = properties.get("base-url");

        ApiClient client = new ApiClient();
        client.updateBaseUri(baseUrl + "/api/management/v1");

        this.authenticationSession = new AuthenticationSessionWrapper(properties);

        client.setRequestInterceptor(requestBuilder
                -> authenticationSession.getSessionHeaders().forEach(requestBuilder::header));

        this.baseUrl = baseUrl;
        this.api = new PolarisManagementDefaultApi(client);

        this.omnipotentPrincipal = new PrincipalWithCredentials()
                .principal(new Principal().name(properties.get("omnipotent-principal-name")))
                .credentials(new PrincipalWithCredentialsCredentials()
                        .clientId(properties.get("omnipotent-principal-client-id"))
                        .clientSecret(properties.get("omnipotent-principal-client-secret")));

        this.accessControlService = new AccessControlService(this);
        this.icebergWriteAccess = Boolean.parseBoolean(
                properties.getOrDefault(ICEBERG_WRITE_ACCESS_PROPERTY, Boolean.toString(false))); // by default false
    }