fix: a VPN user downloads the own OpenVPN client profile through /account, with the current password and code.
Release / release (push) Successful in 22s
Release / release (push) Successful in 22s
This commit is contained in:
1 parent
74c24d7bc6
commit
9ca8fce14e
3 files changed
+17
-3
No files matched your search
@@ -1255,6 +1255,7 @@ router manages them, their display name and description included. A failure is o
|
|||||||
| `POST /account/passkeys` | `{"current_password", "current_code"}` | `{"id", "options"}`: a pending registration, valid 2 minutes, and the options of `navigator.credentials.create` in their JSON form |
|
| `POST /account/passkeys` | `{"current_password", "current_code"}` | `{"id", "options"}`: a pending registration, valid 2 minutes, and the options of `navigator.credentials.create` in their JSON form |
|
||||||
| `PUT /account/passkeys` | `{"id", "credential", "label"?}`, `credential` the browser's answer as its `toJSON()` gives it; `label` at most 64 characters, `Passkey` without one | the user |
|
| `PUT /account/passkeys` | `{"id", "credential", "label"?}`, `credential` the browser's answer as its `toJSON()` gives it; `label` at most 64 characters, `Passkey` without one | the user |
|
||||||
| `DELETE /account/passkeys/<id>` | | the user |
|
| `DELETE /account/passkeys/<id>` | | the user |
|
||||||
|
| `POST /account/profile` | `{"current_password", "current_code"}` | `{"name", "profile"}`, the user's OpenVPN client profile |
|
||||||
| `POST /account/apple-profile` | `{"current_password", "current_code", "password"}` | `{"name", "profile"}`, the user's Apple configuration profile of IKEv2 road-warrior access (see Apple VPN profile) |
|
| `POST /account/apple-profile` | `{"current_password", "current_code", "password"}` | `{"name", "profile"}`, the user's Apple configuration profile of IKEv2 road-warrior access (see Apple VPN profile) |
|
||||||
|
|
||||||
`current_code` is needed only for a user enrolled for TOTP; removing a passkey needs neither. A wrong current password or code gets
|
`current_code` is needed only for a user enrolled for TOTP; removing a passkey needs neither. A wrong current password or code gets
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
vpn-router (0.32.1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
fix: a VPN user downloads the own OpenVPN client profile through /account, with the current password and code.
|
||||||
|
|
||||||
|
* POST /account/profile answers the user's OpenVPN client profile; it
|
||||||
|
needs the current password and, when enrolled, a code.
|
||||||
|
|
||||||
|
-- Slawomir Koszewski <slawek@koszewscy.waw.pl> Tue, 27 Oct 2026 16:00:00 +0100
|
||||||
|
|
||||||
vpn-router (0.32.0-1) unstable; urgency=medium
|
vpn-router (0.32.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
feature: the web service gives Apple VPN profiles that set up IKEv2 road-warrior access on macOS, iOS and iPadOS.
|
feature: the web service gives Apple VPN profiles that set up IKEv2 road-warrior access on macOS, iOS and iPadOS.
|
||||||
|
|||||||
@@ -1048,12 +1048,14 @@ def account(name, method, path, body):
|
|||||||
PUT /account/passkeys store the passkey: {"id", "credential", "label"?}, credential the browser's answer
|
PUT /account/passkeys store the passkey: {"id", "credential", "label"?}, credential the browser's answer
|
||||||
DELETE /account/passkeys/<id>
|
DELETE /account/passkeys/<id>
|
||||||
remove a passkey
|
remove a passkey
|
||||||
|
POST /account/profile the user's OpenVPN client profile: {"current_password", "current_code"?}; {"name",
|
||||||
|
"profile"}
|
||||||
POST /account/apple-profile
|
POST /account/apple-profile
|
||||||
the user's Apple configuration profile of IKEv2 road-warrior access:
|
the user's Apple configuration profile of IKEv2 road-warrior access:
|
||||||
{"current_password", "current_code"?, "password"}, password encrypting the user's key in
|
{"current_password", "current_code"?, "password"}, password encrypting the user's key in
|
||||||
it; {"name", "profile"}
|
it; {"name", "profile"}
|
||||||
|
|
||||||
A change but the removal of a passkey, and the Apple profile, need the current password and, for an enrolled user, a
|
A change but the removal of a passkey, and the profiles, need the current password and, for an enrolled user, a
|
||||||
current code; a wrong
|
current code; a wrong
|
||||||
one is 403 and counts as a failed login. A password change revokes the user's refresh tokens.
|
one is 403 and counts as a failed login. A password change revokes the user's refresh tokens.
|
||||||
"""
|
"""
|
||||||
@@ -1064,13 +1066,13 @@ def account(name, method, path, body):
|
|||||||
removing = method == 'DELETE' and path.startswith('/account/passkeys/') and len(path.strip('/').split('/')) == 3
|
removing = method == 'DELETE' and path.startswith('/account/passkeys/') and len(path.strip('/').split('/')) == 3
|
||||||
if not removing and route not in (('GET', '/account'), ('PUT', '/account/password'), ('POST', '/account/otp'),
|
if not removing and route not in (('GET', '/account'), ('PUT', '/account/password'), ('POST', '/account/otp'),
|
||||||
('PUT', '/account/otp'), ('POST', '/account/passkeys'), ('PUT', '/account/passkeys'),
|
('PUT', '/account/otp'), ('POST', '/account/passkeys'), ('PUT', '/account/passkeys'),
|
||||||
('POST', '/account/apple-profile')):
|
('POST', '/account/profile'), ('POST', '/account/apple-profile')):
|
||||||
return 404, {'error': f'no route {method} {path}'}
|
return 404, {'error': f'no route {method} {path}'}
|
||||||
try:
|
try:
|
||||||
if route == ('PUT', '/account/password'):
|
if route == ('PUT', '/account/password'):
|
||||||
vpnrouter_users.check_password(body.get('password'))
|
vpnrouter_users.check_password(body.get('password'))
|
||||||
if route in (('PUT', '/account/password'), ('PUT', '/account/otp'), ('POST', '/account/passkeys'),
|
if route in (('PUT', '/account/password'), ('PUT', '/account/otp'), ('POST', '/account/passkeys'),
|
||||||
('POST', '/account/apple-profile')):
|
('POST', '/account/profile'), ('POST', '/account/apple-profile')):
|
||||||
vpnrouter_users.login(name, body.get('current_password'), body.get('current_code'))
|
vpnrouter_users.login(name, body.get('current_password'), body.get('current_code'))
|
||||||
with vpnrouter_users.session() as connection:
|
with vpnrouter_users.session() as connection:
|
||||||
if route == ('GET', '/account'):
|
if route == ('GET', '/account'):
|
||||||
@@ -1080,6 +1082,8 @@ def account(name, method, path, body):
|
|||||||
document = vpnrouter_users.passwd(connection, name, body['password'])
|
document = vpnrouter_users.passwd(connection, name, body['password'])
|
||||||
elif route == ('POST', '/account/otp'):
|
elif route == ('POST', '/account/otp'):
|
||||||
document = vpnrouter_users.otp_new(connection, name)
|
document = vpnrouter_users.otp_new(connection, name)
|
||||||
|
elif route == ('POST', '/account/profile'):
|
||||||
|
document = vpnrouter_users.profile(connection, name)
|
||||||
elif route == ('POST', '/account/apple-profile'):
|
elif route == ('POST', '/account/apple-profile'):
|
||||||
document = vpnrouter_users.apple_profile(connection, name, body.get('password'))
|
document = vpnrouter_users.apple_profile(connection, name, body.get('password'))
|
||||||
elif route == ('POST', '/account/passkeys'):
|
elif route == ('POST', '/account/passkeys'):
|
||||||
|
|||||||
Reference in new issue
Block a user