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

fix: Doesn't disable X.509 in the project when mongodbatlas_x509_authentication_database_user resource is deleted #1760

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

lantoli
Copy link
Member

@lantoli lantoli commented Dec 15, 2023

Description

Doesn't disable X.509 in the project when mongodbatlas_x509_authentication_database_user resource is deleted

Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-218316

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.

Further comments

@lantoli lantoli marked this pull request as ready for review December 15, 2023 16:29
@lantoli lantoli requested a review from a team as a code owner December 15, 2023 16:29
@github-actions github-actions bot added the bug label Dec 15, 2023
}
}

// We don't do anything because X.509 certificates can not be deleted or disassociated from a user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change? Do we want to hold it on after we release 1.14.0?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not a breaking change because it'd return error now...

Copy link
Member Author

@lantoli lantoli Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, on the contrary, the client wants this as soon as possible. The behavior will change, but for the better, because current behavior is unexpected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand we are limited in what we can for this scenario, but just want to make sure there are no significant side effects.
From what I understand if a user now deletes the mongodbatlas_x509_authentication_database_user the "Self-Managed X.509 Authentication" setting would still be enabled, and the users would have to disable manually if that is his intention.

Copy link
Member Author

@lantoli lantoli Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. but the normal use case is to have multiple users, so when you disable one you don't want to disable others.
As an example in Atlas UI when you delete the database user, X.509 project config keeps enabled. Here we're doing the same behavior as in the UI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is useful info in the comments in: https://jira.mongodb.org/browse/HELP-53363

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc updated

@@ -17,6 +17,8 @@ description: |-

-> **NOTE:** Groups and projects are synonymous terms. You may find group_id in the official documentation.

-> **NOTE:** Before provider version 1.14.0, Self-managed X.509 Authentication was disabled for the project when this resource was deleted.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels incomplete. Should we clarify that now we do nothing and why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, added more info

}
}

// We don't do anything because X.509 certificates can not be deleted or disassociated from a user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth it to mention https://jira.mongodb.org/browse/HELP-53363 in the comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, done

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 20 to 21
-> **NOTE:** Before provider version 1.14.0, Self-managed X.509 Authentication was disabled for the project when this resource was deleted. From that version on, it is not disabled because the other users may want to continue using X.509.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-> **NOTE:** Before provider version 1.14.0, Self-managed X.509 Authentication was disabled for the project when this resource was deleted. From that version on, it is not disabled because the other users may want to continue using X.509.
-> **NOTE:** Before provider version 1.14.0, Self-managed X.509 Authentication was disabled for the project when this resource was deleted. From that version on, it won't be disabled to let other users continue using X.509 within the same project.

@lantoli check if within the same project is correct please. If you are ok, accept the suggestion (just a minor word refactoring).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, changing for a similar sentence

Copy link
Contributor

Code Coverage

Package Line Rate Health
github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion 31%
github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema 100%
github.com/mongodb/terraform-provider-mongodbatlas/internal/common/validate 68%
github.com/mongodb/terraform-provider-mongodbatlas/internal/provider 7%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/accesslistapikey 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/alertconfiguration 33%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/apikey 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/atlasuser 0%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/auditing 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/backupcompliancepolicy 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupschedule 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupsnapshot 5%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupsnapshotexportbucket 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupsnapshotexportjob 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupsnapshotrestorejob 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudprovideraccess 4%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cluster 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/clusteroutagesimulation 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/customdbrole 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/customdnsconfigurationclusteraws 5%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/databaseuser 30%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/datalakepipeline 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/encryptionatrest 31%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/eventtrigger 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federateddatabaseinstance 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federatedquerylimit 4%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federatedsettingsidentityprovider 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federatedsettingsorgconfig 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federatedsettingsorgrolemapping 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/globalclusterconfig 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/ldapconfiguration 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/ldapverify 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/maintenancewindow 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/networkcontainer 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/networkpeering 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/onlinearchive 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/organization 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/orginvitation 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privateendpointregionalmode 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privatelinkendpoint 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privatelinkendpointserverless 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privatelinkendpointservice 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privatelinkendpointservicedatafederationonlinearchive 3%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/privatelinkendpointserviceserverless 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/project 30%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/projectapikey 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/projectinvitation 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/projectipaccesslist 10%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/rolesorgid 7%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/searchdeployment 23%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/searchindex 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/serverlessinstance 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/streamconnection 26%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/streaminstance 14%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/teams 1%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/thirdpartyintegration 4%
github.com/mongodb/terraform-provider-mongodbatlas/internal/service/x509authenticationdatabaseuser 2%
github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc 4%
Summary 7% (765 / 11018)

@lantoli lantoli merged commit 953fe05 into master Dec 18, 2023
30 checks passed
@lantoli lantoli deleted the CLOUDP-218316_x509 branch December 18, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants