-
Notifications
You must be signed in to change notification settings - Fork 301
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
Support for password policies #550
Conversation
@alexwilcox9 This looks good! I think we could probably make them top-level properties like |
e361f85
to
c3af797
Compare
@manicminer I just love blocks! That's fair enough I've rearranged it a bit now, also not sure what to call the two functions as they're not really expand/flatten functions so suggestions are welcome! |
I like blocks too, it's just that they introduce complexity when interacting with the TF plugin SDK :) To be honest I don't think we need flatten/expand functions in this case, we can do it inline in the create/update funcs without much boilerplate. The only thing I would change with the parsing of the API response for |
c3af797
to
8f92514
Compare
Agreed, splitting it into a slice makes more sense. I've scrapped the functions and moved the contents into the create/update/read functions |
8f92514
to
dc848ac
Compare
I've hit a new issue now that I'm hoping you can help advise on. Currently I set
So I then had the idea to set
So I can't work out what value you set if you want to turn both options off.. I hope that makes sense! Any ideas? |
Hi @alexwilcox9, this is a fairly common issue which is easily resolvable, but requires a change in the SDK (hamilton). For values that should be unset by sending I've tried to catch as many of these as I can based on documentation, but it doesn't always indicate in the docs, and sometimes I miss them. You can fix it in Hamilton and it should solve this. The line to fix is https://github.com/manicminer/hamilton/blob/main/msgraph/models.go#L1126 It is currently: PasswordPolicies *string `json:"passwordPolicies,omitempty"` but it should be: PasswordPolicies *StringNullWhenEmpty `json:"passwordPolicies,omitempty"` Give me a shout on Slack if I can assist with making this change in your dev environment. I often add a go.mod override and then vendor from a local git clone, and then PR the change in Hamilton once i'm confident it works. |
dc848ac
to
cc269fd
Compare
Thanks for the tip and help getting my environment set up, I've created a PR in the SDK repo for this change |
Just thinking... whilst I'm at it should I update the user data resource to include these new attributes? |
a31b074
to
adca99c
Compare
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.
This looks and works great, just some minor suggestions on variable naming but otherwise this LGTM 👍
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.
This functionality has been released in v2.2.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Closes: #136
@manicminer is this the kind of thing you had in mind?
One thing I haven't checked is if both are true will graph always return them in that order or should we just check if the string contains
DisablePasswordExpiration
/DisableStrongPassword
rather than going for an exact match