Skip to content

Commit

Permalink
add email_insecure + fix configs booleans params on configs endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Blampey committed Nov 2, 2020
1 parent ce0f3b5 commit c6f0254
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func GetConfigEmail(d *schema.ResourceData) models.ConfigBodyPost {
EmailPassword: d.Get("email_password").(string),
EmailFrom: d.Get("email_from").(string),
EmailSsl: d.Get("email_ssl").(bool),
EmailInsecure: d.Get("email_insecure").(bool),
}
}

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The Harbor provider is used to configure an instance of Harbor. The provider nee
## Resources
* [Resource: harbor_configuration](resources/configuration.md)
* [Resource: harbor_config_system](resources/config_system.md)
* [Resource: harbor_config_email](resources/config_email.md)
* [Resource: harbor_interrogation_services](resources/interrogation_services.md)
* [Resource: harbor_project_member_group](resources/project_member_group.md)
* [Resource: harbor_project_member_user](resources/project_member_user.md)
Expand Down
5 changes: 3 additions & 2 deletions docs/resources/config_email.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Resource: harbor_config_system
# Resource: harbor_config_email

## Example Usage

Expand All @@ -17,4 +17,5 @@ The following arguments are supported:
* **email_username** - (Optional) The username for the email server
* **email_password** - (Optional) The password for the email server
* **email_from** - (Required) - The email from address ie, `[email protected]`
* **email_ssl** - (Optional) Enable SSL for email server connection
* **email_ssl** - (Optional) Enable SSL for email server connection
* **email_insecure** - (Optional) Verify Certificate for email server connection
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
13 changes: 6 additions & 7 deletions models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package models
var PathConfig = "/configurations"

type ConfigBodyPost struct {
OidcVerifyCert bool `json:"oidc_verify_cert,omitempty"`
OidcVerifyCert bool `json:"oidc_verify_cert"`
EmailIdentity string `json:"email_identity,omitempty"`
LdapGroupSearchFilter string `json:"ldap_group_search_filter,omitempty"`
AuthMode string `json:"auth_mode,omitempty"`
SelfRegistration bool `json:"self_registration,omitempty"`
SelfRegistration bool `json:"self_registration"`
OidcScope string `json:"oidc_scope,omitempty"`
LdapSearchDn string `json:"ldap_search_dn,omitempty"`
StoragePerProject string `json:"storage_per_project,omitempty"`
Expand All @@ -17,20 +17,19 @@ type ConfigBodyPost struct {
DailyTime int `json:"daily_time,omitempty"`
} `json:"parameter,omitempty"`
} `json:"scan_all_policy,omitempty"`
VerifyRemoteCert bool `json:"verify_remote_cert,omitempty"`
LdapTimeout int `json:"ldap_timeout,omitempty"`
LdapBaseDn string `json:"ldap_base_dn,omitempty"`
LdapFilter string `json:"ldap_filter,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
QuotaPerProjectEnable bool `json:"quota_per_project_enable,omitempty"`
ReadOnly bool `json:"read_only"`
QuotaPerProjectEnable bool `json:"quota_per_project_enable"`
LdapURL string `json:"ldap_url,omitempty"`
OidcName string `json:"oidc_name,omitempty"`
ProjectCreationRestriction string `json:"project_creation_restriction,omitempty"`
LdapUID string `json:"ldap_uid,omitempty"`
OidcClientID string `json:"oidc_client_id,omitempty"`
LdapGroupBaseDn string `json:"ldap_group_base_dn,omitempty"`
LdapGroupAttributeName string `json:"ldap_group_attribute_name,omitempty"`
EmailInsecure bool `json:"email_insecure,omitempty"`
EmailInsecure bool `json:"email_insecure"`
LdapGroupAdminDn string `json:"ldap_group_admin_dn,omitempty"`
EmailUsername string `json:"email_username,omitempty"`
EmailPassword string `json:"email_password,omitempty"`
Expand All @@ -41,7 +40,7 @@ type ConfigBodyPost struct {
CountPerProject string `json:"count_per_project,omitempty"`
TokenExpiration int `json:"token_expiration,omitempty"`
LdapGroupSearchScope int `json:"ldap_group_search_scope,omitempty"`
EmailSsl bool `json:"email_ssl,omitempty"`
EmailSsl bool `json:"email_ssl"`
EmailPort int `json:"email_port,omitempty"`
EmailHost string `json:"email_host,omitempty"`
EmailFrom string `json:"email_from,omitempty"`
Expand Down
13 changes: 7 additions & 6 deletions provider/resource_config_email.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ func resourceConfigEmail() *schema.Resource {
Required: true,
},
"email_ssl": {
Type: schema.TypeString,
Type: schema.TypeBool,
Optional: true,
Default: "false",
Default: false,
},
// "email_verify_cert": {
// Type: schema.TypeString,
// Optional: true,
// },
"email_insecure": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
},
Create: resourceConfigEmailCreate,
Read: resourceConfigEmailRead,
Expand Down

0 comments on commit c6f0254

Please sign in to comment.