-
Notifications
You must be signed in to change notification settings - Fork 288
Allow a few global defaults to be pulled from the CA #1377
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
Conversation
d8493f8 to
45286f9
Compare
- min-encryption-password-length - provisioner Enforce min-encryption-password-length, if set, in the 'step ssh certificate' command.
5de1ab3 to
9b1015f
Compare
utils/cautils/bootstrap.go
Outdated
| Issuer string `json:"issuer"` | ||
| MinPasswordLength int `json:"min-password-length"` |
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.
We probably want and use provisioner instead of issueromitempty
Provisioner string `json:"provisioner,omitempty"`
RedirectURL should also have an omitempty
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 is the response, so it can be ok here.
utils/cautils/bootstrap.go
Outdated
| Redirect string `json:"redirect-url"` | ||
| Issuer string `json:"issuer,omitempty"` | ||
| MinPasswordLength int `json:"min-password-length,omitempty"` |
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.
Omit empty on redirect-url and Provisioner instead of issuer.
- FirstStringOf returns value of first defined flag in input list
utils/cautils/token_flow.go
Outdated
|
|
||
| // Filter by issuer (provisioner name) | ||
| if issuer := ctx.String("issuer"); issuer != "" { | ||
| if issuer := flags.FirstStringOf(ctx, "issuer", "provisioner"); issuer != "" { |
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.
Here and above, I would preffer "provisioner", "issuer"
maraino
left a comment
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.
lgtm, ideally the api should set provisioner too, but ...
flags/flags_test.go
Outdated
| /* | ||
| { | ||
| name: "negative", | ||
| minLength: -5, | ||
| promptRun: promptRunner([]string{"foobar"}, nil), | ||
| want: "foobar", | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "zero", | ||
| minLength: 0, | ||
| promptRun: promptRunner([]string{"foobar"}, nil), | ||
| want: "foobar", | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "greater-than-min-length", | ||
| minLength: 5, | ||
| promptRun: promptRunner([]string{"foobar"}, nil), | ||
| want: "foobar", | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "equal-min-length", | ||
| minLength: 6, | ||
| promptRun: promptRunner([]string{"foobar"}, nil), | ||
| want: "foobar", | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "less-than-min-length", | ||
| minLength: 8, | ||
| promptRun: promptRunner([]string{"pass", "foobar", "password"}, nil), | ||
| want: "password", | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "ignore-post-whitespace-characters", | ||
| minLength: 7, | ||
| promptRun: promptRunner([]string{"pass ", "foobar ", "password "}, nil), | ||
| want: "password", | ||
| wantErr: false, | ||
| }, | ||
| */ |
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.
Can you uncomment or remove these tests?
utils/cautils/bootstrap.go
Outdated
| Provisioner string `json:"provisioner,omitempty"` | ||
| MinPasswordLength int `json:"min-password-length,omitempty"` |
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.
Ok, but on responses omitempty is not necessary
maraino
left a comment
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.
lgtm
Enforce min-password-length, if set, in the 'step ssh certificate' command.