Skip to content

Commit ad66895

Browse files
Andrew CantinoIryna Shustava
authored andcommitted
--exclude-special -> --include-special
[#139303811] Special characters should be excluded by default Signed-off-by: Iryna Shustava <ishustava@pivotal.io>
1 parent eca3c5d commit ad66895

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ CREDENTIAL MANAGEMENT:
6969
-U, --exclude-upper [Password] Exclude upper alpha characters from generated value
7070
-L, --exclude-lower [Password] Exclude lower alpha characters from generated value
7171
-N, --exclude-number [Password] Exclude number characters from generated value
72-
-S, --exclude-special [Password] Exclude special characters from generated value
72+
-S, --include-special [Password] Include special characters in the generated value
7373
-H, --only-hex [Password] Use only hexadecimal characters in generated value
7474
-k, --key-length [2048, 3072, 4096] [Certificate, SSH, RSA] Bit length of the generated key (Default: 2048)
7575
-m, --ssh-comment 'COMMENT' [SSH] A comment appended to the SSH public key for identification

client/requests_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ var _ = Describe("API", func() {
200200

201201
It("returns a request with parameters", func() {
202202
parameters := models.SecretParameters{
203-
ExcludeSpecial: true,
203+
IncludeSpecial: true,
204204
ExcludeNumber: true,
205205
ExcludeUpper: true,
206206
ExcludeLower: true,
@@ -211,7 +211,7 @@ var _ = Describe("API", func() {
211211
"type":"password",
212212
"overwrite":false,
213213
"parameters": {
214-
"exclude_special": true,
214+
"include_special": true,
215215
"exclude_number": true,
216216
"exclude_upper": true,
217217
"exclude_lower": true,

commands/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type GenerateCommand struct {
1414
NoOverwrite bool `short:"O" long:"no-overwrite" description:"Credential is not modified if stored value already exists"`
1515
OutputJson bool `long:"output-json" description:"Return response in JSON format"`
1616
Length int `short:"l" long:"length" description:"[Password] Length of the generated value (Default: 30)"`
17-
ExcludeSpecial bool `short:"S" long:"exclude-special" description:"[Password] Exclude special characters from the generated value"`
17+
IncludeSpecial bool `short:"S" long:"include-special" description:"[Password] Include special characters in the generated value"`
1818
ExcludeNumber bool `short:"N" long:"exclude-number" description:"[Password] Exclude number characters from the generated value"`
1919
ExcludeUpper bool `short:"U" long:"exclude-upper" description:"[Password] Exclude upper alpha characters from the generated value"`
2020
ExcludeLower bool `short:"L" long:"exclude-lower" description:"[Password] Exclude lower alpha characters from the generated value"`
@@ -45,7 +45,7 @@ func (cmd GenerateCommand) Execute([]string) error {
4545
repository := repositories.NewSecretRepository(client.NewHttpClient(cfg))
4646

4747
parameters := models.SecretParameters{
48-
ExcludeSpecial: cmd.ExcludeSpecial,
48+
IncludeSpecial: cmd.IncludeSpecial,
4949
ExcludeNumber: cmd.ExcludeNumber,
5050
ExcludeUpper: cmd.ExcludeUpper,
5151
ExcludeLower: cmd.ExcludeLower,

commands/generate_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ var _ = Describe("Generate", func() {
9999
Eventually(session).Should(Exit(0))
100100
})
101101

102-
It("excluding special characters", func() {
103-
setupPasswordPostServer("my-password", "potatoes", generateRequestJson("password", "my-password", `{"exclude_special":true}`, true))
104-
session := runCommand("generate", "-n", "my-password", "-t", "password", "--exclude-special")
102+
It("including special characters", func() {
103+
setupPasswordPostServer("my-password", "potatoes", generateRequestJson("password", "my-password", `{"include_special":true}`, true))
104+
session := runCommand("generate", "-n", "my-password", "-t", "password", "--include-special")
105105
Eventually(session).Should(Exit(0))
106106
})
107107

@@ -345,7 +345,7 @@ var _ = Describe("Generate", func() {
345345
commands.HaveFlag("type", "t"),
346346
commands.HaveFlag("no-overwrite", "O"),
347347
commands.HaveFlag("length", "l"),
348-
commands.HaveFlag("exclude-special", "S"),
348+
commands.HaveFlag("include-special", "S"),
349349
commands.HaveFlag("exclude-number", "N"),
350350
commands.HaveFlag("exclude-upper", "U"),
351351
commands.HaveFlag("exclude-lower", "L"),

models/secret_parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package models
22

33
type SecretParameters struct {
4-
ExcludeSpecial bool `json:"exclude_special,omitempty"`
4+
IncludeSpecial bool `json:"include_special,omitempty"`
55
ExcludeNumber bool `json:"exclude_number,omitempty"`
66
ExcludeUpper bool `json:"exclude_upper,omitempty"`
77
ExcludeLower bool `json:"exclude_lower,omitempty"`

0 commit comments

Comments
 (0)