Expose the Account API (RADIUS users)

* Adds Account CRUD API
* Enahnces `emptyStringInt` with a predicate for dynamically setting
  which value should be interpreted as a blank JSON payload
This commit is contained in:
James Stephenson
2020-08-21 08:08:51 -04:00
committed by Paul Tyng
parent ae40573bb7
commit 47fa522aba
7 changed files with 141 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ type Account struct {
NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"`
IP string `json:"ip"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
IP string `json:"ip,omitempty"`
Name string `json:"name,omitempty"` // ^[^"' ]+$
TunnelConfigType string `json:"tunnel_config_type,omitempty"` // vpn|802.1x|custom
TunnelMediumType int `json:"tunnel_medium_type,omitempty"` // [1-9]|1[0-5]|^$