-
Notifications
You must be signed in to change notification settings - Fork 357
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
add ModifyDN() - moddn/modrdn #54
Conversation
moddn.go
Outdated
return nil | ||
} | ||
|
||
// vim: ts=4 sw=4 noexpandtab nolist |
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.
drop this line
just a few comments, then LGTM, thanks |
+1 nice job @vetinari ! |
* Parse() wraps Unmarshal() to parse a string * Apply() sends an *LDIF to the given ldap.Client to modify the server ... changes for go-ldap#54 already included by commented
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.
moddn.go
Outdated
// To move an object in the tree, set the "newSup" to the new parent entry DN. Use an | ||
// empty string for just changing the object's RDN. | ||
// | ||
// For moving the object without renaming the "rdn" must be the first |
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.
Example for moving without renaming? Also a comma "without renaming, the"
// mdnReq := NewModifyDNRequest("uid=someone,dc=example,dc=org", "uid=newname", true, "") | ||
// will setup the request to just rename uid=someone,dc=example,dc=org to | ||
// uid=newname,dc=example,dc=org. | ||
func NewModifyDNRequest(dn string, rdn string, delOld bool, newSup string) *ModifyDNRequest { |
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.
For future documentation clarity (godoc) it wouldn't hurt to have 3 short examples:
- Rename without move
- Rename with move
- Move only
Or just actual Example
functions in a moddn_test.go file? (https://blog.golang.org/examples)
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.
made an moddn_test.go with the 3 examples
Hi. Is any progress expected in this PR? Looking forward for this feature. |
Awesome to see this. Good work! When will it be released? I'm struggling with RDN renaming (login change) right now. |
Perhaps somehow I'm viewing an older version or something, but on line 64 of moddn.go, shouldn't l.nextMessageID be the function call l.nextMessageID() ?? |
@oldCoderException right, the () were missing. probably happened while porting my production tree to this one |
Don't mean to be a pain but any idea when this makes it into the baseline? We've been using it in production for a few months now. Thanks! |
I think I'm ready to merge this @liggitt unless you have any concerns? |
No concerns, though I haven't tried the function against a real server |
I recently tested this against production LDAP using my fork which cherry-picks this PR. I needed to migrate many hundreds of users uid to a new login schema (pass-through to AD). It is a component of the DN in this environment. @vetinari moddn PR worked perfectly. @vetinari FYI I had to drop your README modifications to this PR into my fork, you need to update it to make it merge ready @johnweldon @liggitt any chance this can be merged at some point before it's 2 year anniversary? edit: to link to moddn branch in my fork |
I would LOVE to have this feature merged, since I'm developing a web-based user management system using go, and renaming a user is quite common. |
rebased as #149 |
merged in #149 |
fixes #63
This implements the ModifyDNRequest from RFC 4511