-
Notifications
You must be signed in to change notification settings - Fork 215
feat: Add OAuth 2.0 support to mongodbatlas_metric_integration resource #4737
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 17 commits
491431d
2765560
6b66d39
790eb7b
a696aa8
193142a
1127531
cc6f5af
f5ff620
85ab0e4
85b96a4
d70e289
63eab95
3638661
c1c7b03
328cf3d
3dd8b4b
677b705
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_metric_integration: Adds OAuth 2.0 support via a new `oauth` block (client-secret or private-key JWT authentication) | ||
| ``` | ||
|
|
||
| ```release-note:enhancement | ||
| data-source/mongodbatlas_metric_integration: Adds OAuth 2.0 support via a new `oauth` block (client-secret or private-key JWT authentication) | ||
| ``` | ||
|
|
||
| ```release-note:enhancement | ||
| data-source/mongodbatlas_metric_integrations: Adds OAuth 2.0 support via a new `oauth` block (client-secret or private-key JWT authentication) | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,7 @@ output "metric_integration_ids" { | |
| - `headers_redacted` (Attributes List) HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext. (see [below for nested schema](#nestedatt--headers_redacted)) | ||
| - `integration_type` (String) Type of metric integration. Identifies which protocol will be used for the integration. | ||
| - `metric_selection` (Set of String) Array of metric categories to export. Determines which types of metrics are sent to the integration. | ||
| - `oauth` (Attributes) OAuth 2.0 configuration returned for a metric integration. Secrets are never returned. (see [below for nested schema](#nestedatt--oauth)) | ||
| - `provider_type` (String) The provider type for the metric integration. Identifies the third-party service provider. | ||
|
|
||
| <a id="nestedatt--headers_redacted"></a> | ||
|
|
@@ -82,4 +83,27 @@ Read-Only: | |
| - `name` (String) Header name. | ||
| - `value` (String) Redacted header value. | ||
|
|
||
|
|
||
| <a id="nestedatt--oauth"></a> | ||
| ### Nested Schema for `oauth` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `client_auth_method` (String) How the client authenticates to the token endpoint. | ||
| - `client_id` (String) OAuth 2.0 client identifier registered with the token endpoint. | ||
| - `scopes` (Set of String) OAuth 2.0 scopes requested on the token. | ||
| - `signing_key_info` (Attributes) Read-only metadata for the Atlas-managed signing key used by `PRIVATE_KEY_JWT`. Present only for that method. Register the jwks_uri with your identity provider. Atlas rotates the underlying key without changing this URL. (see [below for nested schema](#nestedatt--oauth--signing_key_info)) | ||
|
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. should this be Attributes list? same comment re: learn more. |
||
| - `token_endpoint` (String) OAuth 2.0 token endpoint URL. | ||
| - `token_request_params` (Map of String) Provider-specific parameters added to the token request. | ||
|
|
||
| <a id="nestedatt--oauth--signing_key_info"></a> | ||
| ### Nested Schema for `oauth.signing_key_info` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `algorithm` (String) Signing algorithm of the Atlas-managed key. | ||
| - `created_at` (String) When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. | ||
|
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. The timestamp for when Atlas created the .... |
||
| - `jwks_uri` (String) Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration. | ||
|
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. what does "Fixed for the lifetime of the integration." mean? might be worth rewording this. |
||
| - `kid` (String) Key ID stamped on client assertions, the `SHA-1` thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key. | ||
|
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. shouldn't ID in kid be capitalized? kID? Ignore if this is not possible or if this is already an established convention. Also: Key ID stamped on client assertions, the |
||
|
|
||
| For more information see: [MongoDB Atlas - OTel Integration](https://www.mongodb.com/docs/atlas/tutorial/otel-integration/) Documentation. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,7 @@ Read-Only: | |
| - `integration_type` (String) Type of metric integration. Identifies which protocol will be used for the integration. | ||
| - `metric_integration_id` (String) Unique identifier of the metric integration configuration. | ||
| - `metric_selection` (Set of String) Array of metric categories to export. Determines which types of metrics are sent to the integration. | ||
| - `oauth` (Attributes) OAuth 2.0 configuration returned for a metric integration. Secrets are never returned. (see [below for nested schema](#nestedatt--results--oauth)) | ||
|
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. same comment for To learn more, see |
||
| - `provider_type` (String) The provider type for the metric integration. Identifies the third-party service provider. | ||
|
|
||
| <a id="nestedatt--results--headers_redacted"></a> | ||
|
|
@@ -96,4 +97,27 @@ Read-Only: | |
| - `name` (String) Header name. | ||
| - `value` (String) Redacted header value. | ||
|
|
||
|
|
||
| <a id="nestedatt--results--oauth"></a> | ||
| ### Nested Schema for `results.oauth` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `client_auth_method` (String) How the client authenticates to the token endpoint. | ||
| - `client_id` (String) OAuth 2.0 client identifier registered with the token endpoint. | ||
| - `scopes` (Set of String) OAuth 2.0 scopes requested on the token. | ||
| - `signing_key_info` (Attributes) Read-only metadata for the Atlas-managed signing key used by `PRIVATE_KEY_JWT`. Present only for that method. Register the jwks_uri with your identity provider. Atlas rotates the underlying key without changing this URL. (see [below for nested schema](#nestedatt--results--oauth--signing_key_info)) | ||
|
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. same comments as above |
||
| - `token_endpoint` (String) OAuth 2.0 token endpoint URL. | ||
| - `token_request_params` (Map of String) Provider-specific parameters added to the token request. | ||
|
|
||
| <a id="nestedatt--results--oauth--signing_key_info"></a> | ||
| ### Nested Schema for `results.oauth.signing_key_info` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `algorithm` (String) Signing algorithm of the Atlas-managed key. | ||
| - `created_at` (String) When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. | ||
| - `jwks_uri` (String) Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration. | ||
| - `kid` (String) Key ID stamped on client assertions, the `SHA-1` thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key. | ||
|
|
||
| For more information see: [MongoDB Atlas - OTel Integration](https://www.mongodb.com/docs/atlas/tutorial/otel-integration/) Documentation. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,13 +64,17 @@ output "metric_integration_ids" { | |
| ### Required | ||
|
|
||
| - `aggregation_temporality` (String) The temporality to send to the metric integration. | ||
| - `auth_type` (String) Authentication method the integration uses when exporting metrics to the endpoint. `HEADER` authenticates with the static HTTP headers provided in the `headers` field, which must be set when this value is used. | ||
| - `auth_type` (String) Authentication method the integration uses when exporting metrics to the endpoint. `HEADER` authenticates with the static HTTP headers provided in the `headers` field, which must be set when this value is used. `OAUTH2` acquires a bearer token from an OAuth 2.0 token endpoint using the `oauth` field. | ||
|
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. this is a run in sentence: Re last sentence about OATH2, -- does this mean that we have some other oath, and that behaves differently but we only mention the new one but don't qualify the existing one? This will look like it is missing context to the reader who may need to compare. Please consider adding parallel structures: |
||
| - `endpoint` (String) OpenTelemetry collector endpoint URL. Must use HTTPS. | ||
| - `integration_type` (String) Type of metric integration. Identifies which protocol will be used for the integration. This value cannot be modified after the integration is created. | ||
| - `metric_selection` (Set of String) Array of metric categories to export. Determines which types of metrics are sent to the integration. | ||
| - `project_id` (String) Unique 24-hexadecimal digit string that identifies your project, also known as `groupId` in the official documentation. | ||
| - `provider_type` (String) The provider type for the metric integration. Identifies the third-party service provider. | ||
|
|
||
| ### Optional | ||
|
Member
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. q: Any examples worth adjusting to cover OAuth?
Collaborator
Author
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, this will be addressed in CLOUDP-445734 |
||
|
|
||
| - `oauth` (Attributes) OAuth 2.0 client credentials configuration. Required when auth_type is `OAUTH2`. Secrets are never returned. (see [below for nested schema](#nestedatt--oauth)) | ||
|
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. Required -- active voice -- we are asking to specify them. |
||
|
|
||
| <!-- polymorphic attributes restructured by docpostprocess --> | ||
| The following attributes depend on the value of `auth_type`: | ||
|
|
||
|
|
@@ -93,6 +97,37 @@ Required: | |
| - `value` (String, Sensitive) Header value. | ||
|
|
||
|
|
||
| <a id="nestedatt--oauth"></a> | ||
| ### Nested Schema for `oauth` | ||
|
|
||
| Required: | ||
|
|
||
| - `client_auth_method` (String) How the client authenticates to the token endpoint. `CLIENT_SECRET` sends a shared secret. `PRIVATE_KEY_JWT` signs a client assertion with an Atlas-generated, Atlas-managed key. Register the returned JWKS URL with your identity provider. | ||
|
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. should registering happen first? I am not sure about the order here. |
||
| - `client_id` (String) OAuth 2.0 client identifier registered with the token endpoint. | ||
| - `token_endpoint` (String) OAuth 2.0 token endpoint URL. Must use HTTPS. | ||
|
|
||
| Optional: | ||
|
|
||
| - `client_secret` (String, Sensitive) Shared client secret. Required when client_auth_method is `CLIENT_SECRET`, and rejected for `PRIVATE_KEY_JWT`. Encrypted at rest and never returned. | ||
|
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. active voice re who encrypts and who never returns. not clear about the rejected part -- might need a few more details. |
||
| - `scopes` (Set of String) Optional OAuth 2.0 scopes requested on the token, sent as a space delimited `scope` parameter. Applies to both client authentication methods. | ||
|
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. which "both methods" are implied here? Are there any other params that apply to both? Existing params that haven't changed with this PR but that apply to both? |
||
| - `token_request_params` (Map of String) Optional provider-specific parameters added to the token request, for example a resource indicator. Applies to both client authentication methods. | ||
|
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. same here: name both auth methods to which this applies. |
||
|
|
||
| Read-Only: | ||
|
|
||
| - `signing_key_info` (Attributes) Read-only metadata for the Atlas-managed signing key used by `PRIVATE_KEY_JWT`. Present only for that method. Register the jwks_uri with your identity provider. Atlas rotates the underlying key without changing this URL. (see [below for nested schema](#nestedatt--oauth--signing_key_info)) | ||
|
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. same comments as above for similar content |
||
|
|
||
| <a id="nestedatt--oauth--signing_key_info"></a> | ||
| ### Nested Schema for `oauth.signing_key_info` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `algorithm` (String) Signing algorithm of the Atlas-managed key. | ||
| - `created_at` (String) When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. | ||
|
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. same comments as above for similar content. |
||
| - `jwks_uri` (String) Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration. | ||
| - `kid` (String) Key ID stamped on client assertions, the `SHA-1` thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key. | ||
|
|
||
|
|
||
|
|
||
| <a id="nestedatt--headers_redacted"></a> | ||
| ### Nested Schema for `headers_redacted` | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 this say: Attributes list, like line 72 does?
Replace "see below for" with "To learn more, see [nested schema] ((#nestedatt--oauth))