Skip to content

Commit e9a27f7

Browse files
committed
xvp: Start using consoleauth tokens
This service is EOL and likely unused in the wild. However, it was still using the nova-consoleauth service for authentication. Correct this, allowing us to remove nova-consoleauth. Part of blueprint remove-consoleauth Change-Id: If14244559b68276eb1e43c59c821978ec591ae14 Signed-off-by: Stephen Finucane <[email protected]>
1 parent a5cf4ae commit e9a27f7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nova/vnc/xvp_proxy.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
import webob
2727

2828
import nova.conf
29-
from nova.consoleauth import rpcapi as consoleauth_rpcapi
3029
from nova import context
30+
from nova import exception
3131
from nova.i18n import _LI
32+
from nova import objects
3233
from nova import utils
3334
from nova import version
3435
from nova import wsgi
@@ -131,10 +132,11 @@ def __call__(self, environ, start_response):
131132
return "Invalid Request"
132133

133134
ctxt = context.get_admin_context()
134-
api = consoleauth_rpcapi.ConsoleAuthAPI()
135-
connect_info = api.check_token(ctxt, token)
136135

137-
if not connect_info:
136+
try:
137+
connect_info = objects.ConsoleAuthToken.validate(
138+
ctxt, token).to_dict()
139+
except exception.InvalidToken:
138140
LOG.info(_LI("Request made with invalid token: %s"), req)
139141
start_response('401 Not Authorized',
140142
[('content-type', 'text/html')])

0 commit comments

Comments
 (0)