-
Notifications
You must be signed in to change notification settings - Fork 31
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
Feature/user expiry #581
Feature/user expiry #581
Conversation
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.
Only a couple of minor nitpicks on the code. The only big thing is making a decision about whether or not we want to refactor to allow for a "never expires" option.
@@ -72,6 +73,12 @@ type Preparer struct { | |||
// HomeDir must also be indicated if MoveDir is set to true. | |||
MoveDir bool `hcl:"move_dir"` | |||
|
|||
// Expiry is the date on which the user account will be disabled. The date is | |||
// specified in the format YYYY-MM-DD. If not specified, the default expiry | |||
// date specified by the EXPIRE variable in /ect/default/useradd, or an empty |
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.
Typo. Should be /etc/default/useradd
// specified in the format YYYY-MM-DD. If not specified, the default expiry | ||
// date specified by the EXPIRE variable in /ect/default/useradd, or an empty | ||
// string (no expiry) will be used by default. | ||
Expiry time.Time `hcl:"expiry"` |
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 be *time.Time
? Otherwise any other changes to a user will have the side effect of setting an expiry since we'll always be setting it.
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.
I only set the expiry if it is specified in the hcl. There are checks in user.go (DiffAdd and DiffMod) for this.
Adds the ability to specify a user expiry when adding or modifying a user.