-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: yaml config file support (#340)
* initial yaml support * add test that reads yaml config
- Loading branch information
1 parent
67ed17c
commit ab7577b
Showing
9 changed files
with
109 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"domains": [ | ||
{ | ||
"domain": "domain1.tld", | ||
"sans": [ | ||
"domain3.tld", | ||
"domain4.tld" | ||
] | ||
}, | ||
{ | ||
"domain": "domain2.tld" | ||
} | ||
], | ||
"email": "[email protected]", | ||
"vault": { | ||
"authMethod": "approle", | ||
"addr": "https://vault:8200", | ||
"secretId": "secretId", | ||
"roleId": "roleId", | ||
"pathPrefix": "preprod", | ||
"kv2MountPath": "secret", | ||
"awsMountPath": "custom-aws-mountpath", | ||
"awsRole": "my-custom-role" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
domains: | ||
- domain: domain1.tld | ||
sans: | ||
- domain3.tld | ||
- domain4.tld | ||
- domain: domain2.tld | ||
email: [email protected] | ||
vault: | ||
authMethod: approle | ||
addr: https://vault:8200 | ||
secretId: secretId | ||
roleId: roleId | ||
pathPrefix: preprod | ||
kv2MountPath: secret | ||
awsMountPath: custom-aws-mountpath | ||
awsRole: my-custom-role |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,41 @@ func TestAcmeVaultServerConfigFromFile(t *testing.T) { | |
wantErr bool | ||
}{ | ||
{ | ||
name: "example server config", | ||
path: "../../contrib/server.json", | ||
name: "example json config", | ||
path: "../../contrib/config.json", | ||
want: AcmeVaultServerConfig{ | ||
VaultConfig: VaultConfig{ | ||
Vault: VaultConfig{ | ||
Addr: "https://vault:8200", | ||
SecretId: "secretId", | ||
RoleId: "roleId", | ||
PathPrefix: "preprod", | ||
AuthMethod: "approle", | ||
Kv2MountPath: "secret", | ||
AwsMountPath: "custom-aws-mountpath", | ||
AwsRole: "my-custom-role", | ||
}, | ||
AcmeEmail: "[email protected]", | ||
AcmeUrl: letsEncryptUrl, | ||
AcmeDnsProvider: "", | ||
IntervalSeconds: 43200, | ||
Domains: []AcmeServerDomains{ | ||
{ | ||
Domain: "domain1.tld", | ||
Sans: []string{"domain3.tld", "domain4.tld"}, | ||
}, | ||
{ | ||
Domain: "domain2.tld", | ||
}, | ||
}, | ||
MetricsAddr: "127.0.0.1:9112", | ||
}, | ||
wantErr: false, | ||
}, | ||
{ | ||
name: "example yaml config", | ||
path: "../../contrib/config.yaml", | ||
want: AcmeVaultServerConfig{ | ||
Vault: VaultConfig{ | ||
Addr: "https://vault:8200", | ||
SecretId: "secretId", | ||
RoleId: "roleId", | ||
|
@@ -292,7 +323,7 @@ func TestAcmeVaultServerConfig_Validate(t *testing.T) { | |
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
conf := AcmeVaultServerConfig{ | ||
VaultConfig: tt.fields.VaultConfig, | ||
Vault: tt.fields.VaultConfig, | ||
AcmeEmail: tt.fields.AcmeEmail, | ||
AcmeUrl: tt.fields.AcmeUrl, | ||
AcmeDnsProvider: tt.fields.AcmeDnsProvider, | ||
|