mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
19 lines
482 B
Python
19 lines
482 B
Python
import base64
|
|
import os
|
|
|
|
from awx.main.utils import get_awx_version
|
|
|
|
|
|
def csp(request):
|
|
return {'csp_nonce': base64.encodebytes(os.urandom(32)).decode().rstrip()}
|
|
|
|
|
|
def version(request):
|
|
context = getattr(request, 'parser_context', {})
|
|
return {
|
|
'version': get_awx_version(),
|
|
'tower_version': get_awx_version(),
|
|
'short_tower_version': get_awx_version().split('-')[0],
|
|
'deprecated': getattr(context.get('view'), 'deprecated', False),
|
|
}
|