Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to 4.0.0 and adding OAuthbearer attributes #2799

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions extensions/Worker.Extensions.Kafka/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- My change description (#PR/#issue)
-->

### Microsoft.Azure.Functions.Worker.Extensions.Kafka 3.10.1
### Microsoft.Azure.Functions.Worker.Extensions.Kafka 4.0.0

- Add `DefaultValue` attribute to Kafka Trigger's `IsBatched` prop to signal default cardinality value to source generators (#2139)
- Add OAuthBearer trigger and output Attributes to the dotnet isolated model(#2799)
- Update kafka extension version to 4.0.0(#2799)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum BrokerAuthenticationMode
Gssapi,
Plain,
ScramSha256,
ScramSha512
ScramSha512,
OAuthBearer
}
}
46 changes: 45 additions & 1 deletion extensions/Worker.Extensions.Kafka/src/KafkaOutputAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public KafkaOutputAttribute(string brokerList, string topic)

/// <summary>
/// SASL mechanism to use for authentication.
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512, OAuthBearer
/// Default: Plain
///
/// sasl.mechanism in librdkafka
Expand Down Expand Up @@ -143,5 +143,49 @@ public KafkaOutputAttribute(string brokerList, string topic)
/// Password for the Avro Schema Registry
/// </summary>
public string SchemaRegistryPassword { get; set; }

/// <summary>
/// OAuth Bearer method.
/// Either 'default' or 'oidc'
/// sasl.oauthbearer in librdkafka
/// </summary>
public OAuthBearerMethod OAuthBearerMethod { get; set; }

/// <summary>
/// OAuth Bearer Client Id
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.client.id in librdkafka
/// </summary>
public string OAuthBearerClientId { get; set; }

/// <summary>
/// OAuth Bearer Client Secret
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.client.secret in librdkafka
/// </summary>
public string OAuthBearerClientSecret { get; set; }

/// <summary>
/// OAuth Bearer scope.
/// Client use this to specify the scope of the access request to the broker.
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.extensions in librdkafka
/// </summary>
public string OAuthBearerScope { get; set; }

/// <summary>
/// OAuth Bearer token endpoint url.
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.token.endpoint.url in librdkafka
/// </summary>
public string OAuthBearerTokenEndpointUrl { get; set; }

/// <summary>
/// OAuth Bearer extensions.
/// Allow additional information to be provided to the broker.
/// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea"
/// sasl.oauthbearer.extensions in librdkafka
/// </summary>
public string OAuthBearerExtensions { get; set; }
}
}
46 changes: 45 additions & 1 deletion extensions/Worker.Extensions.Kafka/src/KafkaTriggerAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public KafkaTriggerAttribute(string brokerList, string topic)

/// <summary>
/// SASL mechanism to use for authentication.
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512, OAuthBearer
/// Default: Plain
///
/// sasl.mechanism in librdkafka
Expand Down Expand Up @@ -127,6 +127,50 @@ public KafkaTriggerAttribute(string brokerList, string topic)
/// </summary>
public string SchemaRegistryPassword { get; set; }

/// <summary>
/// OAuth Bearer method.
/// Either 'default' or 'oidc'
/// sasl.oauthbearer in librdkafka
/// </summary>
public OAuthBearerMethod OAuthBearerMethod { get; set; }

/// <summary>
/// OAuth Bearer Client Id
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.client.id in librdkafka
/// </summary>
public string OAuthBearerClientId { get; set; }

/// <summary>
/// OAuth Bearer Client Secret
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.client.secret in librdkafka
/// </summary>
public string OAuthBearerClientSecret { get; set; }

/// <summary>
/// OAuth Bearer scope.
/// Client use this to specify the scope of the access request to the broker.
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.extensions in librdkafka
/// </summary>
public string OAuthBearerScope { get; set; }

/// <summary>
/// OAuth Bearer token endpoint url.
/// Specify only when OAuthBearerMethod is 'oidc'
/// sasl.oauthbearer.token.endpoint.url in librdkafka
/// </summary>
public string OAuthBearerTokenEndpointUrl { get; set; }

/// <summary>
/// OAuth Bearer extensions.
/// Allow additional information to be provided to the broker.
/// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea"
/// sasl.oauthbearer.extensions in librdkafka
/// </summary>
public string OAuthBearerExtensions { get; set; }

/// <summary>
/// Gets or sets the configuration to enable batch processing of events. Default value is "false".
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions extensions/Worker.Extensions.Kafka/src/OAuthBearerMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Azure.Functions.Worker
{
/// <summary>
/// Defines the OAuth bearer method
/// </summary>
public enum OAuthBearerMethod
{
Default,
Oidc
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description>Kafka extensions for .NET isolated functions</Description>

<!--Version information-->
<VersionPrefix>3.10.1</VersionPrefix>
<VersionPrefix>4.0.0</VersionPrefix>

<!--Temporarily opting out of documentation. Pending documentation-->
<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand All @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<WebJobsExtension Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="3.9.0" />
<WebJobsExtension Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="4.0.0" />
</ItemGroup>

</Project>
Loading