Skip to content

Commit 76f0ea7

Browse files
authored
Updating to 4.0.0 and adding OAuthbearer attributes (#2799)
* Updating to 4.0.0 and adding OAuthbearer attributes * Updating release_notes.md * Updating release_notes.md
1 parent aba80d0 commit 76f0ea7

File tree

6 files changed

+115
-7
lines changed

6 files changed

+115
-7
lines changed

extensions/Worker.Extensions.Kafka/release_notes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- My change description (#PR/#issue)
55
-->
66

7-
### Microsoft.Azure.Functions.Worker.Extensions.Kafka 3.10.1
7+
### Microsoft.Azure.Functions.Worker.Extensions.Kafka 4.0.0
88

9-
- Add `DefaultValue` attribute to Kafka Trigger's `IsBatched` prop to signal default cardinality value to source generators (#2139)
9+
- Add OAuthBearer trigger and output Attributes to the dotnet isolated model(#2799)
10+
- Update kafka extension version to 4.0.0(#2799)

extensions/Worker.Extensions.Kafka/src/BrokerAuthenticationMode.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public enum BrokerAuthenticationMode
1313
Gssapi,
1414
Plain,
1515
ScramSha256,
16-
ScramSha512
16+
ScramSha512,
17+
OAuthBearer
1718
}
1819
}

extensions/Worker.Extensions.Kafka/src/KafkaOutputAttribute.cs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public KafkaOutputAttribute(string brokerList, string topic)
6767

6868
/// <summary>
6969
/// SASL mechanism to use for authentication.
70-
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512
70+
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512, OAuthBearer
7171
/// Default: Plain
7272
///
7373
/// sasl.mechanism in librdkafka
@@ -143,5 +143,49 @@ public KafkaOutputAttribute(string brokerList, string topic)
143143
/// Password for the Avro Schema Registry
144144
/// </summary>
145145
public string SchemaRegistryPassword { get; set; }
146+
147+
/// <summary>
148+
/// OAuth Bearer method.
149+
/// Either 'default' or 'oidc'
150+
/// sasl.oauthbearer in librdkafka
151+
/// </summary>
152+
public OAuthBearerMethod OAuthBearerMethod { get; set; }
153+
154+
/// <summary>
155+
/// OAuth Bearer Client Id
156+
/// Specify only when OAuthBearerMethod is 'oidc'
157+
/// sasl.oauthbearer.client.id in librdkafka
158+
/// </summary>
159+
public string OAuthBearerClientId { get; set; }
160+
161+
/// <summary>
162+
/// OAuth Bearer Client Secret
163+
/// Specify only when OAuthBearerMethod is 'oidc'
164+
/// sasl.oauthbearer.client.secret in librdkafka
165+
/// </summary>
166+
public string OAuthBearerClientSecret { get; set; }
167+
168+
/// <summary>
169+
/// OAuth Bearer scope.
170+
/// Client use this to specify the scope of the access request to the broker.
171+
/// Specify only when OAuthBearerMethod is 'oidc'
172+
/// sasl.oauthbearer.extensions in librdkafka
173+
/// </summary>
174+
public string OAuthBearerScope { get; set; }
175+
176+
/// <summary>
177+
/// OAuth Bearer token endpoint url.
178+
/// Specify only when OAuthBearerMethod is 'oidc'
179+
/// sasl.oauthbearer.token.endpoint.url in librdkafka
180+
/// </summary>
181+
public string OAuthBearerTokenEndpointUrl { get; set; }
182+
183+
/// <summary>
184+
/// OAuth Bearer extensions.
185+
/// Allow additional information to be provided to the broker.
186+
/// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea"
187+
/// sasl.oauthbearer.extensions in librdkafka
188+
/// </summary>
189+
public string OAuthBearerExtensions { get; set; }
146190
}
147191
}

extensions/Worker.Extensions.Kafka/src/KafkaTriggerAttribute.cs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public KafkaTriggerAttribute(string brokerList, string topic)
4747

4848
/// <summary>
4949
/// SASL mechanism to use for authentication.
50-
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512
50+
/// Allowed values: Gssapi, Plain, ScramSha256, ScramSha512, OAuthBearer
5151
/// Default: Plain
5252
///
5353
/// sasl.mechanism in librdkafka
@@ -127,6 +127,50 @@ public KafkaTriggerAttribute(string brokerList, string topic)
127127
/// </summary>
128128
public string SchemaRegistryPassword { get; set; }
129129

130+
/// <summary>
131+
/// OAuth Bearer method.
132+
/// Either 'default' or 'oidc'
133+
/// sasl.oauthbearer in librdkafka
134+
/// </summary>
135+
public OAuthBearerMethod OAuthBearerMethod { get; set; }
136+
137+
/// <summary>
138+
/// OAuth Bearer Client Id
139+
/// Specify only when OAuthBearerMethod is 'oidc'
140+
/// sasl.oauthbearer.client.id in librdkafka
141+
/// </summary>
142+
public string OAuthBearerClientId { get; set; }
143+
144+
/// <summary>
145+
/// OAuth Bearer Client Secret
146+
/// Specify only when OAuthBearerMethod is 'oidc'
147+
/// sasl.oauthbearer.client.secret in librdkafka
148+
/// </summary>
149+
public string OAuthBearerClientSecret { get; set; }
150+
151+
/// <summary>
152+
/// OAuth Bearer scope.
153+
/// Client use this to specify the scope of the access request to the broker.
154+
/// Specify only when OAuthBearerMethod is 'oidc'
155+
/// sasl.oauthbearer.extensions in librdkafka
156+
/// </summary>
157+
public string OAuthBearerScope { get; set; }
158+
159+
/// <summary>
160+
/// OAuth Bearer token endpoint url.
161+
/// Specify only when OAuthBearerMethod is 'oidc'
162+
/// sasl.oauthbearer.token.endpoint.url in librdkafka
163+
/// </summary>
164+
public string OAuthBearerTokenEndpointUrl { get; set; }
165+
166+
/// <summary>
167+
/// OAuth Bearer extensions.
168+
/// Allow additional information to be provided to the broker.
169+
/// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea"
170+
/// sasl.oauthbearer.extensions in librdkafka
171+
/// </summary>
172+
public string OAuthBearerExtensions { get; set; }
173+
130174
/// <summary>
131175
/// Gets or sets the configuration to enable batch processing of events. Default value is "false".
132176
/// </summary>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Text;
7+
8+
namespace Microsoft.Azure.Functions.Worker
9+
{
10+
/// <summary>
11+
/// Defines the OAuth bearer method
12+
/// </summary>
13+
public enum OAuthBearerMethod
14+
{
15+
Default,
16+
Oidc
17+
}
18+
}

extensions/Worker.Extensions.Kafka/src/Worker.Extensions.Kafka.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Description>Kafka extensions for .NET isolated functions</Description>
77

88
<!--Version information-->
9-
<VersionPrefix>3.10.1</VersionPrefix>
9+
<VersionPrefix>4.0.0</VersionPrefix>
1010

1111
<!--Temporarily opting out of documentation. Pending documentation-->
1212
<GenerateDocumentationFile>false</GenerateDocumentationFile>
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<WebJobsExtension Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="3.9.0" />
24+
<WebJobsExtension Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="4.0.0" />
2525
</ItemGroup>
2626

2727
</Project>

0 commit comments

Comments
 (0)