Skip to content

Commit b06331a

Browse files
authored
[feature] Added auth no_cache #177
Closes #177
1 parent 47b4435 commit b06331a

4 files changed

Lines changed: 18 additions & 0 deletions

File tree

docs/source/backends/openvpn.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ Required properties:
169169
+--------------------------+---------+--------------+-------------------------------------------------------------+
170170
| ``verb`` | integer | ``1`` | from ``0`` (disabled) to ``11`` (very verbose) |
171171
+--------------------------+---------+--------------+-------------------------------------------------------------+
172+
| ``auth_nocache`` | boolean | ``False`` | |
173+
+--------------------------+---------+--------------+-------------------------------------------------------------+
172174

173175
Client specific settings
174176
~~~~~~~~~~~~~~~~~~~~~~~~

netjsonconfig/backends/openvpn/openvpn.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def auto_client(
106106
'float',
107107
'fast_io',
108108
'verb',
109+
"auth_nocache",
109110
]
110111
for key in copy_keys:
111112
if key in server:

netjsonconfig/backends/openvpn/schema.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,17 @@
445445
"description": "Set output verbosity for logging and debugging",
446446
"propertyOrder": 52,
447447
},
448+
"auth_nocache": {
449+
"title": "auth nocache",
450+
"description": (
451+
"Cause OpenVPN to immediately forget username/password"
452+
"inputs after they are used"
453+
),
454+
"type": "boolean",
455+
"default": False,
456+
"format": "checkbox",
457+
"propertyOrder": 53,
458+
},
448459
},
449460
},
450461
"client": {

tests/openvpn/test_backend.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def test_server_mode(self):
2020
{
2121
"auth": "SHA1",
2222
"auth_user_pass_verify": "",
23+
"auth_nocache": True,
2324
"ca": "ca.pem",
2425
"cert": "cert.pem",
2526
"cipher": "BF-CBC",
@@ -70,6 +71,7 @@ def test_server_mode(self):
7071
expected = """# openvpn config: test-server
7172
7273
auth SHA1
74+
auth-nocache
7375
ca ca.pem
7476
cert cert.pem
7577
cipher BF-CBC
@@ -109,6 +111,7 @@ def test_client_mode(self):
109111
{
110112
"auth": "SHA256",
111113
"auth_user_pass": "",
114+
"auth_nocache": True,
112115
"ca": "ca.pem",
113116
"cert": "cert.pem",
114117
"cipher": "AES-128-CBC",
@@ -161,6 +164,7 @@ def test_client_mode(self):
161164
expected = """# openvpn config: test-client
162165
163166
auth SHA256
167+
auth-nocache
164168
ca ca.pem
165169
cert cert.pem
166170
cipher AES-128-CBC

0 commit comments

Comments
 (0)