-
Notifications
You must be signed in to change notification settings - Fork 208
feat: Support OIDC configs in mongodbatlas_stream_connection #3766
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
Changes from 13 commits
8f86a64
f7a00e3
d799890
d88d16d
11e5ea6
c85d0f8
634fb64
639831c
fca069e
8a903a8
412dcf5
df2844f
255b808
4e0ff16
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ```release-note:enhancement | ||
| resource/mongodbatlas_stream_connection: Adds new authentication mechanism (OIDC) to the Kafka connection. | ||
| ``` | ||
|
|
||
| ```release-note:enhancement | ||
| data-source/mongodbatlas_stream_connection: Adds new authentication mechanism (OIDC) to the Kafka connection. | ||
| ``` | ||
|
|
||
| ```release-note:enhancement | ||
| data-source/mongodbatlas_stream_connections: Adds new authentication mechanism (OIDC) to the Kafka connection. | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,9 +47,15 @@ If `type` is of value `Https` the following additional attributes are defined: | |
|
|
||
| ### Authentication | ||
|
|
||
| * `mechanism` - Style of authentication. Can be one of `PLAIN`, `SCRAM-256`, or `SCRAM-512`. | ||
| * `mechanism` - Method of authentication. Value can be `PLAIN`, `SCRAM-256`, `SCRAM-512`, or `OAUTHBEARER`. | ||
| * `method` - SASL OAUTHBEARER authentication method. Value must be OIDC. | ||
|
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. if this value must be OIDC does the user really need to specify it here? or could it be implicit whenever mechanism = OAUTHBEARER 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. It's just for now. We may add more method value in the future. Should I say |
||
| * `username` - Username of the account to connect to the Kafka cluster. | ||
| * `password` - Password of the account to connect to the Kafka cluster. | ||
| * `token_endpoint_url` - OAUTH issuer (IdP provider) token endpoint HTTP(S) URI used to retrieve the token. | ||
|
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. can this be either an HTTP or HTTPS URI? or more than one HTTP URI? might be useful to clarify 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. Just one HTTP(S) URI. |
||
| * `client_id` - Public identifier for the Kafka client. | ||
| * `client_secret` - Secret known only to the Kafka client and the authorization server. | ||
| * `scope` - Scope of the access request to the broker specified by the Kafka clients. | ||
| * `sasl_oauthbearer_extensions` - Additional information to provide to the Kafka broker. | ||
|
|
||
| ### Security | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,38 @@ resource "mongodbatlas_stream_connection" "test" { | |
| } | ||
| ``` | ||
|
|
||
| ### Example Kafka SASL OAuthbearer Connection | ||
|
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. is there any Altas docs link we could add here? 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. can you show me an example of adding an atlas doc link to the docs? The atlas doc is WIP. But I think I can get the link for it. I followed the pattern in this file to add this example. But I'd like to add extra information if needed. 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.
you should be able to find it in the 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. @LijieZhang1998 please reach out to @jvincent-mongodb he can create a dochub link (our redirect layer) so you can add a link that we can redirect to a different location on our end when the docs are live |
||
|
|
||
| ```terraform | ||
| resource "mongodbatlas_stream_connection" "example-kafka-oauthbearer" { | ||
| project_id = var.project_id | ||
| instance_name = mongodbatlas_stream_instance.example.instance_name | ||
| connection_name = "KafkaOAuthbearerConnection" | ||
| type = "Kafka" | ||
| authentication = { | ||
| mechanism = "OAUTHBEARER" | ||
| method = "OIDC" | ||
| token_endpoint_url = "https://example.com/oauth/token" | ||
| client_id = "auth0Client" | ||
| client_secret = var.kafka_client_secret | ||
| scope = "read:messages write:messages" | ||
| sasl_oauthbearer_extensions = "logicalCluster=lkc-kmom,identityPoolId=pool-lAr" | ||
| } | ||
| bootstrap_servers = "localhost:9092,localhost:9092" | ||
| config = { | ||
| "auto.offset.reset" : "earliest" | ||
| } | ||
| security = { | ||
| protocol = "SASL_PLAINTEXT" | ||
| } | ||
| networking = { | ||
| access = { | ||
| type = "PUBLIC" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Example Kafka SASL SSL Connection | ||
|
|
||
| ```terraform | ||
|
|
@@ -145,9 +177,15 @@ If `type` is of value `Https` the following additional attributes are defined: | |
|
|
||
| ### Authentication | ||
|
|
||
| * `mechanism` - Style of authentication. Can be one of `PLAIN`, `SCRAM-256`, or `SCRAM-512`. | ||
| * `mechanism` - Method of authentication. Value can be `PLAIN`, `SCRAM-256`, or `SCRAM-512`. | ||
| * `method` - SASL OAUTHBEARER authentication method. Value must be OIDC. | ||
LijieZhang1998 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * `username` - Username of the account to connect to the Kafka cluster. | ||
| * `password` - Password of the account to connect to the Kafka cluster. | ||
| * `token_endpoint_url` - OAUTH issuer (IdP provider) token endpoint HTTP(S) URI used to retrieve the token. | ||
| * `client_id` - Public identifier for the Kafka client. | ||
| * `client_secret` - Secret known only to the Kafka client and the authorization server. | ||
| * `scope` - Scope of the access request to the broker specified by the Kafka clients. | ||
| * `sasl_oauthbearer_extensions` - Additional information to provide to the Kafka broker. | ||
|
|
||
| ### Security | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,34 @@ resource "mongodbatlas_stream_connection" "example-kafka-plaintext" { | |
| } | ||
| } | ||
|
|
||
| resource "mongodbatlas_stream_connection" "example-kafka-oauthbearer" { | ||
|
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. is there a README.md for this example? should we add more information there about this new resource? 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. We have this README.md file. Do you mean by adding some information to the file? I don't see we add any information about the example resources? |
||
| project_id = var.project_id | ||
| instance_name = mongodbatlas_stream_instance.example.instance_name | ||
| connection_name = "KafkaOAuthbearerConnection" | ||
| type = "Kafka" | ||
| authentication = { | ||
| mechanism = "OAUTHBEARER" | ||
| method = "OIDC" | ||
| token_endpoint_url = "https://example.com/oauth/token" | ||
| client_id = "auth0Client" | ||
| client_secret = var.kafka_client_secret | ||
| scope = "read:messages write:messages" | ||
| sasl_oauthbearer_extensions = "logicalCluster=lkc-kmom,identityPoolId=pool-lAr" | ||
| } | ||
| bootstrap_servers = "localhost:9092,localhost:9092" | ||
| config = { | ||
| "auto.offset.reset" : "earliest" | ||
| } | ||
| security = { | ||
| protocol = "SASL_PLAINTEXT" | ||
| } | ||
| networking = { | ||
| access = { | ||
| type = "PUBLIC" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource "mongodbatlas_stream_connection" "example-kafka-ssl" { | ||
| project_id = var.project_id | ||
| instance_name = mongodbatlas_stream_instance.example.instance_name | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.