-
Notifications
You must be signed in to change notification settings - Fork 24
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
Remove curl dependency and disable OAuth Bearer SASL mechanism #155
Changes from all commits
8e7b78e
ff579ee
75f2bc8
6e9e57b
73ea988
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,7 +309,7 @@ extension KafkaConfiguration { | |
} | ||
} | ||
|
||
public struct OAuthBearerMethod: Sendable, Hashable { | ||
struct OAuthBearerMethod: Sendable, Hashable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't it be (formally) a breaking change if anyone uses that one for auth? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it would but we haven't released a major yet so removing APIs is still possible. I would love to get the package into a state where we don't require system dependencies at all. |
||
internal enum _OAuthBearerMethod: Sendable, Hashable { | ||
case `default`( | ||
configuration: String? | ||
|
@@ -337,7 +337,7 @@ extension KafkaConfiguration { | |
/// For example: `principalClaimName=azp principal=admin scopeClaimName=roles scope=role1,role2 lifeSeconds=600`. | ||
/// In addition, SASL extensions can be communicated to the broker via `extension_NAME=value`. | ||
/// For example: `principal=admin extension_traceId=123` | ||
public static func `default`(configuration: String? = nil) -> OAuthBearerMethod { | ||
static func `default`(configuration: String? = nil) -> OAuthBearerMethod { | ||
OAuthBearerMethod(_internal: .default(configuration: configuration)) | ||
} | ||
|
||
|
@@ -359,7 +359,7 @@ extension KafkaConfiguration { | |
/// - scope: The client uses this to specify the scope of the access request to the broker. | ||
/// - extensions: Allow additional information to be provided to the broker. | ||
/// Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea". | ||
public static func oidc( | ||
static func oidc( | ||
configuration: String? = nil, | ||
clientID: String, | ||
clientSecret: String, | ||
|
@@ -419,7 +419,8 @@ extension KafkaConfiguration { | |
} | ||
|
||
/// Use the OAUTHBEARER mechanism. | ||
public static func oAuthBearer(method: OAuthBearerMethod) -> SASLMechanism { | ||
// This is currently disabled since it requires a curl dependency otherwise. | ||
static func oAuthBearer(method: OAuthBearerMethod) -> SASLMechanism { | ||
SASLMechanism( | ||
_internal: .oAuthBearer(method: method) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this here as well then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't get rid of
sasl2
, as that would disable the more generic SASL authentication mechanisms, likeSASL/PLAIN
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay we should look into building libsassl with SwiftPM then to avoid the system dependency.