Skip to content

Commit

Permalink
Fix header and formating
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Jun 30, 2023
1 parent 22d46d1 commit 24e9fe8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 42 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

## I/Os

* Support for read from Cosmos DB [#23604](https://github.com/apache/beam/issues/23604)
* Support for X source added (Java/Python) ([#X](https://github.com/apache/beam/issues/X)).
* Support for Bigtable Change Streams added in Java `BigtableIO.ReadChangeStream` ([#27183](https://github.com/apache/beam/issues/27183))
* Support for read from Cosmos DB Core SQL API [#23604](https://github.com/apache/beam/issues/23604)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ public interface CosmosOptions extends AzureOptions {
void setCosmosClientBuilder(CosmosClientBuilder builder);

/** The Azure Cosmos service endpoint used by the Cosmos client. */
@Description(
"Sets the cosmos service endpoint, additionally parses it for information (SAS token)")
@Description("Sets the cosmos service endpoint")
@Nullable
String getCosmosServiceEndpoint();

void setCosmosServiceEndpoint(String endpoint);

/** The Azure Cosmos key used to perform authentication for accessing resource */
@Description(
"Sets the cosmos service endpoint, additionally parses it for information (SAS token)")
@Description("Sets the cosmos service endpoint")
@Nullable
String getCosmosKey();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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.beam.sdk.io.azure.options;

import com.azure.core.credential.TokenCredential;
Expand All @@ -9,38 +26,36 @@

public interface AzureOptions extends PipelineOptions {

/* Refer to {@link DefaultAWSCredentialsProviderChain} Javadoc for usage help. */

/**
* The credential instance that should be used to authenticate against Azure services. The option
* value must contain a "@type" field and an Azure credentials provider class as the field value.
*
* <p>For example, to specify the Azure client id, tenant id, and client secret, specify the
* following: <code>
* {"@type" : "ClientSecretCredential", "azureClientId": "client_id_value",
* "azureTenantId": "tenant_id_value", "azureClientSecret": "client_secret_value"}
* </code>
*/
@Description(
"The credential instance that should be used to authenticate "
+ "against Azure services. The option value must contain \"@type\" field "
+ "and an Azure credentials provider class name as the field value. "
+ " For example, to specify the Azure client id, tenant id, and client secret, specify the following: "
+ "{\"@type\" : \"ClientSecretCredential\", \"azureClientId\": \"client_id_value\", "
+ "\"azureTenantId\": \"tenant_id_value\", \"azureClientSecret\": \"client_secret_value\"}")
@Default.InstanceFactory(AzureUserCredentialsFactory.class)
TokenCredential getAzureCredentialsProvider();

void setAzureCredentialsProvider(TokenCredential value);

/** Attempts to load Azure credentials. */
class AzureUserCredentialsFactory implements DefaultValueFactory<TokenCredential> {

@Override
public TokenCredential create(PipelineOptions options) {
return new DefaultAzureCredentialBuilder().build();
}
/* Refer to {@link DefaultAWSCredentialsProviderChain} Javadoc for usage help. */

/**
* The credential instance that should be used to authenticate against Azure services. The option
* value must contain a "@type" field and an Azure credentials provider class as the field value.
*
* <p>For example, to specify the Azure client id, tenant id, and client secret, specify the
* following: <code>
* {"@type" : "ClientSecretCredential", "azureClientId": "client_id_value",
* "azureTenantId": "tenant_id_value", "azureClientSecret": "client_secret_value"}
* </code>
*/
@Description(
"The credential instance that should be used to authenticate "
+ "against Azure services. The option value must contain \"@type\" field "
+ "and an Azure credentials provider class name as the field value. "
+ " For example, to specify the Azure client id, tenant id, and client secret, specify the following: "
+ "{\"@type\" : \"ClientSecretCredential\", \"azureClientId\": \"client_id_value\", "
+ "\"azureTenantId\": \"tenant_id_value\", \"azureClientSecret\": \"client_secret_value\"}")
@Default.InstanceFactory(AzureUserCredentialsFactory.class)
TokenCredential getAzureCredentialsProvider();

void setAzureCredentialsProvider(TokenCredential value);

/** Attempts to load Azure credentials. */
class AzureUserCredentialsFactory implements DefaultValueFactory<TokenCredential> {

@Override
public TokenCredential create(PipelineOptions options) {
return new DefaultAzureCredentialBuilder().build();
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@
*/
package org.apache.beam.sdk.io.azure.options;

import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.storage.blob.models.CustomerProvidedKey;
import org.apache.beam.sdk.io.azure.blobstore.DefaultBlobstoreClientBuilderFactory;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.DefaultValueFactory;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.PipelineOptions;
import org.checkerframework.checker.nullness.qual.Nullable;

// TODO: Tag each option with @Default or @Nullable
Expand Down

0 comments on commit 24e9fe8

Please sign in to comment.