Skip to content

Commit

Permalink
[feature] Added auth no_cache openwisp#177
Browse files Browse the repository at this point in the history
  • Loading branch information
aagmanbhatt committed Mar 4, 2022
1 parent 47b4435 commit e587287
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/source/backends/openvpn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Required properties:
+--------------------------+---------+--------------+-------------------------------------------------------------+
| ``verb`` | integer | ``1`` | from ``0`` (disabled) to ``11`` (very verbose) |
+--------------------------+---------+--------------+-------------------------------------------------------------+
| ``auth_nocache`` | boolean | ``False`` | |
+--------------------------+---------+--------------+-------------------------------------------------------------+

Client specific settings
~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions netjsonconfig/backends/openvpn/openvpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def auto_client(
'float',
'fast_io',
'verb',
"auth_nocache",
]
for key in copy_keys:
if key in server:
Expand Down
11 changes: 11 additions & 0 deletions netjsonconfig/backends/openvpn/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,17 @@
"description": "Set output verbosity for logging and debugging",
"propertyOrder": 52,
},
"auth_nocache": {
"title": "auth nocache",
"description": (
"Cause OpenVPN to immediately forget username/password"
"inputs after they are used"
),
"type": "boolean",
"default": False,
"format": "checkbox",
"propertyOrder": 53,
},
},
},
"client": {
Expand Down
4 changes: 4 additions & 0 deletions tests/openvpn/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_server_mode(self):
{
"auth": "SHA1",
"auth_user_pass_verify": "",
"auth_nocache": True,
"ca": "ca.pem",
"cert": "cert.pem",
"cipher": "BF-CBC",
Expand Down Expand Up @@ -70,6 +71,7 @@ def test_server_mode(self):
expected = """# openvpn config: test-server
auth SHA1
auth-nocache
ca ca.pem
cert cert.pem
cipher BF-CBC
Expand Down Expand Up @@ -109,6 +111,7 @@ def test_client_mode(self):
{
"auth": "SHA256",
"auth_user_pass": "",
"auth_nocache": True,
"ca": "ca.pem",
"cert": "cert.pem",
"cipher": "AES-128-CBC",
Expand Down Expand Up @@ -161,6 +164,7 @@ def test_client_mode(self):
expected = """# openvpn config: test-client
auth SHA256
auth-nocache
ca ca.pem
cert cert.pem
cipher AES-128-CBC
Expand Down

0 comments on commit e587287

Please sign in to comment.