Certificate Authority work

This commit is contained in:
Jamie Curnow
2021-07-29 17:45:14 +10:00
parent ae00ab09e4
commit 339ee13346
35 changed files with 737 additions and 136 deletions

View File

@@ -33,13 +33,21 @@ func Create(ca *Model) (int, error) {
created_on,
modified_on,
name,
acme2_url,
acmesh_server,
ca_bundle,
max_domains,
is_wildcard_supported,
is_setup,
is_deleted
) VALUES (
:created_on,
:modified_on,
:name,
:acme2_url,
:acmesh_server,
:ca_bundle,
:max_domains,
:is_wildcard_supported,
:is_setup,
:is_deleted
)`, ca)
@@ -69,7 +77,11 @@ func Update(ca *Model) error {
created_on = :created_on,
modified_on = :modified_on,
name = :name,
acme2_url = :acme2_url,
acmesh_server = :acmesh_server,
ca_bundle = :ca_bundle,
max_domains = :max_domains,
is_wildcard_supported = :is_wildcard_supported,
is_setup = :is_setup,
is_deleted = :is_deleted
WHERE id = :id`, ca)

View File

@@ -14,12 +14,16 @@ const (
// Model is the user model
type Model struct {
ID int `json:"id" db:"id" filter:"id,integer"`
CreatedOn types.DBDate `json:"created_on" db:"created_on" filter:"created_on,integer"`
ModifiedOn types.DBDate `json:"modified_on" db:"modified_on" filter:"modified_on,integer"`
Name string `json:"name" db:"name" filter:"name,string"`
Acme2URL string `json:"acme2_url" db:"acme2_url" filter:"acme2_url,string"`
IsDeleted bool `json:"is_deleted,omitempty" db:"is_deleted"`
ID int `json:"id" db:"id" filter:"id,integer"`
CreatedOn types.DBDate `json:"created_on" db:"created_on" filter:"created_on,integer"`
ModifiedOn types.DBDate `json:"modified_on" db:"modified_on" filter:"modified_on,integer"`
Name string `json:"name" db:"name" filter:"name,string"`
AcmeshServer string `json:"acmesh_server" db:"acmesh_server" filter:"acmesh_server,string"`
CABundle string `json:"ca_bundle" db:"ca_bundle" filter:"ca_bundle,string"`
MaxDomains int `json:"max_domains" db:"max_domains" filter:"max_domains,integer"`
IsWildcardSupported bool `json:"is_wildcard_supported" db:"is_wildcard_supported" filter:"is_wildcard_supported,boolean"`
IsSetup bool `json:"is_setup" db:"is_setup" filter:"is_setup,boolean"`
IsDeleted bool `json:"is_deleted,omitempty" db:"is_deleted"`
}
func (m *Model) getByQuery(query string, params []interface{}) error {