Update IPSecESPLifetime

This commit is contained in:
appkins
2025-04-13 22:23:08 -05:00
parent 39c704d3ec
commit 73d68d5ac1
8 changed files with 19 additions and 19 deletions

View File

@@ -92,7 +92,7 @@ type Network struct {
IPSecEspDhGroup int `json:"ipsec_esp_dh_group,omitempty"` // 1|2|5|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32
IPSecEspEncryption string `json:"ipsec_esp_encryption,omitempty"` // aes128|aes192|aes256|3des
IPSecEspHash string `json:"ipsec_esp_hash,omitempty"` // sha1|md5|sha256|sha384|sha512
IPSecEspLifetime string `json:"ipsec_esp_lifetime,omitempty"` // ^(?:3[0-9]|[4-9][0-9]|[1-9][0-9]{2,3}|[1-7][0-9]{4}|8[0-5][0-9]{3}|86[0-3][0-9]{2}|86400)$
IPSecEspLifetime emptyStringInt `json:"ipsec_esp_lifetime,omitempty"` // ^(?:3[0-9]|[4-9][0-9]|[1-9][0-9]{2,3}|[1-7][0-9]{4}|8[0-5][0-9]{3}|86[0-3][0-9]{2}|86400)$
IPSecHash string `json:"ipsec_hash,omitempty"` // sha1|md5|sha256|sha384|sha512
IPSecIkeDhGroup int `json:"ipsec_ike_dh_group,omitempty"` // 1|2|5|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32
IPSecIkeEncryption string `json:"ipsec_ike_encryption,omitempty"` // aes128|aes192|aes256|3des

View File

@@ -12,7 +12,7 @@ type Setting struct {
Key string `json:"key"`
}
func (s *Setting) newFields() (interface{}, error) {
func (s *Setting) newFields() (any, error) {
switch s.Key {
case "auto_speedtest":
return &SettingAutoSpeedtest{}, nil
@@ -79,7 +79,7 @@ func (s *Setting) newFields() (interface{}, error) {
return nil, fmt.Errorf("unexpected key %q", s.Key)
}
func (c *Client) GetSetting(ctx context.Context, site, key string) (*Setting, interface{}, error) {
func (c *Client) GetSetting(ctx context.Context, site, key string) (*Setting, any, error) {
var respBody struct {
Meta meta `json:"meta"`
Data []json.RawMessage `json:"data"`

View File

@@ -190,7 +190,7 @@ func (c *Client) Login(ctx context.Context, user, pass string) error {
return nil
}
func (c *Client) do(ctx context.Context, method, relativeURL string, reqBody interface{}, respBody interface{}) error {
func (c *Client) do(ctx context.Context, method, relativeURL string, reqBody any, respBody any) error {
// single threading requests, this is mostly to assist in CSRF token propagation
c.Lock()
defer c.Unlock()

View File

@@ -71,8 +71,8 @@ func (c *Client) CreateUser(ctx context.Context, site string, d *User) (*User, e
return &user, nil
}
func (c *Client) stamgr(ctx context.Context, site, cmd string, data map[string]interface{}) ([]User, error) {
reqBody := map[string]interface{}{}
func (c *Client) stamgr(ctx context.Context, site, cmd string, data map[string]any) ([]User, error) {
reqBody := map[string]any{}
for k, v := range data {
reqBody[k] = v
@@ -94,7 +94,7 @@ func (c *Client) stamgr(ctx context.Context, site, cmd string, data map[string]i
}
func (c *Client) BlockUserByMAC(ctx context.Context, site, mac string) error {
users, err := c.stamgr(ctx, site, "block-sta", map[string]interface{}{
users, err := c.stamgr(ctx, site, "block-sta", map[string]any{
"mac": mac,
})
if err != nil {
@@ -107,7 +107,7 @@ func (c *Client) BlockUserByMAC(ctx context.Context, site, mac string) error {
}
func (c *Client) UnblockUserByMAC(ctx context.Context, site, mac string) error {
users, err := c.stamgr(ctx, site, "unblock-sta", map[string]interface{}{
users, err := c.stamgr(ctx, site, "unblock-sta", map[string]any{
"mac": mac,
})
if err != nil {
@@ -120,7 +120,7 @@ func (c *Client) UnblockUserByMAC(ctx context.Context, site, mac string) error {
}
func (c *Client) DeleteUserByMAC(ctx context.Context, site, mac string) error {
users, err := c.stamgr(ctx, site, "forget-sta", map[string]interface{}{
users, err := c.stamgr(ctx, site, "forget-sta", map[string]any{
"macs": []string{mac},
})
if err != nil {
@@ -133,7 +133,7 @@ func (c *Client) DeleteUserByMAC(ctx context.Context, site, mac string) error {
}
func (c *Client) KickUserByMAC(ctx context.Context, site, mac string) error {
users, err := c.stamgr(ctx, site, "kick-sta", map[string]interface{}{
users, err := c.stamgr(ctx, site, "kick-sta", map[string]any{
"mac": mac,
})
if err != nil {
@@ -146,7 +146,7 @@ func (c *Client) KickUserByMAC(ctx context.Context, site, mac string) error {
}
func (c *Client) OverrideUserFingerprint(ctx context.Context, site, mac string, devIdOveride int) error {
reqBody := map[string]interface{}{
reqBody := map[string]any{
"mac": mac,
"dev_id_override": devIdOveride,
"search_query": "",